logic_case
Compares an input to up to 32 preset values. If the input value is the same as any of the preset values, an output corresponding to that value is fired.<br><br>For example: if Case01 is set to 2 and Case02 is set to 5, and the input value is 5, the OnCase02 output will be fired.<br><br>This entity can also be used to select from a number of random targets via the PickRandom input. One of the OnCase outputs that is connected to another entity will be picked at random and fired.
- FGD
@PointClassingame/core/base.fgd, basesTargetname. - cs_script type:
Entity, whatFindEntitiesByClass("logic_case")returns. - Native class:
CLogicCase(curated pairing).
CS2 build 27045800 · Steam date 2026-11-30 · platform windows-x86_64 · schema format 2.2
Inputs (19)
| Name | Parameter | From | Description |
|---|---|---|---|
RunScriptFile | string | VScript | Load and execute a script file |
RunScriptCode | string | VScript | Execute a fragment of script code |
CallScriptFunction | string | VScript | Call a script function |
CallPrivateScriptFunction | string | VScript | Calls a script function from this entity's private script scope. |
CallGlobalScriptFunction | string | VScript | Calls a script function in the global script scope. |
Kill | GameEntity | Removes this entity from the world. | |
KillHierarchy | GameEntity | Removes this entity and all its children from the world. | |
KillConstrained | GameEntity | Removes this entity, all its children, and anything constrained to it, from the world. | |
AddOutput | string | GameEntity | Adds an entity I/O connection to this entity. Parameter format: outputname>targetname>inputname>parameter>delay>max times to fire (-1 == infinite). Very dangerous, use with care. |
FireUser1 | GameEntity | Causes this entity's OnUser1 output to be fired. | |
FireUser2 | GameEntity | Causes this entity's OnUser2 output to be fired. | |
FireUser3 | GameEntity | Causes this entity's OnUser3 output to be fired. | |
FireUser4 | GameEntity | Causes this entity's OnUser4 output to be fired. | |
EnableAutoSleeping | GameEntity | Enable automatic sleeping on this entity's physics bodies. When enabled, physics bodies go to sleep when at rest. | |
DisableAutoSleeping | GameEntity | Disable automatic sleeping on this entity's physics bodies. Bodies remain awake until explicitly put to sleep. | |
InValue | string | Compares the Input value to the case values, and fires the appropriate output, if any. | |
PickRandom | Fires a random OnCase output with at least one connection. | ||
PickRandomShuffle | 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. | ||
ResetShuffle | Starts the shuffle over so that the next PickRandomShuffle can select from all cases. |
Outputs (38)
| Name | Parameter | From | Description |
|---|---|---|---|
OnUser1 | GameEntity | Fired in response to FireUser1 input. | |
OnUser2 | GameEntity | Fired in response to FireUser2 input. | |
OnUser3 | GameEntity | Fired in response to FireUser3 input. | |
OnUser4 | GameEntity | Fired in response to FireUser4 input. | |
OnKilled | GameEntity | Fired when the entity is killed and removed from the game. Parameter is the inflictor. | |
OnDefault | Fired when the input value does not equal any of the Case values. | ||
OnCase01 | Fired when the input value equals the Case01 value. | ||
OnCase02 | Fired when the input value equals the Case02 value. | ||
OnCase03 | Fired when the input value equals the Case03 value. | ||
OnCase04 | Fired when the input value equals the Case04 value. | ||
OnCase05 | Fired when the input value equals the Case05 value. | ||
OnCase06 | Fired when the input value equals the Case06 value. | ||
OnCase07 | Fired when the input value equals the Case07 value. | ||
OnCase08 | Fired when the input value equals the Case08 value. | ||
OnCase09 | Fired when the input value equals the Case09 value. | ||
OnCase10 | Fired when the input value equals the Case10 value. | ||
OnCase11 | Fired when the input value equals the Case11 value. | ||
OnCase12 | Fired when the input value equals the Case12 value. | ||
OnCase13 | Fired when the input value equals the Case13 value. | ||
OnCase14 | Fired when the input value equals the Case14 value. | ||
OnCase15 | Fired when the input value equals the Case15 value. | ||
OnCase16 | Fired when the input value equals the Case16 value. | ||
OnCase17 | Fired when the input value equals the Case17 value. | ||
OnCase18 | Fired when the input value equals the Case18 value. | ||
OnCase19 | Fired when the input value equals the Case19 value. | ||
OnCase20 | Fired when the input value equals the Case20 value. | ||
OnCase21 | Fired when the input value equals the Case21 value. | ||
OnCase22 | Fired when the input value equals the Case22 value. | ||
OnCase23 | Fired when the input value equals the Case23 value. | ||
OnCase24 | Fired when the input value equals the Case24 value. | ||
OnCase25 | Fired when the input value equals the Case25 value. | ||
OnCase26 | Fired when the input value equals the Case26 value. | ||
OnCase27 | Fired when the input value equals the Case27 value. | ||
OnCase28 | Fired when the input value equals the Case28 value. | ||
OnCase29 | Fired when the input value equals the Case29 value. | ||
OnCase30 | Fired when the input value equals the Case30 value. | ||
OnCase31 | Fired when the input value equals the Case31 value. | ||
OnCase32 | Fired when the input value equals the Case32 value. |
Keyvalues (34)
The names Hammer saves and the KeyValue input and AddOutput take at run time. An entity reads some keys only when it spawns, so changing one later may do nothing. Integer keys such as movetype take engine numbers, not the renumbered cs_script enum values.
| Key | Type | Default | From | Description |
|---|---|---|---|---|
vscriptsEntity Scripts | scriptlist | VScript | Name(s) of script files that are executed after all entities have spawned. | |
targetnameName | target_source | Targetname | The name that other entities refer to this entity by. | |
Case01Case 01 | string | |||
Case02Case 02 | string | |||
Case03Case 03 | string | |||
Case04Case 04 | string | |||
Case05Case 05 | string | |||
Case06Case 06 | string | |||
Case07Case 07 | string | |||
Case08Case 08 | string | |||
Case09Case 09 | string | |||
Case10Case 10 | string | |||
Case11Case 11 | string | |||
Case12Case 12 | string | |||
Case13Case 13 | string | |||
Case14Case 14 | string | |||
Case15Case 15 | string | |||
Case16Case 16 | string | |||
Case17Case 17 | string | |||
Case18Case 18 | string | |||
Case19Case 19 | string | |||
Case20Case 20 | string | |||
Case21Case 21 | string | |||
Case22Case 22 | string | |||
Case23Case 23 | string | |||
Case24Case 24 | string | |||
Case25Case 25 | string | |||
Case26Case 26 | string | |||
Case27Case 27 | string | |||
Case28Case 28 | string | |||
Case29Case 29 | string | |||
Case30Case 30 | string | |||
Case31Case 31 | string | |||
Case32Case 32 | string |