game_counter

From Valve Developer Community
Jump to navigation Jump to search
Edit Tabs

game_counter is a point entity available in all GoldSrc GoldSrc games except Team Fortress Classic Team Fortress Classic. This entity keeps an internal value of how many times it has been triggered, and when it reaches a specified value, it will trigger another entity.

Note.pngNote: For mods released prior to Half-Life 1.0.0.9 (such as Team Fortress Classic), the older trigger_counter must be used instead.

Key Values

Name (targetname) <string>
The targetname that other entities refer to this entity by, usually via the target, killtarget, and TriggerTarget KVs.
Target (target) <targetname>
The targetname of an entity this entity will trigger when activated.
Delay before trigger (delay) <integer>
Delay in seconds before firing the targeted entity.
Killtarget (killtarget) <targetname>
Entity to remove when activated.
Master (master) <targetname>
Name of a master entity. If the master hasn't been activated, this entity will not activate.
Initial Value (frags) <integer>
Sets the value that the game_counter should start at.
Limit Value (health) <integer>
Sets the value that the game_counter must reach before triggering its Target.

Flags

Remove On fire : [1]
If enabled, the game_counter will be removed once it has triggered its Target.
Reset On fire : [2]
If enabled, once the game_counter has triggered its Target, it will reset its value back to the Initial Value. This will allow it to be used repeatedly, and will trigger its Target each time it reaches the Limit Value. If not enabled, a game_counter_set will be necessary to return the game_counter to below the trigger value.

See also