Gamevar: Difference between revisions
No edit summary |
mNo edit summary |
||
Line 4: | Line 4: | ||
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 [[actor]]s. 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 [[sprite]]s in the map. Each [[sprite]] has its own copy of a per-[[actor]] variable in memory. | 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 [[actor]]s. 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 [[sprite]]s in the map. Each [[sprite]] has its own copy of a per-[[actor]] variable in memory. | ||
{| {{prettytable}} | {| {{prettytable}} | ||
!Name!!Number!!Description!!Page where such variables should be listed | !Name!!Number!!Description!!Page where such variables should be listed | ||
|- | |||
|GAMEVAR_FLAG_GLOBAL||0||global variable|| | |||
|- | |- | ||
|GAMEVAR_FLAG_PERPLAYER||1||per-player variable|| | |GAMEVAR_FLAG_PERPLAYER||1||per-player variable|| |
Revision as of 21:48, 4 September 2005
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.
Name | Number | Description | Page where such variables should be listed |
---|---|---|---|
GAMEVAR_FLAG_GLOBAL | 0 | global variable | |
GAMEVAR_FLAG_PERPLAYER | 1 | per-player variable | |
GAMEVAR_FLAG_PERACTOR | 2 | per-actor variable | |
GAMEVAR_FLAG_USER_MASK | 3 | bitmask controling what flags can be set from con | |
GAMEVAR_FLAG_DEFAULT | 256 | allow override | |
GAMEVAR_FLAG_SECRET | 512 | don't dump... | |
GAMEVAR_FLAG_NODEFAULT | 1024 | don't add to 'default' array. | |
GAMEVAR_FLAG_SYSTEM | 2048 | cannot change mode flags...(only default value) | |
GAMEVAR_FLAG_READONLY | 4096 | values are read-only (no setvar allowed) | |
GAMEVAR_FLAG_PLONG | 8192 | plValue is a pointer to a long | Constantly updated gamevars |