This article's documentation is for anything that uses the Source engine. Click here for more information.

Logic multicompare: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
(CompareValues is variant but doesn't seem to use it for anything. Not sure if worth specifying)
 
(13 intermediate revisions by 9 users not shown)
Line 1: Line 1:
[[File:logic_multicompare.png|left|link=]]
{{LanguageBar}}
{{CD|CLogicCompareInteger|file1=logicentities.cpp}}
{{this is a|logical entity|name=logic_multicompare|sprite=1}}


{{base point|logic_multicompare}} Compares a set of inputs to each other. If they are all the same, fires an [[#Outputs|OnEqual output]]. If any are different, fires the [[#Outputs|OnNotEqual output]].
Compares a set of inputs to each other. If they are all the same, fires an <code>OnEqual</code>. If any are different, fires the <code>OnNotEqual</code>.


This entity has an internal list of integers that it has received from any inputValue input's. Any values sent to this entity, must be sent as an integer or boolean because "if it can't be converted" the entity will "just throw it away" (Source Code comment from dev's). Currently, there is no way to clear this 'list', so the entity is not reusable.
This entity has an internal list of integers that it has received from any inputValue input's. Any values sent to this entity, must be sent as an integer or boolean because "if it can't be converted" the entity will "just throw it away" (Source Code comment from dev's). Currently, there is no way to clear this 'list', so the entity is not reusable.


== Keyvalues ==
== Keyvalues ==
{{KV|Integer Value (optional)|integer|Initial integer value.}}
{{KV|Should use Integer Value|boolean|If set, compare inputs against Integer Value.}}
{{KV Targetname}}
{{KV Targetname}}
{{KV|Integer Value (optional)|intn=IntegerValue|integer|Initial integer value.}}
{{KV|Should use Integer Value|intn=ShouldComparetoValue|boolean|If set, compare inputs against Integer Value.}}


== Inputs ==
== Inputs ==
{{IO|InputValue|Input value|param=integer}}
{{I|InputValue|Input value|param=variant}}
{{IO|CompareValues|Compares the values and fires appropriate outputs}}
{{I|CompareValues|param=variant|Compares the values and fires appropriate outputs}}
{{I Targetname}}


== Outputs ==
== Outputs ==
{{IO|OnEqual|Fires if the values are equal {{activator|activator}}}}
{{O|OnEqual|activator = activator of input causing this|param=void|Fires if the values are equal}}
{{IO|OnNotEqual|Fires if the values are not equal {{activator|activator}}}}
{{O|OnNotEqual|activator = activator of input causing this|param=void|Fires if the values are not equal}}
{{O Targetname}}
 
== See Also ==
* {{ent|logic_compare}}
 
[[Category:IO System]]

Latest revision as of 01:59, 6 May 2025

English (en)中文 (zh)Translate (Translate)
C++ Class hierarchy
CLogicCompareInteger
CLogicalEntity
CServerOnlyEntity
CBaseEntity
C++ logicentities.cpp
Logic multicompare.png

logic_multicompare is a logical entity available in all Source Source games.

Compares a set of inputs to each other. If they are all the same, fires an OnEqual. If any are different, fires the OnNotEqual.

This entity has an internal list of integers that it has received from any inputValue input's. Any values sent to this entity, must be sent as an integer or boolean because "if it can't be converted" the entity will "just throw it away" (Source Code comment from dev's). Currently, there is no way to clear this 'list', so the entity is not reusable.

Keyvalues

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

Integer Value (optional) (IntegerValue) <integer>
Initial integer value.
Should use Integer Value (ShouldComparetoValue) <boolean>
If set, compare inputs against Integer Value.

Inputs

InputValue <variantRedirectInput/variant>
Input value
CompareValues <variantRedirectInput/variant>
Compares the values and fires appropriate outputs

Outputs

OnEqual <void>
!activator = activator of input causing this
!caller = this entity
Fires if the values are equal
OnNotEqual <void>
!activator = activator of input causing this
!caller = this entity
Fires if the values are not equal

See Also