Logic branch: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Categorized)
No edit summary
Line 4: Line 4:
'''Entity Name:''' logic_branch
'''Entity Name:''' logic_branch


Tests a boolean value and fires an output based on whether the value is true or false. Use this entity to branch between two potential sets of events.
Tests a [[Wikipedia:Boolean|boolean]] value and fires an output based on whether the value is true or false. Use this entity to branch between two potential sets of events.


==Entity Values==
* Values greater than 1 are treated as 0.
===Keys===


* '''Name''' ''targetname <target_source>'' 
==Keyvalues==
** The name that other entities refer to this entity by.
*'''Initial Value''' ''InitialValue <integer>''
** Initial value for the boolean value (0 or 1).


===Inputs===
* {{kv targetname}}


* '''Kill'''
* '''initialvalue'''
** Removes this entity from the world.
: {{boolean}}
* '''KillHierarchy''' 
 
** Removes this entity and all its children from the world.
==Inputs==
* '''AddOutput''' ''<output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire (-1 == infinite)>''
 
** Adds an entity I/O connection to this entity. Very dangerous, use with care
* {{i targetname}}
* '''FireUser1'''
* '''SetValue {{boolean}}'''
** Causes this entity's OnUser1 output to be fired.
: Set the boolean value without performing the comparison. Use this to hold a value for a future test.
* '''FireUser2'''
* '''SetValueTest {{boolean}}'''
** Causes this entity's OnUser2 output to be fired.
: Set the boolean value and test it, firing OnTrue or OnFalse based on the new value.
* '''FireUser3'''
** Causes this entity's OnUser3 output to be fired.
* '''FireUser4'''
** Causes this entity's OnUser4 output to be fired.
* '''SetValue <bool>'''
** Set the boolean value without performing the comparison. Use this to hold a value for a future test.
* '''SetValueTest <bool>'''
** Set the boolean value and test it, firing OnTrue or OnFalse based on the new value.
* '''Toggle'''
* '''Toggle'''
** Toggle the boolean value between true and false.
: Toggle the boolean value between true and false.
* '''ToggleTest'''
* '''ToggleTest'''
** Toggle the boolean value and tests it, firing OnTrue or OnFalse based on the new value.
: Toggle the boolean value and tests it, firing OnTrue or OnFalse based on the new value.
* '''Test'''
* '''Test'''
** Test the input value and fire OnTrue or OnFalse based on the value.
: Test the input value and fire OnTrue or OnFalse based on the value.




===Outputs===
==Outputs==


* '''OnUser1'''
* {{o targetname}}
** Fired in response to FireUser1 input.
* '''OnTrue {{boolean}}'''
* '''OnUser2'''
: Fired when the input value is true (nonzero).
** Fired in response to FireUser2 input.
* '''OnUser3'''
** Fired in response to FireUser3 input.
* '''OnUser4'''
** Fired in response to FireUser4 input.
* '''OnTrue <bool>'''
** Fired when the input value is true (nonzero).
* '''OnFalse <bool>'''
** Fired when the input value is false (zero).


 
* '''OnFalse {{boolean}}'''
==Additional Info==
: Fired when the input value is false (zero).
* Values greater than 1 are treated as 0.


[[Category:Entities]]
[[Category:Entities]]

Revision as of 20:23, 11 July 2005

Template:Wrongtitle

Entity Description

Entity Name: logic_branch

Tests a boolean value and fires an output based on whether the value is true or false. Use this entity to branch between two potential sets of events.

  • Values greater than 1 are treated as 0.

Keyvalues

  • initialvalue
<boolean>

Inputs

Set the boolean value without performing the comparison. Use this to hold a value for a future test.
Set the boolean value and test it, firing OnTrue or OnFalse based on the new value.
  • Toggle
Toggle the boolean value between true and false.
  • ToggleTest
Toggle the boolean value and tests it, firing OnTrue or OnFalse based on the new value.
  • Test
Test the input value and fire OnTrue or OnFalse based on the value.


Outputs

Fired when the input value is true (nonzero).
Fired when the input value is false (zero).