这篇条目有关 Source引擎。如需详情,点击这里。

Zh/Logic multicompare: Difference between revisions

From Valve Developer Community
< Zh
Jump to navigation Jump to search
(Created page with "{{LanguageBar|CLogicCompareInteger|title=逻辑比较整数实体}} {{CD|CLogicCompareInteger|file1=logicentities.cpp}} {{this is a|逻辑实体|name=logic_multicompare|sprite=1}} 比较一组输入值。如果全部相同,触发<code>OnEqual</code>输出;如果存在不同,触发<code>OnNotEqual</code>输出。 该实体内部维护一个整数列表,用于存储通过<code>InputValue</code>输入接收的值。所有输入值必须为整数或布尔值(若...")
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 9: Line 9:
== 键值(Keyvalues) ==
== 键值(Keyvalues) ==
{{KV Targetname}}
{{KV Targetname}}
{{KV|初始整数值(可选)|intn=IntegerValue|integer|设置初始整数值。}}
{{KV|Integer Value (optional)|intn=IntegerValue|integer|初始整数值。}}
{{KV|是否使用初始值比较|intn=ShouldComparetoValue|boolean|若启用,所有输入将与初始整数值比较。}}
{{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

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

logic_multicompare是一个逻辑实体,可在所有的 起源 起源 游戏中使用。

比较一组输入值。如果全部相同,触发OnEqual输出;如果存在不同,触发OnNotEqual输出。

该实体内部维护一个整数列表,用于存储通过InputValue输入接收的值。所有输入值必须为整数或布尔值(若无法转换,"实体将直接丢弃该值",引自开发者源码注释)。目前无法清空该列表,因此实体不可重复使用。

键值(Keyvalues)

Name (目标名称) <target_source>[ Edit ]
这个名称是其他实体通过 输入/输出(en) 或其他 关键值(en)(如 parentnametarget) 来引用该实体时使用的标识符。
该名称也会显示在 Hammer 编辑器的 2D 视图和 实体报告(en) 中。
参见:  所有实体均可使用的 通用键值、输入与输出(en)

Integer Value (optional) (IntegerValue) <整数(en)>
初始整数值。
Should use Integer Value (ShouldComparetoValue) <布尔值(en)>
若启用,所有输入将与初始整数值比较。

输入

InputValue <variant(en)>
输入值
CompareValues <variant(en)>
立即比较当前值并触发对应输出

输出

OnEqual <void>
!activator = 触发输入的调用者
!caller = this entity
当所有值相等时触发
OnNotEqual <void>
!activator = 触发输入的调用者
!caller = this entity
当存在不同值时触发

相关条目