activator Last edited 3 weeks ago2024-03-26 00:48:59 UTC

In GoldSrc entity system, the activator is the initiator of the entity events. Usually that means players walking into triggers or "use"-ing things. If such triggers have the "monsters" flag set then monsters could be activators too. Some entities can also trigger other entities on its own e.g. a func_train that passes a path_corner with a "Fire on pass" set will trigger the targeted entity with itself as the activator.

The activator is one of two entity references passed to an entity being triggered, the other being the caller. Whereas the caller is the immediate entity that triggers another entity, the activator reference is preserved and passed along when entities trigger other entities (aka a trigger chain). This allows a chaining of triggers e.g. a trigger targets a trigger_relay, which targets a game_text, which displays text to only the activator by default.
The following tables might help illustrate the concept of "trigger chain":
Scenario A: A player walks into a trigger
Entity player trigger_multiple trigger_relay game_text (any entity)
Name A B C D
Target B C D*
Activator player player player player
Caller player A B C
Affects player**
* perpetuates the trigger chain instead of setting recipient of the message
** affects the activator by default
Scenario B: A func_train passes a path_track with a "fire on pass" set
Entity func_train path_track trigger_relay (multiple)
Name A B C D
Target B C*** D
Activator (N/A) A A
Caller (N/A) A C
*** here means "fire on pass" (message)
Scenarios where activator is used: The activator chain however can be broken (i.e. the original activator reference lost) when: Therefore, care should be taken to make sure entities that affect activators aren't targeted in the above ways. For example, a multi_manager targeting a game_text will crash the game unless "All Players" flag is checked.

1 Comment

Commented 3 weeks ago2024-03-26 01:06:50 UTC Comment #106087
In vanilla SDK, there is no way for any entity to specify the activator in the target field. However in SoHL and clones (e.g. Sven Coop and Featureful) the special name
can be used for this.

You must log in to post a comment. You can login or register a new account.