Logic case: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Categorized)
No edit summary
Line 10: Line 10:
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.


==Entity Values==
* The ideal entity for if you want randomized events.
===Keys===
* Use with [[Logic_timer]] for extremely random events.


* '''Name''' ''targetname <target_source>'' 
==Keyvalues==
** The name that other entities refer to this entity by.
* '''Case 01''' ''Case01 <string>''
* '''Case 02''' ''Case02 <string>''
* '''Case 03''' ''Case03 <string>''
* '''Case 04''' ''Case04 <string>''
* '''Case 05''' ''Case05 <string>''
* '''Case 06''' ''Case06 <string>''
* '''Case 07''' ''Case07 <string>''
* '''Case 08''' ''Case08 <string>''
* '''Case 09''' ''Case01 <string>''
* '''Case 10''' ''Case01 <string>''
* '''Case 11''' ''Case01 <string>''
* '''Case 12''' ''Case01 <string>''
* '''Case 13''' ''Case01 <string>''
* '''Case 14''' ''Case01 <string>''
* '''Case 15''' ''Case01 <string>''
* '''Case 16''' ''Case01 <string>''


* {{kv targetname}}
* '''Case01'''
: <string>
* '''Case02'''
: <string>
* '''Case03'''
: <string>
* '''Case04'''
: <string>
* '''Case05'''
: <string>
* '''Case06'''
: <string>
* '''Case07'''
: <string>
* '''Case08'''
: <string>
* '''Case09'''
: <string>
* '''Case10'''
: <string>
* '''Case11'''
: <string>
* '''Case12'''
: <string>
* '''Case13'''
: <string>
* '''Case14'''
: <string>
* '''Case15'''
: <string>
* '''Case16'''
: <string>


===Inputs===
===Inputs===


* '''Kill'''
* {{i targetname}}
** Removes this entity from the world.
 
* '''KillHierarchy''' 
** Removes this entity and all its children from the world.
* '''AddOutput''' ''<output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire (-1 == infinite)>''
** Adds an entity I/O connection to this entity. Very dangerous, use with care
* '''FireUser1'''
** Causes this entity's OnUser1 output to be fired.
* '''FireUser2'''
** Causes this entity's OnUser2 output to be fired.
* '''FireUser3'''
** Causes this entity's OnUser3 output to be fired.
* '''FireUser4'''
** Causes this entity's OnUser4 output to be fired.
* '''InValue <string>'''
* '''InValue <string>'''
** Compare the Input value to the case values, and fire the appropriate output, if any.
: Compare the Input value to the case values, and fire the appropriate output, if any.
 
* '''PickRandom'''
* '''PickRandom'''
** Fire a random OnCase output with at least one connection.
: Fire a random OnCase output with at least one connection.




===Outputs===
===Outputs===


* '''OnUser1'''
* {{o targetname}}
** Fired in response to FireUser1 input.
 
* '''OnUser2'''
* '''OnCase''N'''''
** Fired in response to FireUser2 input.
: Fired when the input value equals the Case''N'' value.
* '''OnUser3'''
 
** Fired in response to FireUser3 input.
* '''OnUser4'''
** Fired in response to FireUser4 input.
* '''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.
* '''OnDefault'''
* '''OnDefault'''
** OnDefault Fired when the input value does not equal any of the Case values.
: Fired when the input value does not equal any of the Case values.
 
==Additional Info==
* The ideal entity for if you want randomized events.
* Use with [[Logic_timer]] for extremely random events.


[[Category:Entities]]
[[Category:Entities]]

Revision as of 20:26, 11 July 2005

Template:Wrongtitle

Entity Description

Entity Name: logic_case

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.

  • The ideal entity for if you want randomized events.
  • Use with Logic_timer for extremely random events.

Keyvalues

<string>
  • Case02
<string>
  • Case03
<string>
  • Case04
<string>
  • Case05
<string>
  • Case06
<string>
  • Case07
<string>
  • Case08
<string>
  • Case09
<string>
  • Case10
<string>
  • Case11
<string>
  • Case12
<string>
  • Case13
<string>
  • Case14
<string>
  • Case15
<string>
  • Case16
<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.


Outputs

  • OnCaseN
Fired when the input value equals the CaseN value.
  • OnDefault
Fired when the input value does not equal any of the Case values.