logic_relay
		
		
		
		Jump to navigation
		Jump to search
		
| CLogicRelay | 

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 ?] 
Base:
- RunScriptFile
 - Load and execute a script file.
 
- RunScriptCode
 - Execute a fragment of script code.
 
- CallScriptFunction
 - Call a script function.
 
- CallPrivateScriptFunction
 - Calls a script function from this entity's private script scope.
 
- CallGlobalScriptFunction
 - Calls a script function in the global script scope.
 
- Kill
 - Removes this entity from the world.
 
- KillHierarchy
 - Removes this entity and all its children from the world.
 
- AddOutput
 - Adds an entity I/O connection to this entity. Parameter format: OutputName→TargetName→InputName→Parameter→Delay→MaxRefires
 
- FireUser1 to FireUser4
 - Fires the respective
OnUseroutputs; see User Inputs and Outputs. 
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.