Hosting and domain costs until October 2024 have been generously sponsored by dumptruck_ds. Thank you!
find
From Quake Wiki
entity find(entity start, .string fieldName, string fieldValue)
Contents
Usage
Searches through the entity list, finding the first entity whose field name has the passed field value. Can be used to iterate through every entity in the map to find specific ones e.g. an entity's targets when it activates.
Parameters
- start
- The entity to start from in the list, exclusive. Passing world will start from the very first entity.
- fieldName
- The name of the string field on the entity to check. This is a symbol e.g. if you wanted to check an entity's targetname field, you would pass
targetname
.
- fieldValue
- The value that the entity's field must be set to in order to be considered a match.
Return
The first entity found starting after start whose field has the passed value.
Example
// This finds every target the entity has and sets their health to 200 entity it = find(world, targetname, self.target); while (it) { it.health = 200; it = find(it, targetname, self.target); }