IO events

From Source Entities
Jump to navigation Jump to search

Source's Input/Output system allows level designers to quickly and easily change the states of objects and cause things to happen. Inputs and outputs are the most common method that entities use to communicate to one another.

Note: The input/output system doesn't have any strict limits, but a ludicrous amount will cause lag.

Outputs[edit | edit source]

This first part of an IO event is the output. Something has to happen to an entity, like being spawned, finding an enemy, or getting killed. An example is trigger_multiple's OnTrigger output, which fires whenever an object touches the trigger.

Some special outputs can generate otherwise inaccessible data, and put it in the parameter (discussed more below), unless the mapper does not want this. An example would be OnQueueMoved from ai_goal_actbusy_queue, which automatically puts the number of NPCs remaining in the queue into the parameter box.

Target[edit | edit source]

Once an entity is provoked into doing something, it needs another entity to target. Usually this should be a targetname, but it can also be a classname or a select few special names (listed below). This field can also accept wildcards, which are inserted with *. Entities named ent_1, ent_2, etc, can all be targeted at once with ent_*.

Special names:

  • !player - The player. Do not use in multiplayer, cause it will only target the first player that connected to the server.
  • !pvsplayer - To do: Describe this more thoroughly than VDC.
  • !caller - The previous entity in the current I/O chain. If a player walks into a trigger that fires to a logic_relay, the trigger is the !caller of the relay's outputs.
  • !activator - The entity that caused the entire I/O chain. If a player walks into a trigger that fires to a logic_relay, the player is the !activator of the relay's outputs.
  • !self - The entity from which the current output originates. Basically equivalent to an entity targeting its own targetname (unless there are multiple entities with that targetname).
  • !picker - Whatever the !player is currently looking at. If the player is not currently looking at anything, it picks whatever is closest to being looked at (which sometimes could end up being the player itself).
  • !speechtarget - The entity that the !caller is looking at due to a Look At Actor or Face Actor choreography event.
  • !nick, !bill, !zoey, etcL4d2-small.png - Each survivor character has their own special name correlating to them.
  • !player_blueP2.png - In coop, this targets Atlas.
  • !player_orangeP2.png - In coop, this targets P-body.
    • P2.pngBe careful about naming entities red or blue, because in coop, the two player entities assign these names to themselves.

Inputs[edit | edit source]

Inputs are things that an entity can be told to do. Example: TurnOff on env_projectedtexture. Some inputs are able to take parameters.

Parameters[edit | edit source]

Some inputs can take parameters to do different things. Example: SetParent, which sets the entity's parent to whatever is in the parameter.

As mentioned above, some outputs do automatically put data into the parameter box (though this is not viewable from the Hammer window). If mappers do not want those parameters, they can override it with something else.

Parameters can also use the special names listed above, but some are known to behave weirdly. They're also evaluated within the entity receiving the input, instead of the one sending it.

Delay[edit | edit source]

Simple as that. An amount of time that the game will wait before sending the input.

Tip: I/O events which fire at the exact same time may be executed in an unpredictable order. If this ends up being a problem, give them small delays.

Fire once[edit | edit source]

If this is checked, the IO event will only happen once ever. Otherwise, it will happen every time the output's conditions are met.

See Also[edit | edit source]