Logic compare: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
m (missing internal names for KVs; {{I BaseEntity}}; {{O BaseEntity}} (only targetname is necessary, ain't anybody parenting this fellow I hope))
Line 1: Line 1:
{{base point|logic_compare}}
[[File:logic_compare.png|left]]
 
{{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'').
Line 8: Line 6:


== Keyvalues ==
== Keyvalues ==
{{KV|Initial value|integer|Initial value for the input value.}}
{{KV|Initial value|intn=InitialValue|integer|Initial value for the input value.}}
{{KV|Compare value|integer|The value to compare against.}}
{{KV|Compare value|intn=CompareValue|integer|The value to compare against.}}
{{KV Targetname}}
{{KV Targetname}}


Line 17: Line 15:
{{IO|SetCompareValue|Set the compare value.|param=float}}
{{IO|SetCompareValue|Set the compare value.|param=float}}
{{IO|Compare|Force a compare of the input value with the compare value.}}
{{IO|Compare|Force a compare of the input value with the compare value.}}
{{I Targetname}}
{{I BaseEntity}}


== Outputs ==
== Outputs ==
Line 24: Line 22:
{{IO|OnNotEqualTo|Fired when the input value is different from the compare value. Sends the input value as data.|param=float}}
{{IO|OnNotEqualTo|Fired when the input value is different from the compare value. Sends the input value as data.|param=float}}
{{IO|OnGreaterThan|Fired when the input value is greater than the compare value. Sends the input value as data.|param=float}}
{{IO|OnGreaterThan|Fired when the input value is greater than the compare value. Sends the input value as data.|param=float}}
{{O Targetname}}
{{O BaseEntity|l4d=1}}


[[Category:IO System]]
[[Category:IO System]]

Revision as of 05:33, 30 January 2022

Logic compare.png

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 (InitialValue) <integer>
Initial value for the input value.
Compare value (CompareValue) <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.