math_counter
< Zh
Jump to navigation
Jump to search
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,则不执行操作。
参见: Generic Keyvalues, Inputs and Outputs available to all entities
- Name (targetname) <target_source>
- 其他实体引用该实体的目标名称。
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.)


OnChangedFromMin
(存在于自 AS 以来)- 当计数器的值从最小值更改时触发。
OnChangedFromMax
(存在于自 AS 以来)- 当计数器的值从最大值更改时触发。
实体目标名:
OnUser1
到OnUser4
- 这些输出将分别响应于
FireUser1
到FireUser4
输入。 详见 User Inputs and Outputs。