From Valve Developer Community
Revision as of 17:12, 21 May 2013 by Tonton (talk | contribs) (typos)
Jump to: navigation, search

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


Entity description

Round Timer. Timer starts paused by default.



Name (targetname) <string>
The targetname that other entities refer to this entity by.
Entity Scripts (vscripts) <scriptlist> (in all games since <Left 4 Dead 2>)
Space delimited list of VScript files (without file extension) that are executed after all entities have spawned. The scripts are all executed in the same script scope, later ones overwriting any identical variables and functions.
Script think function (thinkfunction) <string> (in all games since <Left 4 Dead 2>)
Name of a function in this entity's script which will be called automatically every 100 milliseconds (ten times a second) for the duration of the script. It can be used to create timers or to simulate autonomous behavior. The return value (if present) will set the time until the next call.
Note.png Note: Try to avoid expensive operations in this function, as it may cause performance problems.


Start Disabled (StartDisabled) <boolean>
Stay dormant until activated (with theEnableinput).
Timer length (in seconds) <integer>
Initial timer length.
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.
Start paused <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) <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 <boolean>
Reset the timer time after a round restart. This is not the setup time, but the normal round time.
Use countdown sounds <boolean>
Let the timer automatically count down the end of a round.
Show timer in the HUD <boolean>
Note: You can only show one timer in the HUD at a time.
Note.png Note: If you are trying to set up two timers for a King of the Hill map, see tf_logic_koth instead.
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.
  • 0 : Up
  • 1 : Down



Removes this entity from the world.
Removes this entity and its children from the world.
Note.png Note: Entities already remove orphaned children upon being removed, but this input removes all children on the same frame, being marginally faster than Kill.
AddOutput <string>
Adds a keyvalue/output to this entity. It can be potentially very dangerous, use with care.
KV Format: <key> <value>
I/O Format: <output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire, -1 means infinite>
FireUser1 to FireUser4
Fire the OnUser outputs; see User Inputs and Outputs.
Use  !FGD
Same as a player invoking +use; may not do anything depending on the entity. Can also be invoked by firing an output that does not specify an input.
RunScriptFile <script> (in all games since <Left 4 Dead 2>)
Execute a VScript file from disk, without file extension. The script contents are merged with the script scope of the receiving entity.
RunScriptCode <string> (in all games since <Left 4 Dead 2>)
Execute a string of VScript source code in the scope of the entity receiving the input. String quotation may be needed when fired via console.
Bug.png Bug: In <Left 4 Dead 2>, the code is executed in the script scope of the entity that fires the output, not the one receiving the input.
Warning.png Warning: Never try to pass string parameters to a script function with this input. It will corrupt the VMF structure because of the nested quotation marks, which then must be removed manually with a text editor.
CallScriptFunction <string> (in all games since <Left 4 Dead 2>) !FGD
Execute a VScript function in the scope of the receiving entity.
SetLocalOrigin <coordinates> (in all games since <Alien Swarm>) !FGD
Send this entity to a spot in the map. If the entity is parented to something, it will be offset from the parent by this amount.
SetLocalAngles <angles> (in all games since <Alien Swarm>) !FGD
Set this entity's angles.


Enable/disable this entity from performing its task. It might also disappear from view.
Pause the timer.
Resume the timer.
SetTime <integer>
Set the timer to this value (in seconds).
AddTime <integer>
Add time to the timer (in seconds). Added time cannot exceed the max timer length.
AddTeamTime <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 the timer.
ShowInHUD <boolean>
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 exceed this value.
AutoCountdown <boolean>
Turn off/on the auto countdown feature (0 no, 1 yes).
SetSetupTime <integer>
Set the setup time length to this value (in seconds).



OnUser1 to OnUser4
These outputs each fire in response to the firing of the like-numbered FireUser1 to FireUser4 Input; see User Inputs and Outputs.
OnKilled  (only in <Left 4 Dead> <Left 4 Dead 2>)
This output fires when the entity is killed and removed from the game.
Sent when 5 minutes remain.
Sent when 4 minutes remain.
Sent when 3 minutes remain.
Sent when 2 minutes remain.
Sent when 1 minutes remain.
Sent when 30 seconds remain.
Sent when 10 seconds remain.
Sent when 5 seconds remain.
Sent when 4 seconds remain.
Sent when 3 seconds remain.
Sent when 2 seconds remain.
Sent when 1 second remains.
Sent when the round starts.
Sent when the timer is finished.
Sent when the setup time begins.
Sent when the setup time is finished.