Logic compare: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 1: Line 1:
[[File:logic_compare.png|left|link=]]
{{base point|logic_compare|sprite=1}} It examines the relationship between two numbers ("value" and "compare value"), and fires appropriate [[#Outputs|output]](s).
 
{{base point|logic_compare}} It examines the relationship between two numbers ("value" and "compare value"), and fires appropriate [[#Outputs|output]](s).


The equation is (''value'' - ''compare value'').
The equation is (''value'' - ''compare value'').

Revision as of 17:30, 30 July 2011

Template:Base point It examines the relationship between two numbers ("value" and "compare value"), and fires appropriate output(s).

The equation is (value - compare value).

Keyvalues

Initial value ([todo internal name (i)]) <integer>
Initial value for the input value.
Compare value ([todo internal name (i)]) <integer>
The value to compare 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

SetValue <floatRedirectInput/float>
Set the value that will be compared against the compare value.
SetValueCompare <floatRedirectInput/float>
Set the value that will be compared against the compare value and performs the comparison.
SetCompareValue <floatRedirectInput/float>
Set the compare value.
Compare
Force a compare of the input value with the compare value.


Outputs

OnLessThan <floatRedirectInput/float>
Fired when the input value is less than the compare value. Sends the input value as data.
OnEqualTo <floatRedirectInput/float>
Fired when the input value is equal to the compare value. Sends the input value as data.
OnNotEqualTo <floatRedirectInput/float>
Fired when the input value is different from the compare value. Sends the input value as data.
OnGreaterThan <floatRedirectInput/float>
Fired when the input value is greater than the compare value. Sends the input value as data.