This article's documentation is for anything that uses the Source engine. Click here for more information.

logic_relay

From Valve Developer Community
Jump to: navigation, search
Logic relay.png

logic_relay is a point entity available in all Source Source games.

English (en)русский (ru)
Edit
logic_relay
Logic relay.png
TypePoint entity
EngineSource Source
AvailabilityIn all games
 

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.

class hierarchy
CLogicRelay defined in logicrelay.cpp
CLogicalEntity
CServerOnlyEntity
CBaseEntity

Keyvalues


Targetname:
Name (targetname) <string>
The targetname that other entities refer to this entity by.

EnableDisable:

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
Warning.pngWarning:Using CancelPending on itself will corrupt Service Queue causing server freezes and crashes.
EnableRefire  !FGD
Automatically fired on a relay after any delayed outputs finish firing, allowing it to fire again.
TriggerWithParameter <string> (only in 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.
Note.pngNote: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.
OnTriggerParameter <string> (only in 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.