Logic relay

From Valve Developer Community

This point-based entity is available in all Source games.

Table of contents

Entity description

A message forwarder. Fires an OnTrigger output when triggered, 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. Additionally, its Enabled/Disabled state can be used for conditional logic ("if, then" style logic).

Keyvalues

Defines the name that other entities refer to this entity by.
  • hammerid [New with Orange Box]
<integer readonly> This id is used for debugging purposes in Hammer.
  • StartDisabled
<boolean>

Flags

  • 1 : Only trigger once (Default Checked)
If checked, this entity starts on.
  • 2 : Allow fast retrigger (Default Unchecked)
Allows fast retriggering.

Inputs

  • Kill
Removes this entity from the world.
Removes this entity and all its children from the world.
  • AddOutput <string>
Evaluates a keyvalue/output on this entity. It can be potentially very dangerous, use with care.
Format: <key> <value>
Format: <output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire (-1 == infinite)>
Causes this entity's OnUser1-4 outputs to be fired. See User Inputs and Outputs.
  • Enable
Enable this entity.
  • Disable
Disable this entity.
  • 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.

Outputs

Fired in response to FireUser1-4 inputs. See User Inputs and Outputs.
!activator = activator
  • OnTrigger
Fired when the relay is triggered.
!activator = activator
  • OnSpawn [Episode One Update]
Fired when the relay is spawned. If the relay is set to only trigger once, it will delete itself after firing this output.