Logic relay: Difference between revisions
Jump to navigation
Jump to search
(shorten it to be more direct.) |
(changed warning to bug, removed duplicate info, see also) |
||
Line 1: | Line 1: | ||
{{langsp}} | {{langsp}} | ||
{{CD|CLogicRelay|file1=logicrelay.cpp}} | |||
{{ | |||
| | |||
| | |||
}} | |||
It is a Output forwarder, which can be used to fire many [[Inputs and Outputs#Outputs|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. | It is a Output forwarder, which can be used to fire many [[Inputs and Outputs#Outputs|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 a <code>logic_relay</code> 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. | After a <code>logic_relay</code> 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. | ||
__NOTOC__ | |||
==Keyvalues== | ==Keyvalues== | ||
{{KV Targetname}} | {{KV Targetname}} | ||
Line 27: | Line 18: | ||
{{IO|Trigger|Trigger the relay, causing its OnTrigger output to fire if it is enabled.}} | {{IO|Trigger|Trigger the relay, causing its OnTrigger output to fire if it is enabled.}} | ||
{{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 {{bug|Using <code>CancelPending</code> on itself breaks the Service Queue which leads to a crash.}}}} | ||
{{IO|EnableRefire|Automatically fired on a relay after any delayed outputs finish firing, allowing it to fire again.|nofgd=1}} | {{IO|EnableRefire|Automatically fired on a relay after any delayed outputs finish firing, allowing it to fire again.|nofgd=1}} | ||
{{IO|TriggerWithParameter|param=string|only={{mapbase}}|Triggers the relay with a parameter, causing its OnTriggerParameter output to fire if it is enabled.}} | {{IO|TriggerWithParameter|param=string|only={{mapbase}}|Triggers the relay with a parameter, causing its OnTriggerParameter output to fire if it is enabled.}} | ||
Line 35: | Line 26: | ||
{{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|param=string|only={{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.}} | {{IO|OnTriggerParameter|param=string|only={{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.}} | ||
== See Also == | |||
* {{ent|logic_case}} |
Revision as of 08:33, 18 June 2024
![]() |
---|
CLogicRelay |
![]() |
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.
Keyvalues
- Name (targetname) <string>[ Edit ]
- The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g.
parentname
ortarget
).
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
Enable
input).
Flags
- Only trigger once : [1]
- Allow fast retrigger : [2]
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
CancelPending
on 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
- 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.
- OnTriggerParameter <string > (only in
)
- 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.