Logic case: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Added Template:Lang)
(Added OnUsed output)
Line 23: Line 23:
{{IO|OnCase01|to=OnCase16|Fired when the input value equals the corresponding Case value.}}
{{IO|OnCase01|to=OnCase16|Fired when the input value equals the corresponding Case value.}}
{{IO|OnDefault|Fired when the input value does not equal any of the Case values.}}
{{IO|OnDefault|Fired when the input value does not equal any of the Case values.}}
{{IO|OnUsed|Fired when this entity receives any input at all.}}
{{O Targetname}}
{{O Targetname}}


[[Category:IO System]]
[[Category:IO System]]

Revision as of 08:32, 22 November 2021

English (en)中文 (zh)Translate (Translate)

Template:Base point

Entity description

Logic case.png

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.

Icon-Bug.pngBug:This entity will not recognize floats with trailing zeroes (like 0.50 or 1.00). Always remove any.  [todo tested in ?]
Tip.pngTip:Use with logic_timer for extremely random events.

Keyvalues

Case 01 ([todo internal name (i)]) to Case 16 <string>
The values to test against.
Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

Inputs

InValue <stringRedirectInput/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.


Outputs

OnCase01 to OnCase16
Fired when the input value equals the corresponding Case value.
OnDefault
Fired when the input value does not equal any of the Case values.
OnUsed
Fired when this entity receives any input at all.