game_timer is a point entity available with Mapbase v8.0 or later.

An entity that adds a generic timer to the player’s HUD. Not to be confused with logic_timer.



KeyValues

- Timer length (in seconds) (timer_length) <float>
Initial timer length.
- Max timer length (in seconds) (max_length) <float>
Maximum timer length (0 = no max). This value is used to ensure the timer never goes above this value when SetTime and AddTime are used.
- Warn time (-1 default) (warn_time) <float>
The time in seconds at which the timer will turn red to indicate it is almost finished. -1 uses default behavior, turning red when the timer is 75% complete.
- Timer caption (timer_caption) <string>
An optional line of text which can accompany the timer.
- Start paused (start_paused) <choices>
Should the timer start paused? (will need to send a Resume input to start the timer if this is set).
- Show Time Remaining (show_time_remaining) <choices>
Should we show how much time is remaining. If no, this will display how much time has passed.
- Show timer in the HUD (show_in_hud) <choices>
Whether or not the timer actually appears on the player's HUD when enabled. Note: Outside of TF2, you can only show one timer in the HUD at a time.
- X (0 - 1.0 = left to right) (-1 default) (x) <float>
Horizontal position on the player's screens to draw the timer. The value should be between 0 and 1, where 0 is the far left of the screen and 1 is the far right. -1 puts it in the game's default position. Note that a non-default value will stop the game from automatically moving or hiding the timer when it gets in the way of other HUD elements.
- Y (0 - 1.0 = top to bottom) (-1 default) (y) <float>
Vertical position on the player's screens to draw the timer. The value should be between 0 and 1, where 0 is the top of the screen and 1 is the bottom. -1 puts it in the game's default position. Note that a non-default value will stop the game from automatically moving or hiding the timer when it gets in the way of other HUD elements.
- Progress bar max segments (-1 default) (progress_bar_max) <integer>
Overrides the progress bar's maximum segments. -1 uses the default based on the timer's length.
- Progress bar override (-1 default) (progress_bar_override) <integer>
Overrides the progress bar's progress. -1 uses the default based on remaining time. Use this with the max segments value to make the progress bar represent a controlled variable (e.g. number of players at a checkpoint).
- Player Filter (PlayerFilter) <filterclass>
Filter to use to determine who should see this timer. By default, all players will view the timer unless a team number is specified. See filter_activator_name for more explanation.
- Team (TeamNum) <choices>
The team this timer should apply to unless a filter is specified. In TF2, timers are colored based on this value. Specifying a filter allows a team-colored timer to be shown to players not on that team. The Local Player option will appear to each player as their own team color.

Inputs

- Pause <void>
Pause the timer.
- Resume <void>
Resume the timer.
- SetTime <float>
Set the timer to this value (in seconds).
- AddTime <float>
Add time to the timer (in seconds). Added time cannot excede the max timer length.
- RemoveTime <float>
Remove time from the timer (in seconds).
- Restart <void>
Restart the timer.
- SetMaxTime <integer>
Set the max timer length to this value (in seconds). The timer's time will never excede this value.
- SetTimerCaption <string>
Set the timer caption.
- SetProgressBarMaxSegments <integer>
Set the progress bar's max segments.
- SetProgressBarOverride <integer>
Set the progress bar's progress override.
- SetX <float>
Set the X position override.
- SetY <float>
Set the Y position override.
- GetTimeRemaining <void>
Fire OnGetTimeRemaining with the remaining time.
- SetPlayerFilter <target_destination>
Set the player filter.
- SetTeam <integer>
Changes the entity's team.

Outputs

- OnFinished <void>
Sent when the timer is finished.
- OnPaused <void>
Sent when the timer is paused.
- OnResumed <void>
Sent when the timer is resumed.
- OnWarned <void>
Sent when timer passes its warn time.
- OnTick <integer>
Sent for each second the timer ticks, with the remaining time as the parameter.
- OnGetTimeRemaining <float>
Sent when GetTimeRemaining input is used, with the remaining time as the parameter.