watcher_count

A watcher_count counts how many entities with one name aren't off, such as how many monsters are still alive or how
many doors are open, and compares the count with a number. It is a master
that is on while the comparison is true, and it fires targets when the count goes up or down and when the comparison
turns true or false.
An entity counts while its state is anything but Off, so a monster
counts while it is alive or dying and a door while it is open, opening or closing. Entities without a state of their
own, such as an info_target, are always off and never count. The entity checks the count every 0.1
seconds, starting half a second after it spawns.
Attributes
targetnameThe name you put in another entity's Master key. See Common keys.
noiseSets the name of the entities to count.
impulseSets the number the count is compared with.
0m_iModeSets when the comparison is true.
- 'On' when count = number (0) - True when the count equals the number
- 'On' when count != number (3) - True when the count is anything but the number
- 'On' when count > number (1) - True when the count is more than the number
- 'On' when count >= number (5) - True when the count is the number or more
- 'On' when count < number (2) - True when the count is less than the number
- 'On' when count <= number (4) - True when the count is the number or less
'On' when count = number (0)targetThe entity fires this with the use type On when the comparison turns true, and with Off when it turns false.
netnameThe entity fires this with Toggle when the comparison turns true.
messageThe entity fires this with Toggle when the comparison turns false.
noise1The entity fires this with Toggle each time the count goes up.
noise2The entity fires this with Toggle each time the count goes down.
Flags
1Fire at startupAt its first check, the entity fires Fire on turning on if the comparison is true, and Fire on turning off if it is false
Notes
- At its first check, the entity only notes the count and fires nothing, unless Fire at startup is set
- The targets get the
watcher_countas their activator - A broken
func_breakableloses its name at once, so it stops counting as soon as it breaks - A dead monster stops counting once its death animation ends, and a player counts only while alive
See also
- Masters and states - every master, and the states of each entity
multi_watcher- combines the states of several entities with AND, OR and other testsgame_counter- counts triggers instead of entities
Changes since 1.38
watcher_countis new in SBO 2.1.0
