Math counter: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (spelling fix, sad considering i cant spell 'blasphemous')
mNo edit summary
Line 8: Line 8:
* {{kv targetname}}
* {{kv targetname}}


* '''Inital Value'''
* '''startvalue'''
:<integer> The number the math_counter starts with.
: <integer> The number the math_counter starts with.


* '''Maximum Legal Value'''
* '''min'''
:<integer> The biggest number the math_counter can contain. To disable the limit set both to 0.
: <integer> Minimum legal value for the counter. If min and max are zero, no clamping is performed.


* '''Minimum Legal Value'''
* '''max'''
:<integer> The smallest number the math_counter can contain. To disable the limit set both to 0.
: <integer> Maximum legal value for the counter. If min and max are zero, no clamping is performed.


==Inputs==
==Inputs==

Revision as of 18:24, 12 August 2005

Template:Wrongtitle

Entity Description

A useful entity that can store and track a value. It can trigger on maximum or minimum values or output its value directly. It also has the ability to perform simple mathmatics functions. Just dont fall asleep counting the sheep.

Keyvalues

  • startvalue
<integer> The number the math_counter starts with.
  • min
<integer> Minimum legal value for the counter. If min and max are zero, no clamping is performed.
  • max
<integer> Maximum legal value for the counter. If min and max are zero, no clamping is performed.

Inputs

  • Kill
Removes this entity from the world.
  • KillHierarchy
Removes this entity and all its children from the world.
  • AddOutput <string>
Adds an entity I/O connection to this entity. Format: <output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire (-1 == infinite)>. Very dangerous, use with care.
  • FireUser1-4
Causes this entity's OnUser1-4 outputs to be fired. See User Inputs and Outputs.
  • Add <integer>
Adds the given value to the math_counter's value.
  • Subtract <integer>
Subtracts the given value from the math_counter's value.
  • Multiply <integer>
Multiplies the the math_counter's value by the given value.
  • Divide <integer>
Divides the the math_counter's value by the given value.
  • SetHitMax <integer>
Changes the Maximum Legal Value to the given value.
  • SetHitMin <integer>
Changes the Minimum Legal Value to the given value.
  • SetValue <integer>
Changes the math_counter's value to the given value.
  • SetValueNoFire <integer>
Changes the math_counter's value to the given value, but doesn't update the change to any other entities.

Outputs

  • OutValue
Simply sends out the math_counter's value as though it were typed into the the parameter overide field. Usefull in conjunction with logic_case or func_movelinear. The change is outputed each time the value changes unless the SetValueNoFire is used.
  • OnHitMax
When the Maximum Legal Value is reach this output will be sent. In order to trigger it again you will need to alter the value first.
  • OnHitMin
When the Minimum Legal Value is reach this output will be sent. In order to trigger it again you will need to alter the value first.

See Also