Logic multicompare: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
(-added class hierarchy, cleanup)
Line 1: Line 1:
[[File:logic_multicompare.png|left|link=]]
{{CD|CLogicCompareInteger|file1=logicentities.cpp}}
{{base point|logic_multicompare}}  
{{base point|logic_multicompare}}  


==Entity description==
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]].
[[File:logic_multicompare.png|left|link=]]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]].


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|Integer Value (optional)|intn=IntegerValue|integer|Initial integer value.}}
{{KV|Should use Integer Value|boolean|If set, compare inputs against Integer Value.}}
{{KV|Should use Integer Value|intn=ShouldComparetoValue|boolean|If set, compare inputs against Integer Value.}}
{{KV Targetname}}
{{KV Targetname}}


Line 14: Line 15:
{{IO|InputValue|Input value|param=integer}}
{{IO|InputValue|Input value|param=integer}}
{{IO|CompareValues|Compares the values and fires appropriate outputs}}
{{IO|CompareValues|Compares the values and fires appropriate outputs}}
{{I Targetname}}


== Outputs ==
== Outputs ==
{{IO|OnEqual|Fires if the values are equal {{activator|activator}}}}
{{IO|OnEqual|Fires if the values are equal {{activator|activator}}}}
{{IO|OnNotEqual|Fires if the values are not equal {{activator|activator}}}}
{{IO|OnNotEqual|Fires if the values are not equal {{activator|activator}}}}
{{O Targetname}}


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

Revision as of 16:00, 6 November 2022

Logic multicompare.png
C++ Class hierarchy
CLogicCompareInteger
CLogicalEntity
CServerOnlyEntity
CBaseEntity
C++ logicentities.cpp

Template:Base point

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

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

Integer Value (optional) (IntegerValue) <integer>
Initial integer value.
Should use Integer Value (ShouldComparetoValue) <boolean>
If set, compare inputs against Integer Value.
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

InputValue <integerRedirectInput/integer>
Input value
CompareValues
Compares the values and fires appropriate outputs

Outputs

OnEqual
Fires if the values are equal (!activator is the activator)
OnNotEqual
Fires if the values are not equal (!activator is the activator)