Logic case: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(cleanup)
(Cleanup)
Line 1: Line 1:
{{base point|logic_case}}
== Entity description ==
[[File:logic_case.png|left]]
[[File:logic_case.png|left]]
 
Compares an input to up to 16 configured values, firing a corresponding output if there is a match (on <code>InValue</code>), or fires a random output (on <code>PickRandom</code>).
{{base point|logic_case}} It either compares an input to up to 16 configured values, firing a corresponding output if there is a match (on <code>InValue</code>), or fires a random output (on <code>PickRandom</code>).


{{bug|This entity will not recognize [[float]]s with trailing zeroes (like <code>0.50</code> or <code>1.00</code>). Always remove any.}}
{{bug|This entity will not recognize [[float]]s with trailing zeroes (like <code>0.50</code> or <code>1.00</code>). Always remove any.}}
Line 8: Line 10:


== Keyvalues ==
== Keyvalues ==
 
{{KV|Case 01|to=Case 16|string|The values to test against.}}
; Case01 <span style="font-weight:normal;">to</span> Case16 <code><[[string]]></code>
: The values to test against.
{{KV Targetname}}
{{KV Targetname}}


== Inputs ==
== Inputs ==
 
{{IO|InValue|Compares the Input value to the case values, and fires the appropriate output, if any.|param=string}}
; <code>InValue <[[string]]></code>
{{IO|PickRandom|Fires a random OnCase output with at least one connection.}}
: Compare an input value to the case values, firing the appropriate output on the first match.
{{IO|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.}}
; <code>PickRandom</code>
: Fire a random <code>OnCase</code> output with at least one connection.
; <code>PickRandomShuffle</code>
: Fires a random <code>OnCase</code> output with at least one connection, with no repeats until all have been picked.
{{I Targetname}}
{{I Targetname}}


== Outputs ==
== Outputs ==
 
{{IO|OnCase01|to=OnCase16|Fired when the input value equals the corresponding Case value.}}
; <code>OnCase01</code> <span style="font-weight:normal;">to</span> <code>OnCase16</code>
{{IO|OnDefault|Fired when the input value does not equal any of the Case values.}}
: Fired when the input value equals the corresponding Case value.
; <code>OnDefault <[[string]]></code>
: Fired when the input value does not equal any of the Case values. Passes the value on.
{{O Targetname}}
{{O Targetname}}

Revision as of 23:05, 8 June 2011

Template:Base point

Entity description

Logic case.png

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).

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.