trigger_entity_iterator

Modified

12-Jul-2023

This entity allows you to simulate one or multiple entities triggering a specific other entity. For example, you can have all entities of classname "player" trigger a trigger_condition, or all entities with targetname "zombie" trigger a trigger_copyvalue. The triggered entity will receive every iterated entity as activator.

Keyvalues


OnDestroy Function ondestroyfn : Name of the function to use from already parsed .as script files when entity is destroyed (killed) in any way. If the function belongs to namespace, you must use prefix with the namespace name (e.g. mynamespace::MyFunction) for the keyvalue.

Name targetname : Set name of trigger_entity_iterator so other entities can trigger it to start iterating. Depending on trigger use-type: 'On'- start iterating or reset it if already running, 'Toggle'- start iterating or stop it if already running, 'Off'- stop iterating. Can be kill-targeted.

Filter Entities by Name name_filter : Any entity/entities by the given name will be iterated, given they also are of the specific class set in "Filter Entities by Classname" (if set).

Filter Entities by Classname classname_filter : Any entity/entities by the given classname will be iterated, given they also match the name set in "Filter Entities by Name" (if set).

Filter Entities by Status status_filter : Depending on what other option than "No Filter (default)" you set, additionally to the filtering by name and classname through the two above keyvalues, either only dead or only alive entities will be iterated over. (An entity is considered alive while the PEV "deadflag" is 0)

  • 0 : No Filter (default)
  • 1 : Only Living Entities
  • 2 : Only Dead Entities

Delay between Entities (secs) delay_between_triggers : Specify a delay, in seconds, between the individual iterations. E.g. when iterating over several zombies, this would be the delay between iterating every single zombie. A value of 0 disables this (default), causing all iteration-entities to be iterated in one go. A very low value like 0.00001 would mean to iterate over one entity every server frame.

Entity's Trigger Target target : Name of the entity to be triggered by the individual iteration/activator-entities. It "carries" the iteration.

Entity's Trigger State triggerstate : Set the use-type with which the iterated/activating entities will fire the iteration carrier-entity set by "Trigger Target".

  • 0 : Off
  • 1 : On
  • 2 : Toggle

Run Mode run_mode : Set the mode of which targets are triggered.

  • 0 : Run Once : Default, single-fire behaviour.
  • 1 : Run Once; Multi-threaded : Every time you trigger this, a temporary copy will be created and perform one full run, then remove itself from the game. You can have multiple copies run simultaneously. This only makes sense with a non-zero "Delay between Entities (secs)".
  • 2 : Toggle On/Off : This entity becomes toggleable and will have a delay between complete iteration-passes of all iteration-entities, set by "Delay before Restarting (secs)".

Trigger at end of each Run trigger_after_run : Entity to trigger after a full run has been completed/performed. Trigger use-type is 'Toggle'.

Maximum Runs (0 for unlimited) maximum_runs : Specify how many complete iteration-passes may be performed before this entity is removed from the game. Set this to 0 to disable this feature.

Delay before Restarting (secs) delay_between_runs : Specify a delay, in seconds, between complete iteration-passes. E.g. when iterating several zombies, this would be the delay between iterating all of those zombies and then iterating all of those zombies again. This is only relevant in constant mode and the individual interval will still be considered when this is used. A value of 0 will always cause a delay of a single server frame. The individual interval will not add onto this.

If "Run Mode" is set to 'Run Once' and if trigger_entity_iterator is triggered while currently running (delay between triggers greater than zero), it will stop and restart the iteration process immediately when triggered with use-type "On", but simply stop when triggered with any other use-type.