env_counter

XashXT

env_counter

A range-aware counter that can assume special “key” states, carry a value to another counter in a chain and so on.

Options

maxframe Sets the upper bound of the counter's range. For example, in a clock that counts up to 12 hours, 59 minutes and so on.
keyframe Number of the frame where the entity switches to the ON state.
type Condition for switching to the ON state:
  • 0—equals
  • 1—is greater than or equal to
  • 2—is less than or equal to
model Path to a custom model. By default, sprites\decimal.spr is used.

Usage Details

  • Activation with the + prefix increments the counter value by 1; activation with the - prefix decrements it by 1.
  • Activation with the < prefix makes the counter's displayed value appear and disappear intermittently, which can be used for indicating the current numeric input. This does not affect the internal state of the counter in any way—the effect is purely visual.
  • Activation with a number sets the counter to that number. If the counter is part of a chain of counters, the more significant counters will also get the set command. In addition, this causes the number to be displayed if the previous activation hid it (good for a flashing effect).
  • You can reset the counter to zero using the < prefix and -1 as a parameter.
  • Activation with the > prefix resets the counter to zero. The reset affects the other counters in the chain.
  • This entity can be used for creating floor indicators in lifts, digital clocks, keypads, puzzles, arcade cabinets and so on.