Counters |
Counters are globally accessible named variables. All counters can only contain integer values between 0 and 2,000,000,000. They are useful for things such as tracking player inventory, completion of game events, the passage of time or linking with tile animation. Note that sprite definitions can have their own parameters, so if you want to track values associated with a particular sprite, you should consider a sprite parameter instead.
A counter definition includes a maximum value to ensure that a counter can never exceed a specified bound. This also allows the value to be passed to rules without having to provide a maximum value as a separate parameter.
The counter name must be unique among all counter names in the project. Names must begin with a letter and contain only letters, digits and spaces.
Specify a folder name for the counter. The folder may be delimited by backslashes to nest the counter within multiple levels of folders. The folder will become the parent of the counter in the project tree only. It does not affect other uses of the counter.
This can be a value from 1 to 2,000,000,000. The counter will not be able to exceed the specified maximum. The maximum can be used with certain rules such as those that draw inventory items, for example, where the ratio of the current value to the maximum determines how much of an inventory bar is filled.
The initial value of the counter when the game begins is determined by this setting. The value must be between 0 and the specified maximum (inclusive).