logic_compare

From Valve Developer Community

Revision as of 03:07, 20 January 2009 by VDCBot (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This is a point entity available in all Source games.

Contents

Entity Description

Compares an input value to another value, and fires an output depending on if the input value is equal to, greater than, less than, or not equal to, the compare value, sending the input value as data.

Note the difference between the SetValueCompare and SetCompareValue inputs.

Keyvalues

  • Targetname:

Name <string>
The targetname other entities refer to this entity by.
  • InitialValue
<integer> Initial value for the input value.
  • CompareValue
<integer> The value to compare against.

Inputs

  • Targetname:

Kill
Removes this entity from the world.
KillHierarchy
Removes this entity and all its children from the world.
AddOutput <string>
Evaluates a keyvalue/output on this entity. It can be potentially very dangerous, use with care.
Format: <key> <value>
Format: <output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire, -1 means infinite>
FireUser1 to FireUser4
Fire the OnUser outputs; see User Inputs and Outputs.
  • SetValue <float>
Set the value that will be compared against the compare value.
  • SetValueCompare <float>
Set the value that will be compared against the compare value and performs the comparison.
  • SetCompareValue <float>
Set the compare value.
  • Compare
Force a compare of the input value with the compare value.


Outputs

  • Targetname:

OnUser1 to OnUser4
Fired in response to the FireUser inputs; see User Inputs and Outputs.
OnKilled (New with Left 4 Dead)
Fired when the entity is killed and removed from the game.
  • OnEqualTo <float>
Fired when the input value is equal to the compare value. Sends the input value as data.
  • OnGreaterThan <float>
Fired when the input value is greater than the compare value. Sends the input value as data.
  • OnLessThan <float>
Fired when the input value is less than the compare value. Sends the input value as data.
  • OnNotEqualTo <float>
Fired when the input value is different from the compare value. Sends the input value as data.
Personal tools