logic_branch_listener

From Source Entities
Jump to navigation Jump to search

Code classes:

logic_branch_listener is a point entity present in all Source games. It observes the states of multiple logic_branches at once, allowing for more complex logic setups. When the state of a logic_branch changes, it will automatically tell logic_branch_listeners which are watching it to fire outputs.

Keyvalues[edit | edit source]

Logic Branch 01 (Branch01) to Logic Branch 16 (Branch16) <target_destination>
logic_branches to watch. These keyvalues will accept multiple logic_branches in the same field if some are given the same targetname, but the entity only accepts 16 entities maximum. Wildcards are also supported.

Inputs[edit | edit source]

Test
Tells the entity to look at the state of every logic_branch it was told to watch, then fires the appropriate output.
_OnLogicBranchChanged (Not in FGD)
Sent automatically by a logic_branch when its state changes. Makes the entity fire an output, but only if the listener's final result has changed.
_OnLogicBranchRemoved (Not in FGD)
Sent automatically by a logic_branch when it gets removed for any reason. The !activator will no longer be watched by this entity. Makes the entity fire an output, but only if the listener's final result has changed.

Outputs[edit | edit source]

OnAllTrue
Fires if all logic_branches are set to true.
OnAllFalse
Fires if all logic_branches are set to false.
OnMixed
Fires if the logic_branches are not all true nor all false.

See Also[edit | edit source]