logic_timer
- Counter-Strike 2
- Half-Life: Alyx
- Dota 2
- Steam VR
Point Entity
An entity that fires a timer event at regular, or random, intervals. It can also be set to oscillate betweena high and low end, in which case it will fire alternating high/low outputs each time it fires.
Keyvalues
-
Start Disabled (
StartDisabled
) <Boolean
> -
Entity Scripts (
vscripts
) <ScriptList
>
Name(s) of script files that are executed after all entities have spawned. -
Name (
targetname
) <TargetSource
>
The name that other entities refer to this entity by. -
Spawnflags (
spawnflags
) <Flags
>- Oscillator (alternates between OnTimerHigh and OnTimerLow outputs)
-
Use Random Time (
UseRandomTime
) <Boolean
> -
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. -
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.
Inputs
-
Enable <
Void
>
Enable this entity. -
Disable <
Void
>
Disable this entity. -
RunScriptFile <
String
>
Load and execute a script file -
RunScriptCode <
String
>
Execute a fragment of script code -
CallScriptFunction <
String
>
Call a script function -
CallPrivateScriptFunction <
String
>
Calls a script function from this entity's private script scope. -
CallGlobalScriptFunction <
String
>
Calls a script function in the global script scope. -
Kill <
Void
>
Removes this entity from the world. -
KillHierarchy <
Void
>
Removes this entity and all its children from the world. -
KillConstrained <
Void
>
Removes this entity, all its children, and anything constrained to it, from the world. -
AddOutput <
String
>
Adds an entity I/O connection to this entity. Parameter format: outputname>targetname>inputname>parameter>delay>max times to fire (-1 == infinite). Very dangerous, use with care. -
FireUser1 <
Void
>
Causes this entity's OnUser1 output to be fired. -
FireUser2 <
Void
>
Causes this entity's OnUser2 output to be fired. -
FireUser3 <
Void
>
Causes this entity's OnUser3 output to be fired. -
FireUser4 <
Void
>
Causes this entity's OnUser4 output to be fired. -
RefireTime <
Float
>
Set a new Refire Interval. -
ResetTimer <
Void
>
Reset the timer. It will fire after the Refire Interval expires. -
FireTimer <
Void
>
Force the timer to fire immediately. -
Toggle <
Void
>
Toggle the timer on/off. -
LowerRandomBound <
Float
>
Set a new Minimum Random Interval. -
UpperRandomBound <
Float
>
Set a new Maximum Random Interval. -
AddToTimer <
Float
>
Add time to the timer if it is currently enabled. Does not change the Refire Interval. -
SubtractFromTimer <
Float
>
Subtract time from the timer if it is currently enabled. Does not change the Refire Interval. -
PauseTimer <
Void
>
Pauses the timer, maintaining its current remaining time. -
UnpauseTimer <
Void
>
Unpauses the timer, continuing from where it left off when frozen.
Outputs
-
OnUser1 <
Void
>
Fired in response to FireUser1 input. -
OnUser2 <
Void
>
Fired in response to FireUser2 input. -
OnUser3 <
Void
>
Fired in response to FireUser3 input. -
OnUser4 <
Void
>
Fired in response to FireUser4 input. -
OnKilled <
Void
>
Fired when the entity is killed and removed from the game. Parameter is the inflictor. -
OnTimer <
Void
>
Fired when the timer expires. -
OnTimerHigh <
Void
>
Fired every other time for an oscillating timer. -
OnTimerLow <
Void
>
Fired every other time for an oscillating timer.
Point Entity
An entity that fires a timer event at regular, or random, intervals. It can also be set to oscillate betweena high and low end, in which case it will fire alternating high/low outputs each time it fires.
Keyvalues
-
Start Disabled (
StartDisabled
) <Boolean
> -
Entity Scripts (
vscripts
) <ScriptList
>
Name(s) of script files that are executed after all entities have spawned. -
Name (
targetname
) <TargetSource
>
The name that other entities refer to this entity by. -
Spawnflags (
spawnflags
) <Flags
>- Oscillator (alternates between OnTimerHigh and OnTimerLow outputs)
-
Use Random Time (
UseRandomTime
) <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. -
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.
Inputs
-
Enable <
Void
>
Enable this entity. -
Disable <
Void
>
Disable this entity. -
RunScriptFile <
String
>
Load and execute a script file -
RunScriptCode <
String
>
Execute a fragment of script code -
CallScriptFunction <
String
>
Call a script function -
CallPrivateScriptFunction <
String
>
Calls a script function from this entity's private script scope. -
CallGlobalScriptFunction <
String
>
Calls a script function in the global script scope. -
Kill <
Void
>
Removes this entity from the world. -
KillHierarchy <
Void
>
Removes this entity and all its children from the world. -
AddOutput <
String
>
Adds an entity I/O connection to this entity. Parameter format: outputname>targetname>inputname>parameter>delay>max times to fire (-1 == infinite). Very dangerous, use with care. -
FireUser1 <
Void
>
Causes this entity's OnUser1 output to be fired. -
FireUser2 <
Void
>
Causes this entity's OnUser2 output to be fired. -
FireUser3 <
Void
>
Causes this entity's OnUser3 output to be fired. -
FireUser4 <
Void
>
Causes this entity's OnUser4 output to be fired. -
RefireTime <
Float
>
Set a new Refire Interval. -
ResetTimer <
Void
>
Reset the timer. It will fire after the Refire Interval expires. -
FireTimer <
Void
>
Force the timer to fire immediately. -
Enable <
Void
>
Enable the timer. -
Disable <
Void
>
Disable the timer. -
Toggle <
Void
>
Toggle the timer on/off. -
LowerRandomBound <
Float
>
Set a new Minimum Random Interval. -
UpperRandomBound <
Float
>
Set a new Maximum Random Interval. -
AddToTimer <
Float
>
Add time to the timer if it is currently enabled. Does not change the Refire Interval. -
SubtractFromTimer <
Float
>
Subtract time from the timer if it is currently enabled. Does not change the Refire Interval.
Outputs
-
OnUser1 <
Void
>
Fired in response to FireUser1 input. -
OnUser2 <
Void
>
Fired in response to FireUser2 input. -
OnUser3 <
Void
>
Fired in response to FireUser3 input. -
OnUser4 <
Void
>
Fired in response to FireUser4 input. -
OnKilled <
Void
>
Fired when the entity is killed and removed from the game. -
OnTimer <
Void
>
Fired when the timer expires. -
OnTimerHigh <
Void
>
Fired every other time for an oscillating timer. -
OnTimerLow <
Void
>
Fired every other time for an oscillating timer.
Point Entity
An entity that fires a timer event at regular, or random, intervals. It can also be set to oscillate betweena high and low end, in which case it will fire alternating high/low outputs each time it fires.
Keyvalues
-
Start Disabled (
StartDisabled
) <Boolean
> -
Entity Scripts (
vscripts
) <ScriptList
>
Name(s) of script files that are executed after all entities have spawned. -
Name (
targetname
) <TargetSource
>
The name that other entities refer to this entity by. -
Spawnflags (
spawnflags
) <Flags
>- Oscillator (alternates between OnTimerHigh and OnTimerLow outputs)
-
Use Random Time (
UseRandomTime
) <Boolean
> -
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. -
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.
Inputs
-
Enable <
Void
>
Enable this entity. -
Disable <
Void
>
Disable this entity. -
RunScriptFile <
String
>
Load and execute a script file -
RunScriptCode <
String
>
Execute a fragment of script code -
CallScriptFunction <
String
>
Call a script function -
CallPrivateScriptFunction <
String
>
Calls a script function from this entity's private script scope. -
CallGlobalScriptFunction <
String
>
Calls a script function in the global script scope. -
Kill <
Void
>
Removes this entity from the world. -
KillHierarchy <
Void
>
Removes this entity and all its children from the world. -
KillConstrained <
Void
>
Removes this entity, all its children, and anything constrained to it, from the world. -
AddOutput <
String
>
Adds an entity I/O connection to this entity. Parameter format: outputname>targetname>inputname>parameter>delay>max times to fire (-1 == infinite). Very dangerous, use with care. -
FireUser1 <
Void
>
Causes this entity's OnUser1 output to be fired. -
FireUser2 <
Void
>
Causes this entity's OnUser2 output to be fired. -
FireUser3 <
Void
>
Causes this entity's OnUser3 output to be fired. -
FireUser4 <
Void
>
Causes this entity's OnUser4 output to be fired. -
RefireTime <
Float
>
Set a new Refire Interval. -
ResetTimer <
Void
>
Reset the timer. It will fire after the Refire Interval expires. -
FireTimer <
Void
>
Force the timer to fire immediately. -
Toggle <
Void
>
Toggle the timer on/off. -
LowerRandomBound <
Float
>
Set a new Minimum Random Interval. -
UpperRandomBound <
Float
>
Set a new Maximum Random Interval. -
AddToTimer <
Float
>
Add time to the timer if it is currently enabled. Does not change the Refire Interval. -
SubtractFromTimer <
Float
>
Subtract time from the timer if it is currently enabled. Does not change the Refire Interval. -
PauseTimer <
Void
>
Pauses the timer, maintaining its current remaining time. -
UnpauseTimer <
Void
>
Unpauses the timer, continuing from where it left off when frozen.
Outputs
-
OnUser1 <
Void
>
Fired in response to FireUser1 input. -
OnUser2 <
Void
>
Fired in response to FireUser2 input. -
OnUser3 <
Void
>
Fired in response to FireUser3 input. -
OnUser4 <
Void
>
Fired in response to FireUser4 input. -
OnKilled <
Void
>
Fired when the entity is killed and removed from the game. Parameter is the inflictor. -
OnTimer <
Void
>
Fired when the timer expires. -
OnTimerHigh <
Void
>
Fired every other time for an oscillating timer. -
OnTimerLow <
Void
>
Fired every other time for an oscillating timer.
Point Entity
An entity that fires a timer event at regular, or random, intervals. It can also be set to oscillate betweena high and low end, in which case it will fire alternating high/low outputs each time it fires.
Keyvalues
-
Start Disabled (
StartDisabled
) <Boolean
> -
Entity Scripts (
vscripts
) <ScriptList
>
Name(s) of script files that are executed after all entities have spawned. -
Name (
targetname
) <TargetSource
>
The name that other entities refer to this entity by. -
Spawnflags (
spawnflags
) <Flags
>- Oscillator (alternates between OnTimerHigh and OnTimerLow outputs)
-
Use Random Time (
UseRandomTime
) <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. -
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.
Inputs
-
Enable <
Void
>
Enable this entity. -
Disable <
Void
>
Disable this entity. -
RunScriptFile <
String
>
Load and execute a script file -
RunScriptCode <
String
>
Execute a fragment of script code -
CallScriptFunction <
String
>
Call a script function -
CallPrivateScriptFunction <
String
>
Calls a script function from this entity's private script scope. -
CallGlobalScriptFunction <
String
>
Calls a script function in the global script scope. -
Kill <
Void
>
Removes this entity from the world. -
KillHierarchy <
Void
>
Removes this entity and all its children from the world. -
AddOutput <
String
>
Adds an entity I/O connection to this entity. Parameter format: outputname>targetname>inputname>parameter>delay>max times to fire (-1 == infinite). Very dangerous, use with care. -
FireUser1 <
Void
>
Causes this entity's OnUser1 output to be fired. -
FireUser2 <
Void
>
Causes this entity's OnUser2 output to be fired. -
FireUser3 <
Void
>
Causes this entity's OnUser3 output to be fired. -
FireUser4 <
Void
>
Causes this entity's OnUser4 output to be fired. -
RefireTime <
Float
>
Set a new Refire Interval. -
ResetTimer <
Void
>
Reset the timer. It will fire after the Refire Interval expires. -
FireTimer <
Void
>
Force the timer to fire immediately. -
Enable <
Void
>
Enable the timer. -
Disable <
Void
>
Disable the timer. -
Toggle <
Void
>
Toggle the timer on/off. -
LowerRandomBound <
Float
>
Set a new Minimum Random Interval. -
UpperRandomBound <
Float
>
Set a new Maximum Random Interval. -
AddToTimer <
Float
>
Add time to the timer if it is currently enabled. Does not change the Refire Interval. -
SubtractFromTimer <
Float
>
Subtract time from the timer if it is currently enabled. Does not change the Refire Interval.
Outputs
-
OnUser1 <
Void
>
Fired in response to FireUser1 input. -
OnUser2 <
Void
>
Fired in response to FireUser2 input. -
OnUser3 <
Void
>
Fired in response to FireUser3 input. -
OnUser4 <
Void
>
Fired in response to FireUser4 input. -
OnKilled <
Void
>
Fired when the entity is killed and removed from the game. -
OnTimer <
Void
>
Fired when the timer expires. -
OnTimerHigh <
Void
>
Fired every other time for an oscillating timer. -
OnTimerLow <
Void
>
Fired every other time for an oscillating timer.