Gamevar

From EDukeWiki
Revision as of 14:56, 22 December 2004 by 68.121.164.206 (talk)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

A gamevar is a game variable that can be used to store numerical data which can then be referenced between actors.

The syntax for defining a gamevar is 'gamevar <varname> <value> <flags>'

A gamevar's flags determine how it is referenced by the game. A gamevar with flags of 0 is known as a global variable. A global variable exists once in the code, and any time a global variable is set, the new value is seen by all actors. A gamevar with flags of 1 is a per-player variable. Per-player variables exist once per player in the game, with each player having their own copy of the variable. A gamevar with flags of 2 is a per-actor variable. A per-actor variable exists as many times in the code as there are sprites in the map. Each sprite has its own copy of a per-actor variable in memory.