Logic timer: Difference between revisions
		
		
		
		
		
		Jump to navigation
		Jump to search
		
				
		  
 Note:Enabling the entity resets its timer.
Note:Enabling the entity resets its timer.
 Tip:Use with logic_case for extremely random events.
Tip:Use with logic_case for extremely random events.
		
	
|  (Undo revision 122450 by TomEdwards (Talk)) | TomEdwards (talk | contribs)   (you're going to have to explain what problem you have with the page first) | ||
| Line 1: | Line 1: | ||
| {{ | [[File:Logic timer.png|left]] {{DISPLAYTITLE:logic_timer}} __NOTOC__ | ||
| {{base point|logic_timer}} It fires an [[output]] at regular or random intervals. It can optionally alternate between a "high" and a"low" output. | |||
| {{note|Enabling the entity resets its timer.}} | |||
| {{tip|Use with [[logic_case]] for extremely random events.}} | |||
| ==KeyValues== | |||
| ; Use Random Time <code><[[bool]]></code> | |||
| :  | : Makes the entity fire at random intervals. Range of values is restricted by the next two KVs. | ||
| ; Minimum Random Interval <code><[[float]]></code> | |||
| ; Maximum Random Interval <code><float></code> | |||
| : If "Use Random Time" is enabled, these values define the range of values, in seconds, that the entity can choose from for random firing. | |||
| ; Refire Interval <code><float></code> | |||
| : If "Use Random Time" is disabled, this is the interval between outputs in seconds. | |||
| {{KV EnableDisable}} | |||
| {{KV Targetname}} | |||
| ==Flags== | ==Flags== | ||
| *  | * Oscillator (Alternates between <code>OnTimerHigh</code> and <code>OnTimerLow</code> outputs. <code>OnTimerHigh</code> comes first.) | ||
| ==Inputs== | ==Inputs== | ||
| ; <code>Toggle</code> | |||
| : Toggle the timer on or off, resetting it in the process. | |||
| ; <code>RefireTime <[[int]]></code> | |||
| : Set a new refire interval. | |||
| : Toggle the timer on | ; <code>FireTimer</code> | ||
| : Set a new  | |||
| : Force the timer to fire immediately. | : Force the timer to fire immediately. | ||
| ; <code>LowerRandomBound <[[float]]></code> | |||
| ; <code>UpperRandomBound <float></code> | |||
| : Set a new min/max random interval. | |||
| ; {{EP2 add|<code>ResetTimer</code>}} | |||
| : Starts counting from zero. You could also use <code>enable</code>. | |||
| : Set a new  | ; {{EP2 add|<code>AddToTimer <float></code>}} | ||
| ; {{EP2 add|<code>SubtractFromTimer <float></code>}} | |||
| : Adds/removes time if the timer is enabled. No effect if disabled. | |||
| ; {{EP2 add|<code>UseRandomTime</code>}} | |||
| {{I EnableDisable}} | |||
| {{I Targetname}} | |||
| ==Outputs== | ==Outputs== | ||
| ; <code>OnTimer</code> | |||
| : Fired when a non-oscillating timer expires. | |||
| ; <code>OnTimerHigh</code> | |||
| : Fired when  | ; <code>OnTimerLow</code> | ||
| : Alternatively fired every time an oscillating timer expires, starting with <code>OnTimerHigh</code>. | |||
| {{O Targetname}} | |||
| :  | |||
Revision as of 01:48, 13 August 2009
Template:Base point It fires an output at regular or random intervals. It can optionally alternate between a "high" and a"low" output.
 Note:Enabling the entity resets its timer.
Note:Enabling the entity resets its timer. Tip:Use with logic_case for extremely random events.
Tip:Use with logic_case for extremely random events.KeyValues
- Use Random Time <bool>
- Makes the entity fire at random intervals. Range of values is restricted by the next two KVs.
- Minimum Random Interval <float>
- Maximum Random Interval <float>
- If "Use Random Time" is enabled, these values define the range of values, in seconds, that the entity can choose from for random firing.
- Refire Interval <float>
- If "Use Random Time" is disabled, this is the interval between outputs in seconds.
- Start Disabled (StartDisabled) <boolean>
- Stay dormant until activated (with theEnableinput).
- Name (targetname) <string>[ Edit ]
- The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentnameortarget).
 Also displayed in Hammer's 2D views and Entity Report.See also: Generic Keyvalues, Inputs and Outputs available to all entities
Flags
- Oscillator (Alternates between OnTimerHighandOnTimerLowoutputs.OnTimerHighcomes first.)
Inputs
- Toggle
- Toggle the timer on or off, resetting it in the process.
- RefireTime <int>
- Set a new refire interval.
- FireTimer
- Force the timer to fire immediately.
- LowerRandomBound <float>
- UpperRandomBound <float>
- Set a new min/max random interval.
- Template:EP2 add
- Starts counting from zero. You could also use enable.
- Template:EP2 add
- Template:EP2 add
- Adds/removes time if the timer is enabled. No effect if disabled.
- Template:EP2 add
EnableDisable:
- Enable / Disable
- Enable/disable this entity from performing its task. It might also disappear from view.
Outputs
- OnTimer
- Fired when a non-oscillating timer expires.
- OnTimerHigh
- OnTimerLow
- Alternatively fired every time an oscillating timer expires, starting with OnTimerHigh.
