activator Last edited 4 months ago2024-06-28 14:34:06 UTC

You are viewing an older revision of this wiki page. The current revision may be more detailed and up-to-date. Click here to see the current revision of this page.
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 will be broken (i.e. the original activator reference lost) in the following entities: Therefore, care should be taken to make sure entities that affect activators aren't targeted in the above ways. For example, a trigger_relay targeting a game_text will crash the game unless "All Players" flag is checked.

1 Comment

Commented 7 months 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 Spirit of Half-Life, Sven Coop, and Featureful, you can use these special names:
  • !activator (SC, Featureful)
  • *locus (SoHL, Featureful)

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