Logic relay: Difference between revisions
|  (→Outputs:  activator/caller) | |||
| Line 27: | Line 27: | ||
| == Outputs == | == Outputs == | ||
| {{O|OnSpawn| | {{O|OnSpawn|ac-is-this=1|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|activator = activator of Trigger input|Fired when the relay is triggered. If the relay is set to only trigger once, it will delete itself after firing this output.}} | {{O|OnTrigger|activator = activator of Trigger input|Fired when the relay is triggered. If the relay is set to only trigger once, it will delete itself after firing this output.}} | ||
| {{O|OnTriggerParameter|param=string|only={{mapbase}}|activator = activator of TriggerWithParameter input|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|OnTriggerParameter|param=string|only={{mapbase}}|activator = activator of TriggerWithParameter input|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.}} | ||
Revision as of 12:03, 26 April 2025

logic_relay  is a   point entity  available in all  Source games.
 Source games. 
|  Class hierarchy | 
|---|
| CLogicRelay | 
|  logicrelay.cpp | 
It is a Output forwarder, which 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 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 with the "Allow fast retrigger" spawnflag.
logic_relay combines the functionality of trigger_relay and multi_manager from  GoldSrc. The older entities still exist in
 GoldSrc. The older entities still exist in  Half-Life: Source, but are deprecated.
 Half-Life: Source, but are deprecated.
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>
- When disabled OnTriggeroutput won't fire
Flags
- Only trigger once : [1]
- Allow fast retrigger : [2]
Inputs
- Trigger
- Trigger the relay, causing its OnTrigger output to fire if it is enabled.
- 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.
- 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 Bug:UsingCancelPendingon itself breaks the Service Queue which leads to a crash. [todo tested in ?]
- EnableRefire !FGD
- Automatically fired on a relay after any delayed outputs finish firing, allowing it to fire again.
- TriggerWithParameter  <string> (only in  ) )
- Triggers the relay with a parameter, causing its OnTriggerParameter output to fire if it is enabled.
Outputs
- OnSpawn
- !activator = !caller = this entity
 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. Note:Every level load (including save loads!) triggers this output, unless "Fire once only" is checked.
- OnTrigger
- !activator = activator of Trigger input
 !caller = this entity
 Fired when the relay is triggered. If the relay is set to only trigger once, it will delete itself after firing this output.
- OnTriggerParameter  <string> (only in  ) )
- !activator = activator of TriggerWithParameter input
 !caller = this entity
 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.


























