Team round timer: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
m (Substituted IO templates)
 
(11 intermediate revisions by 9 users not shown)
Line 1: Line 1:
{{wrongtitle|title=team_round_timer}}
{{this is a|point entity|game=Team Fortress 2|name=team_round_timer}}
{{Tf2 point}}
{{lang|Team round timer}}
 
==Entity description==
== Entity description ==
Round Timer. Timer starts paused by default.
Round Timer. Timer starts paused by default.


== Keyvalues ==
{{note|The timer does '''not''' end the round on its own. You need a separate win condition such as the [[game_round_win]] entity.}}
* {{KV Targetname}}
{{note|The setup timer does not act as a capture point capture inhibitor. Don't let players out of the spawn area before the setup time is over!}}
* {{KV EnableDisable}}
{{note|The game instantiates this entity class automatically in some situations such as [[tf_logic_koth|KOTH]] maps and during the waiting for player state.}}
* '''timer_length'''
{{note|The [[tf_logic_koth]] entity creates two of these timers on map load named [[Tf_logic_koth#zz_red/blue_koth_timer_Entities|zz_red_koth_timer and zz_blue_koth_timer]] that controls both team timers.}}
: <integer> Initial timer length. (in seconds)
* '''max_length'''
: <integer> 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. (in seconds)
* '''start_paused'''
: {{boolean}} Should the timer start paused? (will need to send a Resume input to start the timer if this is set).
* '''setup_length'''
: <integer> Length of setup time before the round begins and the timer starts to countdown the normal time. (0 = no setup time)  Setup time is run at the beginning of every round before the normal time begins. (in seconds)
* '''reset_time'''
: {{boolean}} Reset the timer time after a round restart.  This is not the setup time, but the normal round time.
* '''auto_countdown'''
: {{boolean}} Let the timer automatically count down the end of a round.
* '''show_in_hud'''
: {{boolean}} Note: You can only show one timer in the HUD at a time.


== Inputs ==
==Keyvalues==
* {{I Targetname}}
{{KV Targetname}}
* {{I EnableDisable}}
{{KV EnableDisable}}
* '''Pause'''
{{KV|Timer length (in seconds)|integer|Initial timer length.}}
: Pause the timer.
{{KV|Max timer length (in seconds)|integer|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.}}
* '''Resume'''
{{KV|Start paused|boolean|Should the timer start paused? (will need to send a Resume input to start the timer if this is set).}}
: Resume the timer.
{{KV|Setup timer length (in seconds)|integer|Length of setup time before the round begins and the timer starts to countdown the normal time. (0 {{=}} no setup time) Setup time is run at the beginning of every round before the normal time begins.}}
* '''SetTime'''
{{KV|Reset time on round restart|boolean|Reset the timer time after a round restart.  This is not the setup time, but the normal round time.}}
: <integer> Set the timer to this value (in seconds).
{{KV|Use countdown sounds|boolean|Let the timer automatically count down the end of a round.}}
* '''AddTime'''
{{KV|Show timer in the HUD|boolean|Note: You can only show one timer in the HUD at a time.}}
: <integer> Add time to the timer (in seconds). Added time cannot excede the max timer length.
{{Note|If you are trying to set up two timers for a King of the Hill map, see [[tf_logic_koth]] instead.}}
* '''AddTeamTime'''
{{KV|Count Direction|choices|Use this to reverse the timer and have it count from 0 up to the timer length. Sounds and outputs still fire like normal. For example, on a count-up timer with a length of 90 seconds, when it reaches 60 the announcer will say '30 seconds remaining', however, the On30SecRemaining output will fire when the visual timer reaches 61.}}
: <string> Input takes a string (space delimited) with the team number and the time to be added (in seconds) because of the team (2 for red, 3 for blue, and 0 for no team...but you could just use AddTime for that). Added time cannot excede the max timer length. Example: 2 600 (adds 10 minutes because of team red)
:* 0 : Up
* '''Restart'''
:* 1 : Down
: Restart the timer.
* '''ShowInHUD'''
: <integer> Show this timer in the HUD (0 no, 1 yes).
* '''SetMaxTime'''
: <integer> Set the max timer length to this value (in seconds). The timer's time will never excede this value.
* '''AutoCountdown'''
: <integer> Turn off/on the auto countdown feature (0 no, 1 yes).
* '''SetSetupTime'''
: <integer> Set the setup time length to this value (in seconds).


== Outputs ==
==Inputs==
* {{O Targetname}}
{{I Targetname}}
* '''On5MinRemain'''
{{I EnableDisable}}
: Sent when 5 minutes remain.
{{I|Pause|Pause the timer.}}
* '''On4MinRemain'''
{{I|Resume|Resume the timer.}}
: Sent when 4 minutes remain.
{{I|SetTime|Set the timer to this value (in seconds).|param=integer}}
* '''On3MinRemain'''
{{I|AddTime|Add time to the timer (in seconds). Added time cannot exceed the max timer length.|param=integer}}
: Sent when 3 minutes remain.
{{I|AddTeamTime|Input takes a string (space delimited) with the team number and the time to be added (in seconds) because of the team (2 for red, 3 for blue, and 0 for no team...but you could just use AddTime for that). Added time cannot exceed the max timer length. Example: 2 600 (adds 10 minutes because of team red)|param=string}}
* '''On2MinRemain'''
{{I|Restart|Restart the timer.}}
: Sent when 2 minutes remain.
{{I|ShowInHUD|Show this timer in the HUD (0 no, 1 yes).|param=bool}}
* '''On1MinRemain'''
{{I|SetMaxTime|Set the max timer length to this value (in seconds). The timer's time will never exceed this value.|param=integer}}
: Sent when 1 minute remains.
{{I|AutoCountdown|Turn off/on the auto countdown feature (0 no, 1 yes).|param=bool}}
* '''On30SecRemain'''
{{I|SetSetupTime|Set the setup time length to this value (in seconds).|param=integer}}
: Sent when 30 seconds remain.
* '''On10SecRemain'''
: Sent when 10 seconds remain.
* '''On5SecRemain'''
: Sent when 5 seconds remain.
* '''On4SecRemain'''
: Sent when 4 seconds remain.
* '''On3SecRemain'''
: Sent when 3 seconds remain.
* '''On2SecRemain'''
: Sent when 2 seconds remain.
* '''On1SecRemain'''
: Sent when 1 second remains.
* '''OnRoundStart'''
: Sent when the round starts.
* '''OnFinished'''
: Sent when the timer is finished.
* '''OnSetupStart'''
: Sent when the setup time begins.
* '''OnSetupFinished'''
: Sent when the setup time is finished.


[[Category:Team Fortress 2 Entities]]
==Outputs==
{{O Targetname}}
{{O|On5MinRemain|Sent when 5 minutes remain.}}
{{O|On4MinRemain|Sent when 4 minutes remain.}}
{{O|On3MinRemain|Sent when 3 minutes remain.}}
{{O|On2MinRemain|Sent when 2 minutes remain.}}
{{O|On1MinRemain|Sent when 1 minutes remain.}}
{{O|On30SecRemain|Sent when 30 seconds remain.}}
{{O|On10SecRemain|Sent when 10 seconds remain.}}
{{O|On5SecRemain|Sent when 5 seconds remain.}}
{{O|On4SecRemain|Sent when 4 seconds remain.}}
{{O|On3SecRemain|Sent when 3 seconds remain.}}
{{O|On2SecRemain|Sent when 2 seconds remain.}}
{{O|On1SecRemain|Sent when 1 second remains.}}
{{O|OnRoundStart|Sent when the round starts.}}
{{O|OnFinished|Sent when the timer is finished.}}
{{O|OnSetupStart|Sent when the setup time begins.}}
{{O|OnSetupFinished|Sent when the setup time is finished.}}

Latest revision as of 19:34, 20 April 2025

team_round_timer is a point entity available in Team Fortress 2 Team Fortress 2.

English (en)한국어 (ko)Translate (Translate)

Entity description

Round Timer. Timer starts paused by default.

Note.pngNote:The timer does not end the round on its own. You need a separate win condition such as the game_round_win entity.
Note.pngNote:The setup timer does not act as a capture point capture inhibitor. Don't let players out of the spawn area before the setup time is over!
Note.pngNote:The game instantiates this entity class automatically in some situations such as KOTH maps and during the waiting for player state.
Note.pngNote:The tf_logic_koth entity creates two of these timers on map load named zz_red_koth_timer and zz_blue_koth_timer that controls both team timers.

Keyvalues

Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

Start Disabled (StartDisabled) <boolean>
Stay dormant until activated (with theEnableinput).
Timer length (in seconds) ([todo internal name (i)]) <integer>
Initial timer length.
Max timer length (in seconds) ([todo internal name (i)]) <integer>
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.
Start paused ([todo internal name (i)]) <boolean>
Should the timer start paused? (will need to send a Resume input to start the timer if this is set).
Setup timer length (in seconds) ([todo internal name (i)]) <integer>
Length of setup time before the round begins and the timer starts to countdown the normal time. (0 = no setup time) Setup time is run at the beginning of every round before the normal time begins.
Reset time on round restart ([todo internal name (i)]) <boolean>
Reset the timer time after a round restart. This is not the setup time, but the normal round time.
Use countdown sounds ([todo internal name (i)]) <boolean>
Let the timer automatically count down the end of a round.
Show timer in the HUD ([todo internal name (i)]) <boolean>
Note: You can only show one timer in the HUD at a time.
Note.pngNote:If you are trying to set up two timers for a King of the Hill map, see tf_logic_koth instead.
Count Direction ([todo internal name (i)]) <choices>
Use this to reverse the timer and have it count from 0 up to the timer length. Sounds and outputs still fire like normal. For example, on a count-up timer with a length of 90 seconds, when it reaches 60 the announcer will say '30 seconds remaining', however, the On30SecRemaining output will fire when the visual timer reaches 61.
  • 0 : Up
  • 1 : Down

Inputs

EnableDisable:

Enable / Disable
Enable/disable this entity from performing its task. It might also disappear from view.
Pause
Pause the timer.
Resume
Resume the timer.
SetTime <integerRedirectInput/integer>
Set the timer to this value (in seconds).
AddTime <integerRedirectInput/integer>
Add time to the timer (in seconds). Added time cannot exceed the max timer length.
AddTeamTime <stringRedirectInput/string>
Input takes a string (space delimited) with the team number and the time to be added (in seconds) because of the team (2 for red, 3 for blue, and 0 for no team...but you could just use AddTime for that). Added time cannot exceed the max timer length. Example: 2 600 (adds 10 minutes because of team red)
Restart
Restart the timer.
ShowInHUD <booleanRedirectInput/boolean>
Show this timer in the HUD (0 no, 1 yes).
SetMaxTime <integerRedirectInput/integer>
Set the max timer length to this value (in seconds). The timer's time will never exceed this value.
AutoCountdown <booleanRedirectInput/boolean>
Turn off/on the auto countdown feature (0 no, 1 yes).
SetSetupTime <integerRedirectInput/integer>
Set the setup time length to this value (in seconds).

Outputs

On5MinRemain
Sent when 5 minutes remain.
On4MinRemain
Sent when 4 minutes remain.
On3MinRemain
Sent when 3 minutes remain.
On2MinRemain
Sent when 2 minutes remain.
On1MinRemain
Sent when 1 minutes remain.
On30SecRemain
Sent when 30 seconds remain.
On10SecRemain
Sent when 10 seconds remain.
On5SecRemain
Sent when 5 seconds remain.
On4SecRemain
Sent when 4 seconds remain.
On3SecRemain
Sent when 3 seconds remain.
On2SecRemain
Sent when 2 seconds remain.
On1SecRemain
Sent when 1 second remains.
OnRoundStart
Sent when the round starts.
OnFinished
Sent when the timer is finished.
OnSetupStart
Sent when the setup time begins.
OnSetupFinished
Sent when the setup time is finished.