logic_timer
Jump to navigation
Jump to search
Code classes:
CTimerEntity
CLogicalEntity
CServerOnlyEntity
CBaseEntity
(all ents)
logic_timer
is a point entity present in all Source games. It fires an output at regular or random intervals.
Tip: Having a small amount of randomness in the timing of events can help break monotony.
Flags[edit | edit source]
- 1: Oscillator - Instead of firing OnTimer, the entity fires OnTimerHigh or OnTimerLow every interval, alternating between them.
Keyvalues[edit | edit source]
- Refire Interval
(RefireTime)
<float>
- How many seconds there should be between output fires. Minimum is 0.01.
- Use Random Time
(UseRandomTime)
<boolean>
- If set, the interval will be a random amount between the keyvalues below.
- Minimum Random Interval
(LowerRandomBound)
<float>
- If using a random time, the minimum amount of time between timer intervals.
- Maximum Random Interval
(UpperRandomBound)
<float>
- If using a random time, the maximum amount of time between timer intervals.
- Start Disabled
(StartDisabled)
<boolean>
- Stay inactive until Enabled.
Inputs[edit | edit source]
- RefireTime
<float>
- Sets Refire Interval, then resets the timer (unless the parameter matches the current Refire Interval).
- Tip: If Refire Interval is changed with AddOutput, the timer does not reset and the change only takes effect when the current interval is finished.
- ResetTimer
- Resets the timer.
- FireTimer
- Makes the appropriate output fire, then resets the timer.
- LowerRandomBound
<float>
- Sets Minimum Random Interval. If the timer is running, the change does not take effect until the current interval is finished.
- UpperRandomBound
<float>
- Sets Maximum Random Interval. If the timer is running, the change does not take effect until the current interval is finished.
- AddToTimer
<float>
- Adds extra time until the next output fire, if the entity is enabled. Does not change any keyvalues.
- SubtractFromTimer
<float>
- Subtracts time from the next output fire, if the entity is enabled. If the subtraction is so large that it would cause the output to fire in the past, it will fire immediately. Does not change any keyvalues.
- Enable
- Makes the entity active. This input will reset the timer.
- Disable
- Makes the entity inactive.
- Toggle
- If on, turn off. If off, turn on.
Outputs[edit | edit source]
- OnTimer
- Fires every interval, unless Oscillator is checked.
- OnTimerHigh
- Fires every other interval if Oscillator is checked.
- OnTimerLow
- Fires every other interval if Oscillator is checked.