Skip to main content

watcher_count

watcher_count icon
Point entityPorted from Spirit of Half-Life

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​

KeyDescriptionDefault
Nametargetname

The name you put in another entity's Master key. See Common keys.

Count entities named...noise

Sets the name of the entities to count.

Comparison numberimpulse

Sets the number the count is compared with.

Default 0
Type of comparisonm_iMode

Sets 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
Default 'On' when count = number (0)
Fire on changing statetarget

The entity fires this with the use type On when the comparison turns true, and with Off when it turns false.

Fire on turning onnetname

The entity fires this with Toggle when the comparison turns true.

Fire on turning offmessage

The entity fires this with Toggle when the comparison turns false.

Fire when count increasesnoise1

The entity fires this with Toggle each time the count goes up.

Fire when count decreasesnoise2

The entity fires this with Toggle each time the count goes down.

Flags​

1Fire at startup

At 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_count as their activator
  • A broken func_breakable loses 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​

Changes since 1.38​

  • watcher_count is new in SBO 2.1.0