Zh/Math counter: Difference between revisions
< Zh
Jump to navigation
Jump to search
Thunder4ik (talk | contribs) m (→输出: clean up, replaced: {{tip:zh-cn → {{tip (2)) |
m (Changed parameters of {{this is a}} to comply with the updated version. This action was performed by a bot.) |
||
Line 1: | Line 1: | ||
<!-- When this page is updated to {{langsp}} or {{langsp}} instead of {{lang}}, please move {{this is a}} to the base page, as it is automatically translated. -->{{lang|Math counter}}{{:User:1416006136/Signature|time=Sep 12 2021}} | <!-- When this page is updated to {{langsp}} or {{langsp}} instead of {{lang}}, please move {{this is a}} to the base page, as it is automatically translated. -->{{lang|Math counter}}{{:User:1416006136/Signature|time=Sep 12 2021}} | ||
{{toc-right}} | {{toc-right}} | ||
{{this is a|suf=:zh-cn|name=math_counter | {{this is a|point entity|suf=:zh-cn|name=math_counter|sprite=1}}它存储和操作一个数值。它可以在数值达到用户指定的最大值或最小值时触发输出,或者每次更改数值时输出它的数值。它还具有执行简单数学函数的能力。当 math_counter 被禁用时,它将变为只读,直到重新启用。 | ||
{{code class:zh-cn|CMathCounter|logicentities.cpp}} | {{code class:zh-cn|CMathCounter|logicentities.cpp}} |
Revision as of 19:52, 17 May 2024
This page was translated by DaKang233 on September 12, 2021 (UTC+8). Anyone is welcome to add new content or fix errors.

math_counter
是一个点实体 ,可在所有的 起源 游戏中使用。它存储和操作一个数值。它可以在数值达到用户指定的最大值或最小值时触发输出,或者每次更改数值时输出它的数值。它还具有执行简单数学函数的能力。当 math_counter 被禁用时,它将变为只读,直到重新启用。
待完善: This template is currently using deprecated suf or {{Lang}}-based translations. Please use the main {{Code class}} instead, which uses {{Autolang}}.
在源代码中,它由 class
CMathCounter
代表,定义于 logicentities.cpp
。
另请参阅
键值
- Initial Value (startvalue) <浮点型 >
- 计数器的起始值。
- Minimum Legal Value (min) <浮点型 >
- 计数器的最小合法(legal)值。如果最小值和最大值都 = 0,则不执行操作 (原句为“no clamping is performed”)。
- Maximum Legal Value (max) <浮点型 >
- 计数器的最大合法值。如果最小值和最大值都 = 0,则不执行操作。
- Name (目标名称) <target_source>[ Edit ]
- 这个名称是其他实体通过 输入/输出 或其他 关键值 (如
parentname
或target
) 来引用该实体时使用的标识符。
该名称也会显示在 Hammer 编辑器的 2D 视图和 实体报告 中。参见: 所有实体均可使用的 通用键值、输入与输出
EnableDisable/启动禁用:
- Start Disabled
(StartDisabled)
<布尔值 > - 保持休眠状态,直到被唤醒。(利用
Enable
输入)。
输入
- Add <浮点型 >
- 让计数器加上一个数值,并输出和的值和触发
OutValue
输出。
- Divide <浮点型 >
- 让计数器除以一个数值,并输出商的值和触发
OutValue
输出。

- Multiply <浮点型 >
- 将计数器乘以一个数值,并输出积的值和触发
OutValue
输出。
- SetValue <浮点型 >
- 将计数器的值设置为新的数值,并输出设置的值和触发
OutValue
输出。
- SetValueNoFire <浮点型 >
- 将计数器设置为新的数值而不触发任何输出。
- Subtract <浮点型 >
- 从计数器中减去一个数量,并输出差的值和触发
OutValue
输出。
- SetHitMax <浮点型 >
- 设置计数器的 OnHitMax 输出触发上限,并输出设置的值和触发
OutValue
输出。
- SetHitMin <浮点型 >
- 设置计数器的OnHitMin 输出触发下限,并输出设置的值和触发
OutValue
输出。
- GetValue
- 从一个计数器获取该计数器当前的值并触发
OnGetValue
输出。当您不希望OutValue
输出不断更新时,用于计算计数器的数量。(Used for polling the counter when you don't want constant updates from theOutValue
output.)
- SetMaxValueNoFire <浮点型 > (存在于自
以来)
- 设置计数器的最大值而不触发任何输出。
- SetMinValueNoFire <浮点型 > (存在于自
以来)
- 设置计数器的最小值而不触发任何输出。
EnableDisable/启动禁用:
- Enable
- Disable
- 启动/禁用此实体所具备的效果。同样会使实体消失。
输出
- OutValue <浮点型 >
- 当计数器的值被更改时触发。


- OnHitMin
- 当计数器的值达到或低于设置的最小值时触发。在此输出再次触发之前,计数器的数值必须高于最小值。
- OnHitMax
- 当计数器的值达到或超过设置的最大值时触发。在此输出再次触发之前,计数器的数值必须低于最大值。
- OnGetValue <浮点型 >
- 响应
GetValue
输入而触发。当您不希望OutValue
输出不断更新时,用于计算计数器的数量。(Used for polling the counter when you don't want constant updates from theOutValue
output.)


实体目标名:
- OnUser1 to OnUser4
- 这些输出将分别响应于
FireUser1
到FireUser4
输入。 详见 User Inputs and Outputs。