Logic compare: Difference between revisions
Jump to navigation
Jump to search
Note:Some Health based entities like func_physbox. will base its percentage from
m (Changed parameters of {{this is a}} to comply with the updated version. This action was performed by a bot.) |
m (Substituted IO templates) |
||
Line 14: | Line 14: | ||
== Inputs == | == Inputs == | ||
{{ | {{I|SetValue|Set the value that will be compared against the compare value.|param=float}} | ||
{{ | {{I|SetValueCompare|Set the value that will be compared against the compare value and performs the comparison.|param=float}} | ||
{{note|Some Health based entities like {{ent|func_physbox}}. will base its percentage from<code>m_iMaxHealth</code> when using <code>OnHealthChanged</code> so any change in <code>health</code> will not be accounted for.}} | {{note|Some Health based entities like {{ent|func_physbox}}. will base its percentage from<code>m_iMaxHealth</code> when using <code>OnHealthChanged</code> so any change in <code>health</code> will not be accounted for.}} | ||
{{ | {{I|SetCompareValue|Set the compare value.|param=float}} | ||
{{ | {{I|Compare|Force a compare of the input value with the compare value.}} | ||
== Outputs == | == Outputs == | ||
{{ | {{O|OnLessThan|Fired when the input value is less than the compare value. Sends the input value as data.|param=float}} | ||
{{ | {{O|OnEqualTo|Fired when the input value is equal to the compare value. Sends the input value as data.|param=float}} | ||
{{ | {{O|OnNotEqualTo|Fired when the input value is different from the compare value. Sends the input value as data.|param=float}} | ||
{{ | {{O|OnGreaterThan|Fired when the input value is greater than the compare value. Sends the input value as data.|param=float}} | ||
[[Category:IO System]] | [[Category:IO System]] |
Revision as of 21:21, 19 April 2025

This article needs more
links to other articles to help
integrate it into the encyclopedia. Please help improve this article by adding links
that are relevant to the context within the existing text.
January 2024



January 2024
![]() |
---|
CLogicCompare |
![]() |
logic_compare
is a point entity available in all Source games. 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
ortarget
).
Also displayed in Hammer's 2D views and Entity Report.See also: Generic Keyvalues, Inputs and Outputs available to all entities
Inputs
- 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.

m_iMaxHealth
when using OnHealthChanged
so any change in health
will not be accounted for.- SetCompareValue <float >
- Set the compare value.
- Compare
- Force a compare of the input value with the compare value.
Outputs
- OnLessThan <float >
- Fired when the input value is less than the compare value. Sends the input value as data.
- OnEqualTo <float >
- Fired when the input value is equal to 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.
- OnGreaterThan <float >
- Fired when the input value is greater than the compare value. Sends the input value as data.