Targeting an individual object/pawn with "admin set" command

Discussions about Coding and Scripting
Post Reply
nullbyte
Novice
Posts: 27
Joined: Sat Sep 03, 2016 3:40 am

Targeting an individual object/pawn with "admin set" command

Post by nullbyte »

You may be aware that while in-game, you can change many properties of various objects/pawns via the "admin set" command.

Some examples:

Code: Select all

admin set playerpawn health 250

Code: Select all

admin set playerpawn drawscale 3

Code: Select all

admin set supershockrifle fireadjust 10
etc.

However, the above commands will affect *all* objects of the given class name across the entire map, and I'd like to be able to target a specific one.

For example, say I want to give a single player 999 health, but leave all other players unaffected. Or I want to summon a new VisibleTeleporter, and change its tag or destination tag without affecting the other teleporters in the map.

Is it possible to do this somehow - with or without creating a custom mutator (either is fine).

I've tried using the following kind of syntax, but without any success:

Code: Select all

admin set TMale2'CTF-Face.TMale4' health 999

Code: Select all

admin set Teleporter'CTF-Face.MyLevel.Teleporter2' tag test1
User avatar
Barbie
Godlike
Posts: 2792
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Targeting an individual object/pawn with "admin set" com

Post by Barbie »

nullbyte wrote:Is it possible to do this
According to wiki the SET command affects classes only.
nullbyte wrote:creating a custom mutator
That would be possible: use the Mutator's MUTATE function and pass that values to the Actor's SetPropertyText, e.g.:

Code: Select all

mutate <Your keyword here> <Actorname> <Propertyname>=<Newvalue>
Of course you have to parse the mutate string to split name and value.

But that is only half of the story: some Actors get initialized in Pre-/PostBeginPlay and may react different on different variable values. Example of Teleporter.uc:

Code: Select all

function PostBeginPlay() {
	if (URL ~= "")
		SetCollision(false, false, false); //destination only
...
So later changing the URL from an empty to a non empty string will work, but the Teleporter will not receive any touch.
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Targeting an individual object/pawn with "admin set" com

Post by sektor2111 »

nullbyte wrote: I've tried using the following kind of syntax, but without any success:

Code: Select all

admin set TMale2'CTF-Face.TMale4' health 999

Code: Select all

admin set Teleporter'CTF-Face.MyLevel.Teleporter2' tag test1
And if you start coding with console commands this is the wrong way... for sure these commands will not work and you SHOULD LEARN DEFAULT coding methods and their applicability first.
schwap
Novice
Posts: 20
Joined: Thu Aug 25, 2016 1:06 am

Re: Targeting an individual object/pawn with "admin set" com

Post by schwap »

I programmed this to select stuff individually:
Y47tAa06bRE

It ain't UT99 tho :D.. but the same engine and this would work on UT99 aswell.

You can change each objects rotation/location/color/drawscale/drawtype etc individually.
I know, you can do much more with the "admin set" commands, but it would be easy to add a command like "edit fireadjust xx" which would edit the object you selected in the menu.

Just dropping it here to get you some inspiration. :idea:

EDIT: just to clarify, this works without any "set" commands
Last edited by schwap on Sat Sep 03, 2016 2:36 pm, edited 1 time in total.
JackGriffin
Godlike
Posts: 3774
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: Targeting an individual object/pawn with "admin set" com

Post by JackGriffin »

While it's fine to use "set" commands within your mod coding you should NEVER use admin set for anything. Using that command can easily make changes that will not be undone by simply restarting the server. It can also make client changes that can't be fixed unless you also know the corresponding admin set command to return the behavior to normal. Nels is 100% correct above and you would be very wise to listen to him. This is the exact wrong way to go about trying to make changes.
So long, and thanks for all the fish
User avatar
Barbie
Godlike
Posts: 2792
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Targeting an individual object/pawn with "admin set" com

Post by Barbie »

Another problem concerning this has come into my mind: How to retrieve the name of a specific Actor if you want to change its properties? My base mutator does such changes as described above on loading a map with certain Actors, and I have to look up the Actor names in the editor first and put it into the code to address a specific Actor. If objects are created dynamically (like joining players) things get more complicated.

Maybe someone wants to create a new weapon that shows the name of the aimed target when shooting. ^^
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
ANUBITEK
Adept
Posts: 261
Joined: Sun Dec 28, 2014 1:10 am
Location: Anubitek

Re: Targeting an individual object/pawn with "admin set" com

Post by ANUBITEK »

schwap wrote:I programmed this to select stuff individually:
Y47tAa06bRE

It ain't UT99 tho :D.. but the same engine and this would work on UT99 aswell.

You can change each objects rotation/location/color/drawscale/drawtype etc individually.
I know, you can do much more with the "admin set" commands, but it would be easy to add a command like "edit fireadjust xx" which would edit the object you selected in the menu.

Just dropping it here to get you some inspiration. :idea:

EDIT: just to clarify, this works without any "set" commands
... Download link pls?
<<| http://uncodex.ut-files.com/ |>>

Code reference for UGold, UT99, Unreal2, UT2k3, UT3
Additional Beyond Unreal Wiki Links
wiki.beyondunreal.com/Legacy:Console_Bar
wiki.beyondunreal.com/Exec_commands#Load
wiki.beyondunreal.com/Legacy:Exec_Directive#Loading_Other_Packages
wiki.beyondunreal.com/Legacy:Config_Vars_And_.Ini_Files
wiki.beyondunreal.com/Legacy:INT_File
schwap
Novice
Posts: 20
Joined: Thu Aug 25, 2016 1:06 am

Re: Targeting an individual object/pawn with "admin set" com

Post by schwap »

This is included in my all-in-one mod (patches,fixes,anticheat,new features etc) which can be downloaded here:
http://therune.boards.net

But, due to the anticheat being inside (and a lot of engine exploits), the code is obfuscated and stripped.
JackGriffin
Godlike
Posts: 3774
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: Targeting an individual object/pawn with "admin set" com

Post by JackGriffin »

Barbie wrote: Maybe someone wants to create a new weapon that shows the name of the aimed target when shooting. ^^
It's called the HUD overlay and it's on most every monsterhunt server :lol2:

Jokes aside there's a hundred different ways to do this. 'Set' is a theory in it's most pure form and you can achieve this in other ways. If you shoot someone with your pistol then you identified a specific actor and caused them to TakeDamage. In essence you 'Set' them to less health. Uscript coding in it's most pure form.

Probably 60% of UScript is some form of 'set' theory in action if you think about it.
So long, and thanks for all the fish
nullbyte
Novice
Posts: 27
Joined: Sat Sep 03, 2016 3:40 am

Re: Targeting an individual object/pawn with "admin set" com

Post by nullbyte »

@LannFyre: That looks exactly like what I had in mind. In another thread, someone recommended SemiAdmin which I'll also try.

@Barbie: A "class finding gun" is also something I thought about. Point your cursor at something, and be able to edit it. Almost like an interactive version of the "EDITACTOR CLASS=x" command.

@Jack: You're right - "admin set" can be dangerous and this is only for experimentation and fun purposes.

I will explore some more and maybe try to create the custom mutator mentioned above. Thanks all.
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Targeting an individual object/pawn with "admin set" com

Post by sektor2111 »

nullbyte wrote:I will explore some more and maybe try to create the custom mutator mentioned above. Thanks all.
I'll bet is doable without any Console if you have a sudden console affinity and which will be pretty accurate without messing with any permanent change in system, right ?
Post Reply