Skip to main content

game_counter

game_counter icon
Point entity

A game_counter counts the triggers it gets, and fires its target when the count reaches its limit.

A trigger with the use type On or Toggle adds 1, Off takes 1 away, and Set puts in the number the trigger brings, such as the one a game_counter_set sends.

Attributes​

KeyDescriptionDefault
Nametargetname

Triggering the entity changes the count. See Common keys.

Targettarget

Names the entities to trigger with the use type Toggle when the count reaches Limit Value, and passes on the activator of the last trigger.

Mastermaster

Names a master, and while the master is off, triggering the counter does nothing.

Initial Valuefrags

Sets the count the counter starts at, and goes back to with Reset On fire.

Default 0
Limit Valuehealth

Sets the count at which the counter fires its target.

If you leave this key empty, it is 0, so counting up never fires it, and with Fire if over limit, every count fires it.

Default 10

Flags​

1Remove On fire

The counter is removed after it fires its target

2Reset On fire

After it fires its target, the count goes back to Initial Value. This flag is set by default

4Fire if over limitFeatureful

The counter fires its target each time the count is at the limit or above it, not only when the count equals the limit

Notes​

  • It fires its target at once, because it has no delay and no KillTarget
  • A key that takes a number, which the editor marks with [LR], can name a game_counter and reads its count, and a calc_eval_number can store its result in one

See also​

Changes since 1.38​

  • You can use the new flag Fire if over limit
  • Keys that take a number can read a game_counter