Moderator elections are being held. See Valve Developer Community:Moderator elections for more details.
Users who would like to run for moderator must be autoconfirmed and have at least 100 edits. Users can check their own edit count at Special:Preferences.
Users who would like to run for moderator must be autoconfirmed and have at least 100 edits. Users can check their own edit count at Special:Preferences.
logic_compare
![Underlinked - Logo.png](/w/images/9/91/Underlinked_-_Logo.png)
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
![English (en) English (en)](/w/images/thumb/3/37/Flag-en.png/16px-Flag-en.png)
![Icon-translate.png](/w/images/thumb/b/b1/Icon-translate.png/12px-Icon-translate.png)
... ![Icon-Important.png](/w/images/thumb/5/5c/Icon-Important.png/10px-Icon-Important.png)
![Icon-Important.png](/w/images/thumb/5/5c/Icon-Important.png/10px-Icon-Important.png)
![]() |
---|
CLogicCompare defined in ![]() logicentities.cpp
|
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.
Targetname:
- Name
(targetname)
<string> - The targetname that other entities refer to this entity by.
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.
![Note.png](/w/images/thumb/c/cc/Note.png/10px-Note.png)
func_physbox
. will base its percentage fromm_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.