Types#

Primitive Types#

name

description

int
float

Numeric types. Despite their names, these are neither integers nor floating-point numbers, but instead fixed-point numbers ranging -214748.3648 to 214748.3647.

long

Long integer type. Values range from -2147483648L to 2147483647L. Special bitwise behavior.

auto

Type will be automatically determined by the parser. Cannot be used in a ‘group declaration’, ex. <error>auto x = 5, y = 2;</error>

void

Lack of a type; used to indicate a function returns nothing.

untyped

General type; almost all types implicity cast to untyped.

bool

Boolean type; available values true, false.

char32

Character type. Same boundaries as int, mainly exists for typecasting. Used by char/string literals.

rgb

Color type, used to represent color values. See: CreateRGB. Holds a value from 0L to 0xFFFFFFL (or 0x3F3F3FL if the compatibility Quest Rule Scripts use 6-bit color (0-63) instead of 8-bit (0-255) is on). Does not implicitly cast to other primitive types.

Note

int and float are the same type to the compiler; the two names exist only for readability. This means two functions that differ only by int vs float in their parameters have the same signature, and declaring both is an error (Error S004: Function ... was already declared with that type signature).

Note

Character literals (ex. 'a') have the type char32, and string literals have the type char32[]. When several overloads of a function could accept one of these literals, the overload taking char32 / char32[] is chosen over one taking int / int[].

void foo(char32 c) { Trace(1); }
void foo(int n) { Trace(2); }
foo('c'); // prints '1.0000'
foo(16);  // prints '2.0000'

‘Constant’ types#

By adding the const modifier to a type, that type becomes “constant”. Declaring a Variable with a constant type instead declares a Constant.

Full section on constants.

Other Types#

For documentation on existing other types, see the internal class / constant documentation.

Custom Types#