Zh/Logic multicompare: Difference between revisions
< Zh
Jump to navigation
Jump to search
mNo edit summary |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
{{LanguageBar| | {{LanguageBar|CLogicCompareInteger|title=逻辑比较整数实体}} | ||
{{CD|CLogicCompareInteger|file1=logicentities.cpp}} | {{CD|CLogicCompareInteger|file1=logicentities.cpp}} | ||
{{this is a|逻辑实体|name=logic_multicompare|sprite=1}} | {{this is a|逻辑实体|name=logic_multicompare|sprite=1}} | ||
Line 9: | Line 9: | ||
== 键值(Keyvalues) == | == 键值(Keyvalues) == | ||
{{KV Targetname}} | {{KV Targetname}} | ||
{{KV| | {{KV|Integer Value (optional)|intn=IntegerValue|integer|初始整数值。}} | ||
{{KV| | {{KV|Should use Integer Value|intn=ShouldComparetoValue|boolean|若启用,所有输入将与初始整数值比较。}} | ||
== 输入 == | == 输入 == | ||
Line 21: | Line 21: | ||
== 相关条目 == | == 相关条目 == | ||
* {{ent|logic_compare}} | * {{ent|logic_compare}} | ||
{{ACategory|IO System}} | {{ACategory|IO System}} |
Latest revision as of 21:37, 28 June 2025
![]() |
---|
CLogicCompareInteger |
![]() |

logic_multicompare
是一个逻辑实体,可在所有的 起源 游戏中使用。
比较一组输入值。如果全部相同,触发OnEqual
输出;如果存在不同,触发OnNotEqual
输出。
该实体内部维护一个整数列表,用于存储通过InputValue
输入接收的值。所有输入值必须为整数或布尔值(若无法转换,"实体将直接丢弃该值",引自开发者源码注释)。目前无法清空该列表,因此实体不可重复使用。
键值(Keyvalues)
- Name (目标名称) <target_source>[ Edit ]
- 这个名称是其他实体通过 输入/输出 或其他 关键值 (如
parentname
或target
) 来引用该实体时使用的标识符。
该名称也会显示在 Hammer 编辑器的 2D 视图和 实体报告 中。参见: 所有实体均可使用的 通用键值、输入与输出
- Integer Value (optional) (IntegerValue) <整数 >
- 初始整数值。
- Should use Integer Value (ShouldComparetoValue) <布尔值 >
- 若启用,所有输入将与初始整数值比较。
输入
- InputValue <variant >
- 输入值
- CompareValues <variant >
- 立即比较当前值并触发对应输出
输出
- OnEqual <void>
- !activator = 触发输入的调用者
!caller = this entity
当所有值相等时触发
- OnNotEqual <void>
- !activator = 触发输入的调用者
!caller = this entity
当存在不同值时触发