Skip to content

ForEachEntityWithScriptBlock

15.7

Class Documentation

Edit documentation

An entity loop over the entities that run a script. The loop finds the running instances of the script that Script names and visits the entity that owns each instance. It skips an entity that fails the map filter, and for every other entity it writes the entity to OutEntity and runs the body.

The loop copies the list of entities before the first iteration, so changes that the body makes to the script instances do not change which entities the loop visits.

FilterByMapIndex and MapIndexOverride work as on ForEachEntityWithTagBlock.

Properties

FilterByMapIndex

Pointer<IBoolGet> = null
16.5
Edit documentation

If true, the loop visits only the entities whose map index is the map index of the running script.

MapIndexOverride

Pointer<IIntGet> = null
16.5
Edit documentation

A map index to filter by instead of the map index of the running script. If it evaluates to a value other than 0, the loop filters by that index, also when FilterByMapIndex is false or not set.

Script

Hash = "0x0"
Edit documentation

The hash of the script whose instances the loop looks for.