Logic case: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Reverted edit of TroccNazel, changed back to last version by Beeswax)
Line 11: Line 11:
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.
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.


{{note|This entity with not recognize float values ending in <code>0</code> (like <code>0.50</code> or <code>1.00</code>). Simply remove these.}}
{{note|This entity will not recognize float values ending in <code>0</code> (like <code>0.50</code> or <code>1.00</code>). Simply remove these.}}


* The ideal entity for randomized events.
* The ideal entity for randomized events.

Revision as of 14:24, 15 August 2008

Template:Wrongtitle Template:Base point

Entity description

Logic case.png

Compares an input to up to 16 preset values. If the input value is the same as any of the preset values, an output corresponding to that value is fired.

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.

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.

Note.pngNote:This entity will not recognize float values ending in 0 (like 0.50 or 1.00). Simply remove these.
  • The ideal entity for randomized events.
  • Use with logic_timer for extremely random events.

Keyvalues

  • Case(01-16)
<string>

Inputs

  • InValue <string>
Compare the Input value to the case values, and fire the appropriate output, if any.
  • PickRandom
Fire a random OnCase output with at least one connection.
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

  • OnCase(01-16)
Fired when the input value equals the Case(01-16) value. (!activator is the activator)
  • OnDefault <string>
Fired when the input value does not equal any of the Case values. (!activator is the activator)