Special Entity Names - By Raeven0 |
|
This tutorial was last updated on Apr 4, 2005.
There are five special entity names you can use in an entity's inputs and outputs. As an example of their usefullness, suppose you want a trigger_multiple to set fire to the player (single-player only). You could use the following output:
output OnTrigger
target !player
input Ignite
This would send the Ignite input to the first player to join the server. Now, suppose you wanted the trigger_multiple instead to ignite anything that triggers it. You could use this ouput instead:
output OnTrigger
target !activator
input Ignite
Any entity that activates the trigger_multiple will be sent the Ignite input. These special entity names can also be used in override parameters, and some can be used in entity fields (!player, for instance, is a valid target for an ai_relationship).
output OnTrigger
target entityB
input SetParent
override !player
The following special entity names can be used:
!activator - The entity that activated this one. Useful for trigger_* entities that can actually be activated. If logical entities (like a logic_case) are placed between the activator and the trigger, delaying its being triggered, HL2 can usually follow the chain of entities to the original activator.
!picker - The entity that the first player to join the server is looking at. !picker will even pick invisible entities like func_useableladder, but it won't pick the world.
!player - The first player to join the server. Most useful in single-player missions. To affect all players, use player instead.
!pvsplayer - The entity will look in its Potential Visibility Set and pick the first player it sees. That means it'll look around itself and find a player.
!self - The entity sending the input. Useful for point_template-spawned entities that will have different names.
Note that they all begin with an exclamation point (!). If you try to use a special name that doesn't exist (!foobar, for example), HL2 will do nothing but spit out an error.
This tutorial is brought to you in part by phresh of #editlife (irc.gamesurge.net).
Additional funding for Special Entity Names was provided by the five or ten people who joined my testmap server for no real reason.
Still need help? Ask your questions in one of our HELP FORUMS
|
|
|