Logic gate (Entity): Difference between revisions
Jump to navigation
Jump to search
Note:The OnResultTrue and OnResultFalse outputs will be fired on every state change, even if the result doesn't change!
(Created logic_gate point entity page for a p2ce only entity) |
(Remove description header) |
||
Line 1: | Line 1: | ||
{{P2CE point|logic_gate}} | {{P2CE point|logic_gate}} This logic entity acts as a simple boolean value comparator with two inputs. When disabled, this entity will still accept inputs, but not fire outputs! | ||
Supported comparison modes are: | |||
# AND | # AND | ||
# OR | # OR |
Revision as of 12:33, 28 July 2020
Template:P2CE point This logic entity acts as a simple boolean value comparator with two inputs. When disabled, this entity will still accept inputs, but not fire outputs!
Supported comparison modes are:
- AND
- OR
- NOT
- NAND
- NOR
- XOR
- XNOR
(This is the internal order, which is used for the SetMode input. Note that they internally start from 0)

Keyvalues
- Start Disabled (StartDisabled) <boolean>
- If it should start disabled
- Comparison Mode (mode) <choices>
- The comparison mode to use
- Pitch Yaw Roll (Y Z X) (angles) <QAngle>
- This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.
- 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
Parentname:
- Parent (parentname) <targetname>
- Specifies a movement parent. An entity will maintain its initial offset from its parent. An attachment point can be added to the end of the name, separated by a comma.
Inputs
- SetStateA
- Sets the boolean state of the A value
- SetStateB
- Sets the boolean state of the B value
- SetMode
- Sets the comparison mode. Input the index of the comparison mode as seen above - 1 (Starting from 0)
- GetValue
- When fired, the logic_gate will call its OutValue outputs, using the current result state as the parameter (0, 1). Similar to math_counter)
EnableDisable:
- Enable / Disable
- Enable/disable this entity from performing its task. It might also disappear from view.
Toggle:
- Toggle
- Toggle the enabled/disabled status of this entity.
Outputs
- OnResultTrue
- Called when the state is true
- OnResultFalse
- Called when the result is false
- OutValue
- Called when GetValue is fired. Automatically fills the parameter with the current result state (0, 1). Similar to math_counter