Logic relay (Source 2): Difference between revisions
		
		
		
		
		
		Jump to navigation
		Jump to search
		
				
		
		
	
No edit summary  | 
				No edit summary  | 
				||
| Line 1: | Line 1: | ||
{{LanguageBar}}  | {{LanguageBar}}  | ||
{{TabsBar|main=s2|base=logic relay}}  | {{TabsBar|main=s2|base=logic relay}}  | ||
{{this is a|point entity|name=logic_relay|sprite=1|engine=Source 2}} It acts as a message forwarder and can be disabled to prevent forwarding outputs. Useful as an intermediary between one entity and another for turning on or off an I/O connection, or as a container for holding a set of outputs that can be triggered from multiple places.  | {{this is a|point entity|name=logic_relay|sprite=1|engine=Source 2}} It acts as a message forwarder and can be disabled to prevent forwarding outputs. Useful as an intermediary between one entity and another for turning on or off an I/O connection, or as a container for holding a set of outputs that can be triggered from multiple places.  | ||
| Line 14: | Line 13: | ||
==Inputs==  | ==Inputs==  | ||
{{  | {{I|Enable|Allows the relay to fire the OnTrigger outputs after being disabled.}}  | ||
{{  | {{I|Disable|Prevents the relay from firing OnTrigger outputs in response to Trigger inputs.}}  | ||
{{  | {{I|Trigger|Trigger the relay, causing its OnTrigger output to fire if it is enabled.}}  | ||
{{  | {{I|Toggle|Toggle the relay between enabled and disabled.}}  | ||
{{  | {{I|CancelPending|Cancel any events fired by this relay that are currently pending in the I/O event queue {{bug|Using <code>CancelPending</code> on itself breaks the Service Queue which leads to a crash.}}}}  | ||
==Outputs==  | ==Outputs==  | ||
{{  | {{O|OnSpawn|Fired when the relay is spawned. If the relay is set to only trigger once, it will delete itself after firing this output.{{note|Every level load (including save loads!) triggers this output, unless "Fire once only" is checked.}}}}  | ||
{{  | {{O|OnTrigger|Fired when the relay is triggered. If the relay is set to only trigger once, it will delete itself after firing this output.}}  | ||
Latest revision as of 10:10, 26 September 2024

logic_relay  is a   point entity  available in all 
 Source 2 games. It acts as a message forwarder and can be disabled to prevent forwarding outputs. Useful as an intermediary between one entity and another for turning on or off an I/O connection, or as a container for holding a set of outputs that can be triggered from multiple places.
After a logic_relay is triggered, it cannot be triggered again until all of its outputs are fired. This is useful for when a relay has a sequence of delayed outputs that shouldn't be repeated until the sequence is finished. This behavior can be disabled by setting FastRetrigger to true.
Keyvalues
- 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 
- Start Disabled (StartDisabled) <boolean>
 - Stay dormant until activated (with the
Enableinput). 
- Trigger Once (TriggerOnce) <boolean>
 - Deletes the logic relay after firing an OnTrigger Output or a connected OnSpawn output
 
- Fast Retrigger (FastRetrigger) <boolean>
 - Without this, the logic_relay will wait until all inputs connected to OnTrigger have fired before retriggering
 
- Pass through caller (PassthroughCaller) <boolean>
 - If set, this logic_relay will be ignored by !caller in downstream IO connections. Instead, the previous caller in the IO chain will be found by !caller.
 
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 
Bug:Using CancelPendingon itself breaks the Service Queue which leads to a crash. [todo tested in ?] 
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.
Note:Every level load (including save loads!) triggers this output, unless "Fire once only" is checked. 
- OnTrigger
 - Fired when the relay is triggered. If the relay is set to only trigger once, it will delete itself after firing this output.