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:
- Some entities such as
func_healthcharger
and game_text
acts on the activator by principle or by default. Others like env_fade
can be set to affect activators instead of globally.
- NPCs get aggravated by the activator if it's a valid entity.
- In multiplayer, it is used to award points to players who uses environmental traps or something like
func_tank
.
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.
!activator
(SC, Featureful)*locus
(SoHL, Featureful)