logic_case
Jump to navigation
Jump to search
| CLogicCase |

logic_case is a logical entity available in all
Source games. It compares an input to up to 16 configured values, firing a corresponding output if there is a match (on InValue), or fires a random output (on PickRandom). Use logic_random_outputs for a weighted random output.
Keyvalues
- Name (targetname) <string>[ Edit ]
- The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g.
parentnameortarget).
Also displayed in Hammer's 2D views and Entity Report.See also: Generic Keyvalues, Inputs and Outputs available to all entities
- Case 01 (Case01) to Case 16 (Case16) <string>
- The values to test against.
Inputs
- InValue <variant>
- Compares the Input value converted to string to the case values, and fires the appropriate output, if any.
- PickRandom <void>
- Fires a random OnCase output with at least one connection.
- PickRandomShuffle <void>
- Fires a random OnCase output with at least one connection, with no repeats until all cases have been picked, at which point the shuffle starts over.
Outputs
- OnCase01 to OnCase16 <void>
- !activator = activator of the input causing this
!caller = this entity
Fired when the input value equals the corresponding Case value.
- OnDefault <variant>
- !activator = activator of InValue input
!caller = this entity
Fired when the input value does not equal any of the Case values.
- OnUsed <variant> (only in
) - !activator = activator of InValue input
!caller = this entity
Fired when an input value is received, regardless of whether it matches a case. Outputs the same parameter type as was inputted with InValue input (i.e. if it was float this output will be of type float, the same applies to OnDefault output in
)