Logic compare: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(cleanup)
(Cleanup)
Line 1: Line 1:
[[File:{{PAGENAME}}.png|left|alt=|link=]]
{{base point|logic_compare}}


{{base point|logic_compare}} It examines the relationship between two numbers ("value" and "compare value"), and fires appropriate [[#Outputs|output]](s).
== Entity description ==
[[File:logic_compare.png|left|link=]]
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'').
{{clr}}


==Keyvalues==
== Keyvalues ==
 
{{KV|Initial value|integer|Initial value for the input value.}}
; <code>InitialValue <[[int]]></code>
{{KV|Compare value|integer|The value to compare against.}}
: Initial value to compare.
; <code>CompareValue <int></code>
: The value to compare against.
{{KV Targetname}}
{{KV Targetname}}


==Inputs==
== Inputs ==
 
{{IO|SetValue|Set the value that will be compared against the compare value.|param=float}}
; <code>SetValue <[[float]]></code>
{{IO|SetValueCompare|Set the value that will be compared against the compare value and performs the comparison.|param=float}}
: Set the value that will be compared.
{{IO|SetCompareValue|Set the compare value.|param=float}}
; <code>SetValueCompare <float></code>
{{IO|Compare|Force a compare of the input value with the compare value.}}
: Set the value to compare, then perform a comparison.
; <code>SetCompareValue <float></code>
: Set the value to compare against
; <code>Compare</code>
: Perform a comparison.
{{I Targetname}}
{{I Targetname}}


==Outputs==
== Outputs ==
 
{{IO|OnLessThan|Fired when the input value is less than the compare value. Sends the input value as data.|param=float}}
; <code>OnEqualTo <[[float]]></code>
{{IO|OnEqualTo|Fired when the input value is equal to the compare value. Sends the input value as data.|param=float}}
; <code>OnNotEqualTo <float></code>
{{IO|OnNotEqualTo|Fired when the input value is different from the compare value. Sends the input value as data.|param=float}}
; <code>OnGreaterThan <float></code>
{{IO|OnGreaterThan|Fired when the input value is greater than the compare value. Sends the input value as data.|param=float}}
; <code>OnLessThan <float></code>
: The appropriate output(s) are fired when the <code>Compare</code> or <code>SetValueCompare</code> input is received. Each pass the input value.
{{O Targetname}}
{{O Targetname}}

Revision as of 23:18, 8 June 2011

Template:Base point

Entity description

Logic compare.png

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.