logic_compare
< Zh
		
		
		
		Jump to navigation
		Jump to search
		
This article needs more  links to other articles to help
 links to other articles to help  integrate it into the encyclopedia. Please help improve this article by adding links
 integrate it into the encyclopedia. Please help improve this article by adding links  that are relevant to the context within the existing text.
 that are relevant to the context within the existing text.
2024年1月
 links to other articles to help
 links to other articles to help  integrate it into the encyclopedia. Please help improve this article by adding links
 integrate it into the encyclopedia. Please help improve this article by adding links  that are relevant to the context within the existing text.
 that are relevant to the context within the existing text.2024年1月
|  类层级 | 
|---|
| CLogicCompare | 
|  logicentities.cpp | 
logic_compare是一个逻辑实体,可在所有的  起源 游戏中使用。 用于比较两个数值("value"和"compare value")的关系并触发相应[[Zh/
 起源 游戏中使用。 用于比较两个数值("value"和"compare value")的关系并触发相应[[Zh/
- Outputs|输出]]。
计算公式:(value - compare value)
键值
- Name (目标名称) <target_source>[ Edit ]
- 这个名称是其他实体通过 输入/输出 或其他 关键值(如 parentname或target) 来引用该实体时使用的标识符。
 该名称也会显示在 Hammer 编辑器的 2D 视图和 实体报告 中。参见: 所有实体均可使用的 通用键值、输入与输出
- Initial value (InitialValue) <整数>
- 基准值的初始数值
- Compare value (CompareValue) <整数>
- 用于比较的对照值
输入
- SetValue <浮点型>
- 设置待比较的基准值
- SetValueCompare <浮点型>
- 设置基准值并立即执行比较
 注意:部分基于血量的实体(如func_physbox)在使用
注意:部分基于血量的实体(如func_physbox)在使用OnHealthChanged时会以m_iMaxHealth为基准计算百分比,此时health的变化不会被计入- SetCompareValue <浮点型>
- 设置对照值
- Compare
- 立即执行比较操作
输出
- OnLessThan <浮点型>
- 当基准值小于对照值时触发(参数:基准值)
- OnEqualTo <浮点型>
- 当基准值等于对照值时触发(参数:基准值)
- OnNotEqualTo <浮点型>
- 当基准值不等于对照值时触发(参数:基准值)
- OnGreaterThan <浮点型>
- 当基准值大于对照值时触发(参数:基准值)



























