Jump to content

Category:Gamearray manipulation

From EDukeWiki

gamearray <name> <size> <flags>

A gamearray is a CON version of the array data type common in programming languages. In a practical sense, a gamearray works like a global gamevar in which a different value can be set for each index.

Note that the values stored in gamearrays are not reset when a map is loaded.

The size parameter specifies how many values the array holds. Values in the array are accessed as <name>[<index>] with any command that reads from gamevars. Values can be set with setarray or setarraysequence. All values are initialized to 0.

WARNING: As of the May 16, 2008 snapshot, some commands may crash when used with a gamearray, so to be safe, use setvarvar to copy the value to a gamevar.

Flags

ExposedValueLabelDescription
Internal8GAMEARRAY_RESET
Yes16GAMEARRAY_RESTOREIf set, the state of the array will be written to/read from the saved mapstate when using the command savemapstate/loadmapstate.
Has no effect on savegames -- arrays will always be restored to the state they were in when the game was saved.
No32GAMEARRAY_VARSIZE
No256GAMEARRAY_STRIDE2
No512GAMEARRAY_ALLOCATED
No2048GAMEARRAY_SYSTEM
Internal4096GAMEARRAY_READONLY
Yes16384GAMEARRAY_INT16Values range from -32768 to 32767
Yes32768GAMEARRAY_INT8Values range from -128 to 127
No65536GAMEARRAY_UNSIGNED
Yes16384 + 65536GAMEARRAY_UINT16Values range from 0 to 65536
Yes32768 + 65536GAMEARRAY_UINT8Values range from 0 to 255
Yes1048576GAMEARRAY_BOOLEANValues are 0 or 1.
Internal 2097152 GAMEARRAY_WARN

Pages in category "Gamearray manipulation"

The following 12 pages are in this category, out of 12 total.