Logic relay: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
(Cleared up info on retriggering, adjusted template usage)
Line 4: Line 4:


{{base point|logic_relay|sprite=1}} It is a message forwarder. It can be used to fire many [[output]]s at once from just one input, or, by being disabled, to break an I/O chain. It can also be very helpful for organization and keeping you from having to edit MANY instances of the same outputs, as opposed to just one.
{{base point|logic_relay|sprite=1}} It is a message forwarder. It can be used to fire many [[output]]s at once from just one input, or, by being disabled, to break an I/O chain. It can also be very helpful for organization and keeping you from having to edit MANY instances of the same outputs, as opposed to just one.
After an <code>info_relay</code> is triggered, it cannot be triggered again until all of its outputs are fired. This means a relay with delayed outputs cannot trigger again until the highest delay is surpassed. This is useful for when a relay with delayed outputs is supposed to be fired multiple times, but not all at once. This behavior can be disabled with the "Allow fast retrigger" spawnflag.
{{clr}}
{{clr}}


Line 12: Line 14:
==Flags==
==Flags==
*1: Only trigger once
*1: Only trigger once
*2: Allow fast retrigger (otherwise there is a minimum delay of 0.001 seconds)
*2: Allow fast retrigger


==Inputs==
==Inputs==
Line 20: Line 22:
{{IO|Toggle|Toggle the relay between enabled and disabled.}}
{{IO|Toggle|Toggle the relay between enabled and disabled.}}
{{IO|CancelPending|Cancel any events fired by this relay that are currently pending in the I/O event queue.}}
{{IO|CancelPending|Cancel any events fired by this relay that are currently pending in the I/O event queue.}}
{{IO|EnableRefire|Allows a slow trigger to fire again. (See the second flag)}}
{{IO|EnableRefire|Automatically fired on a relay after any delayed outputs finish firing, allowing it to fire again.|nofgd=1}}
{{IO|TriggerWithParameter|Triggers the relay with a parameter, causing its OnTriggerParameter output to fire if it is enabled.}}{{Mapbase add}}
{{IO|TriggerWithParameter|since=mapbase|Triggers the relay with a parameter, causing its OnTriggerParameter output to fire if it is enabled.}}
{{I Targetname}}
{{I Targetname}}


Line 27: Line 29:
{{IO|OnSpawn|Fired when the relay is spawned. If the relay is set to only trigger once, it will delete itself after firing this output.}}
{{IO|OnSpawn|Fired when the relay is spawned. If the relay is set to only trigger once, it will delete itself after firing this output.}}
{{IO|OnTrigger|Fired when the relay is triggered. If the relay is set to only trigger once, it will delete itself after firing this output.}}
{{IO|OnTrigger|Fired when the relay is triggered. If the relay is set to only trigger once, it will delete itself after firing this output.}}
{{IO|OnTriggerParameter|Fired when the relay is triggered with a parameter. If the relay is set to only trigger once, it will delete itself after firing this output.}}{{Mapbase add}}
{{IO|OnTriggerParameter|since=mapbase|Fired when the relay is triggered with a parameter. If the relay is set to only trigger once, it will delete itself after firing this output.}}
{{O Targetname}}
{{O Targetname}}


[[Category:IO System]]
[[Category:IO System]]

Revision as of 15:23, 31 January 2020

Template:Otherlang2

Template:Base point It is a message forwarder. It can be used to fire many outputs at once from just one input, or, by being disabled, to break an I/O chain. It can also be very helpful for organization and keeping you from having to edit MANY instances of the same outputs, as opposed to just one.

After an info_relay is triggered, it cannot be triggered again until all of its outputs are fired. This means a relay with delayed outputs cannot trigger again until the highest delay is surpassed. This is useful for when a relay with delayed outputs is supposed to be fired multiple times, but not all at once. This behavior can be disabled with the "Allow fast retrigger" spawnflag.

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

Start Disabled (StartDisabled) <boolean>
Stay dormant until activated (with theEnableinput).

Flags

  • 1: Only trigger once
  • 2: Allow fast retrigger

Inputs

Enable
Allows the relay to fire the OnTrigger outputs after being disabled.
Disable
Prevents the relay from firing OnTrigger outputs in response to Trigger inputs.
Trigger
Trigger the relay, causing its OnTrigger output to fire if it is enabled.
Toggle
Toggle the relay between enabled and disabled.
CancelPending
Cancel any events fired by this relay that are currently pending in the I/O event queue.
EnableRefire  !FGD
Automatically fired on a relay after any delayed outputs finish firing, allowing it to fire again.
TriggerWithParameter  (in all games since Mapbase)
Triggers the relay with a parameter, causing its OnTriggerParameter output to fire if it is enabled.


Outputs

OnSpawn
Fired when the relay is spawned. If the relay is set to only trigger once, it will delete itself after firing this output.
OnTrigger
Fired when the relay is triggered. If the relay is set to only trigger once, it will delete itself after firing this output.
OnTriggerParameter  (in all games since Mapbase)
Fired when the relay is triggered with a parameter. If the relay is set to only trigger once, it will delete itself after firing this output.