Category:Gamearray manipulation: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
Fox (talk | contribs)
No edit summary
Fix grammar, mention initial state
Line 1: Line 1:
'''gamearray''' <name> <size> <flags>
'''gamearray''' <name> <size> <flags>


A gamearray is a [[Scripting|CON]] version of the [[Wikipedia:Array|array data type]] common in programming languages. In a practical sense, a gamearray works like a global [[gamevar]]s which a different value can be set for each index. Similarly, gamearrays are not reset when a map is loaded.
A gamearray is a [[Scripting|CON]] version of the [[Wikipedia:Array|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. Similarly, 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 [[gamevar]]s. Values can be set with [[setarray]] or [[setarraysequence]].
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 [[gamevar]]s. 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]].
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]].

Revision as of 09:50, 8 July 2020

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. Similarly, 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

Exposed Value Label Description
Internal 8 GAMEARRAY_RESET
Yes 16 GAMEARRAY_RESTORE
No 32 GAMEARRAY_VARSIZE
No 256 GAMEARRAY_STRIDE2
No 512 GAMEARRAY_ALLOCATED
No 2048 GAMEARRAY_SYSTEM
Internal 4096 GAMEARRAY_READONLY
Yes 16384 GAMEARRAY_INT16 Values range from -32768 to 32767
Yes 32768 GAMEARRAY_INT8 Values range from -128 to 127
No 65536 GAMEARRAY_UNSIGNED
Yes 16384 + 65536 GAMEARRAY_UINT16 Values range from 0 to 65536
Yes 32768 + 65536 GAMEARRAY_UINT8 Values range from 0 to 255
Yes 1048576 GAMEARRAY_BOOLEAN Values are 0 or 1.
Internal 2097152 GAMEARRAY_WARN

Pages in category "Gamearray manipulation"

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