Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Type metadata

Types and variables can have a metadata attached to them. This metadata is used to determine how the type is displayed in the GUI and read by the Lua API.

For types, the format is type {type_name} {size} [[{metadata}]].

For variables, the format is {type_name} {variable_name} [[{metadata}]].

Example:

type int 4 [[i32]] // i32 metadata, will be displayed as a signed 32-bit integer in the GUI
type float 4 [[f32]] // f32 metadata, will be displayed as a 32-bit float in the GUI
type char 1 // no metadata

struct Foo {
    // will be displayed as a signed 32-bit integer in the GUI, implicit metadata
    int a;
    // utf8* metadata, will be displayed as a utf8 string in the GUI
    // must be explicitly specified, as the type is a pointer to 1 byte
    char* b [[utf8*]]
    // f32 metadata, will be displayed as a 32-bit float in the GUI
    float c
    // metadata does not need to be specified for this pointer
    int* d
};

Valid metadata tokens

The following metadata tokens are recognized by the overlay system for reading and writing values:

TokenDescription
boolBoolean (1 byte, nonzero = true)
u8Unsigned 8-bit integer
u16Unsigned 16-bit integer
u32Unsigned 32-bit integer
u64Unsigned 64-bit integer
i8Signed 8-bit integer
i16Signed 16-bit integer
i32Signed 32-bit integer
i64Signed 64-bit integer
f3232-bit floating point
f6464-bit floating point
utf8*Null-terminated UTF-8 string (pointer or inline)