Skip to content

ForEachEntityWithTagBlock

15.17

Class Documentation

Edit documentation

An entity loop over the entities that carry an entity tag. The loop evaluates tag and walks the list of entities that carry that tag. It skips an entity that fails the tag filter or the map filter, and for every other entity it writes the entity to OutEntity and runs the body.

Tag filter. The three unnamed tag lists filter the entities by their other tags:

  • every tag in "0xa1162603" must be on the entity,
  • if "0x9c60d5ba" is not empty, at least one of its tags must be on the entity,
  • no tag in "0xbec77248" may be on the entity.

The loop evaluates every entry of the three lists before the first iteration. If one entry cannot be evaluated, the loop runs no iteration.

Map filter. FilterByMapIndex and MapIndexOverride limit the loop to the entities of one map index. The client finds the map index of an entity by the same rule as GetEntityMapIndexBlock: from its template, or else from the map regions around its position.

Properties

0x9c60d5ba

List2<IEntityTagGet> = []
16.2
Edit documentation

Entity tags of which an entity must carry at least one to be visited. An empty list does not filter.

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.