Naming objects on command

Avatar
Spam Nugget
492 Posts
Posted Oct 10, 2011
Is it possible to change the name of objects on command? Basically, I want a trigger to name the acitvator (a cube) but i cant find the correct input. Im sure i saw something on here mention this ages ago, but i cant find it.
Advertisement
Registered users don’t see ads! Register now!
Avatar
Vordwann
767 Posts
Posted Oct 10, 2011
Replied 23 minutes later
I know there have been a million posts on this... and it's on the tip of my tongue... but I'm blanking on it.
Avatar
iWork925
1,080 Posts
Posted Oct 10, 2011
Replied 2 minutes later
ent_setname
Avatar
ChickenMobile
2,460 Posts
Posted Oct 11, 2011
Replied 8 hours later

iWork925 wrote:
ent_setname

That is a console command that sets the name of the object where the player is looking. What you should be using is 'ent_fire !activator addoutput "targetname namehere"'

You could also use 'classname' instead of targetname as well, however classname really defines what kind of entity it is and there is a possibility it will not work.

Avatar
Skotty
671 Posts
Posted Oct 11, 2011
Replied 5 hours later
He wanted a trigger to change the name of the cube.
Tell the trigger (like chicken already said)

OnTrigger
!activator
addoutput
targetname name

"Targetname name" into the 4. empty field below addoutput. NEVER use "" in ANY field or your VMF will fail loading and youll have to remove the "" by hand.

Advertisement
Registered users don’t see ads! Register now!
Avatar
Spam Nugget
492 Posts
Posted Oct 11, 2011
Replied 10 hours later
Thanks everyone, that works great