This article's documentation is for Source 2. Click here for more information.

Logic timer (Source 2): Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 18: Line 18:


== Inputs ==
== Inputs ==
{{IO|RefireTime|Set a new Refire Interval.|param=float}}
{{I|RefireTime|Set a new Refire Interval.|param=float}}
{{IO|ResetTimer|Reset the timer. It will fire after the Refire Interval expires.}}
{{I|ResetTimer|Reset the timer. It will fire after the Refire Interval expires.}}
{{IO|FireTimer|Force the timer to fire immediately.}}
{{I|FireTimer|Force the timer to fire immediately.}}
{{IO|Enable|Enable the timer.}}
{{I|Enable|Enable the timer.}}
{{IO|Disable|Disable the timer.}}
{{I|Disable|Disable the timer.}}
{{IO|Toggle|Toggle the timer on/off.}}
{{I|Toggle|Toggle the timer on/off.}}
{{IO|LowerRandomBound|Set a new Minimum Random Interval.|param=float}}
{{I|LowerRandomBound|Set a new Minimum Random Interval.|param=float}}
{{IO|UpperRandomBound|Set a new Maximum Random Interval.|param=float}}
{{I|UpperRandomBound|Set a new Maximum Random Interval.|param=float}}
{{IO|AddToTimer|Add time to the timer if it is currently enabled.  Does not change the Refire Interval.|param=float}}
{{I|AddToTimer|Add time to the timer if it is currently enabled.  Does not change the Refire Interval.|param=float}}
{{IO|SubtractFromTimer|Subtract time from the timer if it is currently enabled.  Does not change the Refire Interval.|param=float}}
{{I|SubtractFromTimer|Subtract time from the timer if it is currently enabled.  Does not change the Refire Interval.|param=float}}
{{IO|PauseTimer|Pauses the timer, maintaining its current remaining time.}}
{{I|PauseTimer|Pauses the timer, maintaining its current remaining time.}}
{{IO|UnpauseTimer|Unpauses the timer, continuing from where it left off when frozen.}}
{{I|UnpauseTimer|Unpauses the timer, continuing from where it left off when frozen.}}
{{I EnableDisable}}
{{I EnableDisable}}
{{I BaseEntity (Source 2)}}


== Outputs ==
== Outputs ==
{{IO|OnTimer|Fired when the timer expires.}}
{{O|OnTimer|Fired when the timer expires.}}
{{IO|OnTimerHigh|Fired every other time for an oscillating timer.}}
{{O|OnTimerHigh|Fired every other time for an oscillating timer.}}
{{IO|OnTimerLow|Fired every other time for an oscillating timer.}}
{{O|OnTimerLow|Fired every other time for an oscillating timer.}}
{{O BaseEntity|s2=1}}

Latest revision as of 11:10, 26 September 2024

English (en)Translate (Translate)
Logic timer.png

logic_timer is a point entity available in all Source 2 Source 2 games. It fires an output at regular or random intervals. It can optionally alternate between a "high" and a "low" output.

Note.pngNote:Enabling the entity resets its timer.

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

Use Random Time (UseRandomTime) <boolean>
Makes the entity fire at random intervals. Range of values is restricted by the next two KVs.
Pause After Firing (PauseAfterFiring) <boolean>
Minimum Random Interval (LowerRandomBound) <float>
If "Use Random Time" is set, this is the minimum time between timer fires. The time will be a random number between this and the "Maximum Random Interval".
Maximum Random Interval (UpperRandomBound) <float>
If "Use Random Time" is set, this is the maximum time between timer fires. The time will be a random number between the "Minimum Random Interval" and this.
Refire Interval (RefireTime) <float>
If "Use Random Time" isn't set, this is the time between timer fires, in seconds. Make sure output delay times are less than this value.
Initial delay before first fire (InitialDelay) <float>
Time to wait after the timer is enabled before firing the first time. Negative values can be used to avoid waiting the lower random bound on spawn, or positive values to postpone the first event.
Start Disabled (StartDisabled) <boolean>
Stay dormant until activated (with theEnableinput).

Flags

Oscillator : [1]
Alternates between OnTimerHigh and OnTimerLow outputs

Inputs

RefireTime <floatRedirectInput/float>
Set a new Refire Interval.
ResetTimer
Reset the timer. It will fire after the Refire Interval expires.
FireTimer
Force the timer to fire immediately.
Enable
Enable the timer.
Disable
Disable the timer.
Toggle
Toggle the timer on/off.
LowerRandomBound <floatRedirectInput/float>
Set a new Minimum Random Interval.
UpperRandomBound <floatRedirectInput/float>
Set a new Maximum Random Interval.
AddToTimer <floatRedirectInput/float>
Add time to the timer if it is currently enabled. Does not change the Refire Interval.
SubtractFromTimer <floatRedirectInput/float>
Subtract time from the timer if it is currently enabled. Does not change the Refire Interval.
PauseTimer
Pauses the timer, maintaining its current remaining time.
UnpauseTimer
Unpauses the timer, continuing from where it left off when frozen.

EnableDisable:

Enable / Disable
Enable/disable this entity from performing its task. It might also disappear from view.

Outputs

OnTimer
Fired when the timer expires.
OnTimerHigh
Fired every other time for an oscillating timer.
OnTimerLow
Fired every other time for an oscillating timer.