For the complete documentation index, see llms.txt. This page is also available as Markdown.

Core built-ins

This reference follows the existing GPC guide style: description, syntax, parameters, returns, and example. Deprecated but still recognized compatibility aliases are included and clearly marked.

The remaining built-ins are organized by topic in the additional built-in reference. Combo controls and commands have their own combo reference.

For exact counts and what falls outside the scope of this guide, see Scope and limits.

Controller input and transformation

Function
Purpose

turn_off

Turns off the wireless controller connected to the Zen input port.

get_battery

Returns the connected wireless controller battery state: 0 discharged, 10 fully charged, and 11 charging.

get_controller

Returns the protocol/type of the controller connected on the input side.

get_val

Returns an identifier’s current value after any earlier modifications in the current VM cycle.

get_ival

Returns the raw input value received from the controller before script modification.

get_keyboard

Reports whether the specified keyboard usage/key is currently held.

get_modifiers

Returns the requested modifier-mask bits that are currently held.

get_lval

Returns the identifier's final outgoing value from the previous main iteration.

get_ptime

Returns milliseconds since the identifier last changed between false and true states.

get_brtime

Returns milliseconds since the identifier was last released; useful for double-press timing.

event_press

Returns true for the iteration in which an identifier changes from false to true.

event_release

Returns true for the iteration in which an identifier changes from true to false.

swap

Swaps the current values of two controller identifiers for the outgoing report.

block

Prevents the specified identifier from being forwarded for a duration in milliseconds.

sensitivity

Scales an identifier around a midpoint. Live uses the three-argument form; 100 percent leaves sensitivity unchanged.

deadzone

Pushes a stick's smallest nonzero input outward past an inner deadzone, or applies a circular deadzone with DZ_CIRCLE.

stickize

Changes the outer stick shape/radius; 141 maps a circular range toward a square output area.

ps4_touchpad

Reads DS4 touch presence or coordinates selected by a PS4T_* constant.

ps4_set_touchpad

Produces a DS4 touch point at a normalized X/Y position.

turn_off

Compiler category: Controller I/O Functions Backing opcode: toff

Turns off the wireless controller connected to the Zen input port.

Syntax

Parameters

None.

Returns

Nothing.

Example


get_battery

Compiler category: Controller I/O Functions Backing opcode: gbat

Returns the connected wireless controller battery state: 0 discharged, 10 fully charged, and 11 charging.

Syntax

Parameters

None.

Returns

Integer 0..11.

Example


get_controller

Compiler category: Controller I/O Functions Backing opcode: gcont

Returns the protocol/type of the controller connected on the input side.

Syntax

Parameters

None.

Returns

A PIO_* controller protocol value.

Example


get_val

Compiler category: Controller I/O Functions Backing opcode: gval

Returns an identifier’s current value after any earlier modifications in the current VM cycle.

Syntax

Parameters

Parameter
Accepted value

identifier

BUTTON_MIN..BUTTON_MAX_EXTENDED.

Returns

Current identifier value, normally -100..100.

Example


get_ival

Compiler category: Controller I/O Functions Backing opcode: gival

Returns the raw input value received from the controller before script modification.

Syntax

Parameters

Parameter
Accepted value

identifier

BUTTON_MIN..BUTTON_MAX_EXTENDED.

Returns

Raw identifier value, normally -100..100.

Example


get_keyboard

Compiler category: Controller I/O Functions Backing opcode: gkeyb

Reports whether the specified keyboard usage/key is currently held.

Syntax

Parameters

Parameter
Accepted value

identifier

A keyboard usage constant/value in 4..251.

Returns

TRUE or FALSE.

Example


get_modifiers

Compiler category: Controller I/O Functions Backing opcode: gkeymod

Returns the requested modifier-mask bits that are currently held.

Syntax

Parameters

Parameter
Accepted value

identifier

Bitwise-OR mask of MOD_* constants (1..255).

Returns

Mask of requested MOD_* bits currently held.

Example


get_lval

Compiler category: Controller I/O Functions Backing opcode: glval

Returns the identifier's final outgoing value from the previous main iteration. This is the previous cycle's output after script processing, not the previous physical input.

Syntax

Parameters

Parameter
Accepted value

identifier

BUTTON_MIN..BUTTON_MAX.

Returns

Previous-cycle identifier value.

Example


get_ptime

Compiler category: Controller I/O Functions Backing opcode: gptime

Returns milliseconds since the identifier last changed between false and true states.

Syntax

Parameters

Parameter
Accepted value

identifier

BUTTON_MIN..BUTTON_MAX.

Returns

Elapsed milliseconds.

Example


get_brtime

Compiler category: Controller I/O Functions Backing opcode: gbrtime

Returns milliseconds since the identifier was last released; useful for double-press timing.

Syntax

Parameters

Parameter
Accepted value

identifier

BUTTON_MIN..BUTTON_MAX.

Returns

Elapsed milliseconds since release.

Example

event_press

Compiler category: Controller I/O Functions Backing opcode: epress

Returns true for the iteration in which an identifier changes from false to true.

Syntax

Parameters

Parameter
Accepted value

identifier

BUTTON_MIN..BUTTON_MAX.

Returns

TRUE on the press edge, otherwise FALSE.

Example


event_release

Compiler category: Controller I/O Functions Backing opcode: erelease

Returns true for the iteration in which an identifier changes from true to false.

Syntax

Parameters

Parameter
Accepted value

identifier

BUTTON_MIN..BUTTON_MAX.

Returns

TRUE on the release edge, otherwise FALSE.

Example

swap

Compiler category: Controller I/O Functions Backing opcode: swap

Swaps the current values of two controller identifiers for the outgoing report.

Syntax

Parameters

Parameter
Accepted value

identifier1

BUTTON_MIN..BUTTON_MAX.

identifier2

BUTTON_MIN..BUTTON_MAX.

Returns

Nothing.

Example


block

Compiler category: Controller I/O Functions Backing opcode: block

Prevents the specified identifier from being forwarded for a duration in milliseconds.

Syntax

Parameters

Parameter
Accepted value

identifier

BUTTON_MIN..BUTTON_MAX.

milliseconds

1..TIME_MAX.

Returns

Nothing.

Example


sensitivity

Compiler category: Controller I/O Functions Backing opcode: sens

Scales an identifier around a midpoint. Live uses the three-argument form; 100 percent leaves sensitivity unchanged.

Syntax

Parameters

Parameter
Accepted value

identifier

BUTTON_MIN..BUTTON_MAX.

midpoint

0..100; outside the recommended range may warn.

sensitivity

0..327; outside the recommended range may warn.

Returns

Nothing.

Example

Compiler note: Function 'sensitivity' no longer accepts 6 parameters. Deadzone adjustment and cutoff values are ignored. Remove the last 3 arguments.


deadzone

Compiler category: Controller I/O Functions Backing opcode: dz

Pushes the smallest nonzero stick input outward past the configured inner deadzone. In axis mode, deadzone_x and deadzone_y set the minimum output distance on each axis. With DZ_CIRCLE, deadzone_y is the minimum radial distance. This changes where motion begins; it does not merely discard values below a cutoff.

Syntax

Parameters

Parameter
Accepted value

identifier_x

BUTTON_MIN..BUTTON_MAX.

identifier_y

BUTTON_MIN..BUTTON_MAX.

deadzone_x

-100..101, or DZ_CIRCLE to select circular mode; outside the recommended range may warn.

deadzone_y

-100..100; this is the radius when deadzone_x is DZ_CIRCLE.

Returns

Nothing.

Example


stickize

Compiler category: Controller I/O Functions Backing opcode: stickize

Changes the outer stick shape/radius; 141 maps a circular range toward a square output area.

Syntax

Parameters

Parameter
Accepted value

identifier_x

PS4_LX, PS4_LY, PS4_RX, PS4_RY, POLAR_RX, POLAR_RY, POLAR_LX, POLAR_LY, ANALOG_RX, ANALOG_RY, ANALOG_LX, ANALOG_LY, or NOT_USE.

identifier_y

Same set as identifier_x.

radius

0..141; outside the recommended range may warn.

ANALOG_GHOSTX and ANALOG_GHOSTY are not accepted, even though they sit next to the other analog axes.

Returns

Nothing.

Example


ps4_touchpad

Compiler category: Controller I/O Functions Backing opcode: p4touch

Reads DS4 touch presence or coordinates selected by a PS4T_* constant.

Syntax

Parameters

Parameter
Accepted value

PS4T_constant

One of PS4T_P1, PS4T_P1X, PS4T_P1Y, PS4T_P2, PS4T_P2X, or PS4T_P2Y.

Returns

Touch-active boolean or selected coordinate.

Example


ps4_set_touchpad

Compiler category: Controller I/O Functions Backing opcode: p4stouch

Produces a DS4 touch point at a normalized X/Y position.

Syntax

Parameters

Parameter
Accepted value

value_x

-100..100.

value_y

-100..100.

Returns

Nothing.

Example


Console output and polar I/O

Function
Purpose

get_console

Returns the output console protocol currently connected to Zen.

set_val

Overwrites an identifier’s current outgoing value for this report.

block_all_inputs

Blocks every controller output for the current main cycle.

set_polar

Writes a high-resolution stick or ghost-stick angle and radius on the 0..32767 radius scale.

set_polar2

Writes a stick or ghost-stick angle and radius on the 0..15000 radius scale.

get_polar

Reads the current modified/output polar angle or radius.

get_ipolar

Reads the raw, unmodified polar input angle or radius.

ps4_authtimeout

Returns PS4 authentication timeout status. It is retained by Live but is rarely relevant on current firmware.

output_reconnection

Requests/checks output reconnection behavior as implemented by the current Live firmware.

get_console

Compiler category: Console I/O Functions Backing opcode: gcons

Returns the output console protocol currently connected to Zen.

Syntax

Parameters

None.

Returns

A PIO_* console protocol value.

Example


set_val

Compiler category: Console I/O Functions Backing opcode: sval

Overwrites an identifier’s current outgoing value for this report.

Syntax

Parameters

Parameter
Accepted value

identifier

BUTTON_MIN..BUTTON_MAX_EXTENDED.

value

-100..100; outside the recommended range may warn.

Returns

Nothing.

Example


block_all_inputs

Compiler category: Console I/O Functions Backing opcode: blockinput

Blocks every controller output for the current main cycle.

This effectively writes 0 to every controller output. When a later set_polar() targets a physical stick in the same cycle, restore both of that stick's axes with set_val(axis, get_ival(axis)) before the polar write. See Blocking and polar output.

Syntax

Parameters

None.

Returns

Nothing.

Example


set_polar

Compiler category: Console I/O Functions Backing opcode: spolar

Writes a high-resolution stick or ghost-stick angle and radius on the 0..32767 radius scale.

After block_all_inputs(), restore both axes of the target physical stick with set_val(axis, get_ival(axis)) before this call; otherwise, nonzero physical input can override the corresponding polar axis. See Blocking and polar output.

Syntax

Parameters

Parameter
Accepted value

stick

POLAR_RS, POLAR_LS, or POLAR_GHOST.

angle

0..359.

radius

0..32767.

Returns

Nothing.

Example


set_polar2

Compiler category: Console I/O Functions Backing opcode: spolar2

Writes a stick or ghost-stick angle and radius on the 0..15000 radius scale.

Syntax

Parameters

Parameter
Accepted value

stick

POLAR_RS, POLAR_LS, or POLAR_GHOST.

angle

0..359.

radius

0..15000.

Returns

Nothing.

Example


get_polar

Compiler category: Console I/O Functions Backing opcode: gpolar

Reads the current modified/output polar angle or radius.

Syntax

Parameters

Parameter
Accepted value

stick

POLAR_RS, POLAR_LS, or POLAR_GHOST.

radius_or_angle

POLAR_RADIUS or POLAR_ANGLE.

Returns

Angle 0..359 or radius 0..32767.

Example


get_ipolar

Compiler category: Console I/O Functions Backing opcode: gipolar

Reads the raw, unmodified polar input angle or radius.

Syntax

Parameters

Parameter
Accepted value

stick

POLAR_RS, POLAR_LS, or POLAR_GHOST.

radius_or_angle

POLAR_RADIUS or POLAR_ANGLE.

Returns

Raw angle 0..359 or radius 0..32767.

Example


ps4_authtimeout

Compiler category: Console I/O Functions Backing opcode: p4auth

Returns PS4 authentication timeout status. It is retained by Live but is rarely relevant on current firmware.

Syntax

Parameters

None.

Returns

Firmware-defined authentication status integer.

Example


output_reconnection

Compiler category: Console I/O Functions Backing opcode: outrecon

Requests/checks output reconnection behavior as implemented by the current Live firmware.

Syntax

Parameters

None.

Returns

Nothing.

Example


LED and lightbar

Function
Purpose

get_ps4_lbar

Reads one color channel of the PS4 lightbar value supplied by the console.

set_ps4_lbar

Overrides the DS4 lightbar with red, green, and blue channel values.

get_led

Returns the current state of a selected controller LED.

set_led

Sets a controller LED off, on, fast blink, or slow blink.

set_ledx

Starts a finite LED blink count; a count of zero leaves the LED on.

get_ledx

Reports whether an LED sequence started by set_ledx is still active.

reset_leds

Returns LED control to the console and clears script overrides.

get_ps4_lbar

Compiler category: Leds Backing opcode: gp4lbar

Reads one color channel of the PS4 lightbar value supplied by the console.

Syntax

Parameters

Parameter
Accepted value

color_channel

0..7; use the matching PS4/DS4 lightbar-channel constant.

Returns

Selected color-channel value 0..255.

Example


set_ps4_lbar

Compiler category: Leds Backing opcode: sp4lbar

Overrides the DS4 lightbar with red, green, and blue channel values.

Syntax

Parameters

Parameter
Accepted value

red

0..255.

green

0..255.

blue

0..255.

Returns

Nothing.

Example


get_led

Compiler category: Leds Backing opcode: gled

Returns the current state of a selected controller LED.

Syntax

Parameters

Parameter
Accepted value

led_identifier

LED_ID_MIN..LED_ID_MAX.

Returns

LED state 0..3.

Example


set_led

Compiler category: Leds Backing opcode: sled

Sets a controller LED off, on, fast blink, or slow blink.

Syntax

Parameters

Parameter
Accepted value

led_identifier

LED_ID_MIN..LED_ID_MAX.

state

LED_MIN..LED_MAX.

Returns

Nothing.

Example


set_ledx

Compiler category: Leds Backing opcode: sledx

Starts a finite LED blink count; a count of zero leaves the LED on.

Syntax

Parameters

Parameter
Accepted value

led_identifier

LED_ID_MIN..LED_ID_MAX.

no_of_blinks

LEDX_MIN..LEDX_MAX.

Returns

Nothing.

Example


get_ledx

Compiler category: Leds Backing opcode: gledx

Reports whether an LED sequence started by set_ledx is still active.

Syntax

Parameters

None.

Returns

TRUE while the finite blink sequence is active.

Example


reset_leds

Compiler category: Leds Backing opcode: rleds

Returns LED control to the console and clears script overrides.

Syntax

Parameters

None.

Returns

Nothing.

Example


Rumble and haptics

Function
Purpose

get_rumble

Returns the current strength of a selected rumble/haptic actuator.

set_rumble

Overrides a selected rumble/haptic actuator with a 0..100 strength.

block_rumble

Blocks rumble signals from the console.

reset_rumble

Clears script rumble overrides and returns control to the console.

get_rumble

Compiler category: Rumble Backing opcode: grum

Returns the current strength of a selected rumble/haptic actuator.

Syntax

Parameters

Parameter
Accepted value

limit

A RUMBLE_* or supported PS5_HAPTICS_* identifier.

Returns

Strength 0..100.

Example


set_rumble

Compiler category: Rumble Backing opcode: srum

Overrides a selected rumble/haptic actuator with a 0..100 strength.

Syntax

Parameters

Parameter
Accepted value

rumble_identifier

RUMBLE_MIN..RUMBLE_MAX.

speed

Strength from 0..100 percent.

Returns

Nothing.

Example


block_rumble

Compiler category: Rumble Backing opcode: brum

Blocks rumble signals from the console.

Syntax

Parameters

None.

Returns

Nothing.

Example


reset_rumble

Compiler category: Rumble Backing opcode: rrum

Clears script rumble overrides and returns control to the console.

Syntax

Parameters

None.

Returns

Nothing.

Example


PS5 adaptive triggers

Function
Purpose

get_adt

Reads one byte field from a PS5 adaptive-trigger report.

set_adt

Writes one byte field of a PS5 adaptive-trigger report.

adt_off

Disables and resets script changes for one PS5 adaptive trigger.

adt_cmp

Compares a trigger’s raw 11-byte adaptive-trigger record with a const ps5adt record.

adt_setx

Applies an entire const ps5adt record to a trigger.

get_adt

Compiler category: Adaptive Triggers functions Backing opcode: getadt

Reads one byte field from a PS5 adaptive-trigger report.

Syntax

Parameters

Parameter
Accepted value

trigger

PS5_R2 or PS5_L2.

limit

One of the PS5_ADT_* field constants.

Returns

Selected adaptive-trigger byte 0..255.

Example


set_adt

Compiler category: Adaptive Triggers functions Backing opcode: setadt

Writes one byte field of a PS5 adaptive-trigger report.

Syntax

Parameters

Parameter
Accepted value

trigger

PS5_R2 or PS5_L2.

type

One of the PS5_ADT_* field constants.

value

0..255.

Returns

Nothing.

Example


adt_off

Compiler category: Adaptive Triggers functions Backing opcode: adtoff

Disables and resets script changes for one PS5 adaptive trigger.

Syntax

Parameters

Parameter
Accepted value

trigger

PS5_R2 or PS5_L2.

Returns

Nothing.

Example


adt_cmp

Compiler category: Adaptive Triggers functions Backing opcode: adtcmp

Compares a trigger’s raw 11-byte adaptive-trigger record with a const ps5adt record.

Syntax

Parameters

Parameter
Accepted value

trigger

PS5_R2 or PS5_L2.

addr

Address of a const ps5adt record.

Returns

TRUE if the records match, otherwise FALSE.

Example


adt_setx

Compiler category: Adaptive Triggers functions Backing opcode: adtsetx

Applies an entire const ps5adt record to a trigger.

Syntax

Parameters

Parameter
Accepted value

trigger

PS5_R2 or PS5_L2.

addr

Address of a const ps5adt record.

Returns

Nothing.

Example


Persistent variables

Function
Purpose

get_pvar

Reads a Zen SPVAR and substitutes a default when the stored value is outside the supplied range.

set_pvar

Stores a signed 32-bit value in a Zen SPVAR. Save only on an explicit change/event.

get_pvar

Compiler category: Persistent Variables Backing opcode: gpvar

Reads a slot-private Zen SPVAR and substitutes a default when the stored value is outside the supplied range.

Syntax

Parameters

Parameter
Accepted value

spvar_constant

One of SPVAR_1..SPVAR_64.

min_value

VALUE_MIN..VALUE_MAX.

max_value

VALUE_MIN..VALUE_MAX.

default_value

VALUE_MIN..VALUE_MAX.

Returns

Stored value when in range; otherwise default_value.

Example


set_pvar

Compiler category: Persistent Variables Backing opcode: spvar

Stores a signed 32-bit value in a slot-private Zen SPVAR. Save only on an explicit change/event.

Syntax

Parameters

Parameter
Accepted value

spvar_constant

One of SPVAR_1..SPVAR_64.

value

VALUE_MIN..VALUE_MAX.

Returns

Nothing.

Example


Data-section readers

Function
Purpose

dint8

Reads one signed 8-bit value from a byte offset in the data section.

duint8

Reads one unsigned 8-bit value from a byte offset in the data section.

dint16

Reads one signed 16-bit value from a byte offset in the data section.

duint16

Reads one unsigned 16-bit value from a byte offset in the Live data section.

dint32

Reads one signed 32-bit value from a byte offset in the Live data section.

dint8

Compiler category: Data Section Backing opcode: dint8

Reads one signed 8-bit value from a byte offset in the data section.

Syntax

Parameters

Parameter
Accepted value

index

Data-section byte offset; reads 1 byte.

Returns

Signed value -128..127.

Example


duint8

Compiler category: Data Section Backing opcode: duint8

Reads one unsigned 8-bit value from a byte offset in the data section.

Syntax

Parameters

Parameter
Accepted value

index

Data-section byte offset; reads 1 byte.

Returns

Unsigned value 0..255.

Example


dint16

Compiler category: Data Section Backing opcode: dint16

Reads one signed 16-bit value from a byte offset in the data section.

Syntax

Parameters

Parameter
Accepted value

index

Data-section byte offset; reads 2 bytes.

Returns

Signed value -32768..32767.

Example


duint16

Compiler category: Data Section Backing opcode: duint16

Reads one unsigned 16-bit value from a byte offset in the Live data section.

Syntax

Parameters

Parameter
Accepted value

index

Data-section byte offset; reads 2 bytes.

Returns

Unsigned value 0..65535.

Example


dint32

Compiler category: Data Section Backing opcode: dint32

Reads one signed 32-bit value from a byte offset in the Live data section.

Syntax

Parameters

Parameter
Accepted value

index

Data-section byte offset; reads 4 bytes.

Returns

Signed 32-bit value.

Example


Deprecated compatibility aliases

These names still compile on the audited Live target, so they are included for recognition and maintenance of older source. New code should use the named replacement. A deprecated call produces a compiler warning.

Function
Replacement
Diagnostic

printf

print

GPC6011

dchar

dint8

GPC9000

dbyte

duint8

GPC9000

dword

dint16

GPC9000

printf

Compiler category: Leds Backing opcode: printf

Deprecated five-argument OLED string formatter retained for Live source compatibility. New 32-bit-target code should use print.

Syntax

Parameters

Parameter
Accepted value

x

OLED X position 0..127.

y

OLED Y position 0..63.

font

OLED_FONT_SMALL..OLED_FONT_LARGE (0..2).

color

OLED_BLACK or OLED_WHITE.

stringaddr

Address of a const string entry, normally produced with addr.

Returns

Nothing.

Example

This compiles for compatibility but emits GPC6011.


dchar

Compiler category: Data Section Backing opcode: dint8

Deprecated alias for dint8; reads one signed byte from the raw data(...) section.

Syntax

Parameters

Parameter
Accepted value

index

Byte offset into the raw data section.

Returns

Signed 8-bit value -128..127, promoted to the 32-bit runtime integer.

Example

This compiles for compatibility but emits GPC9000.


dbyte

Compiler category: Data Section Backing opcode: duint8

Deprecated alias for duint8; reads one unsigned byte from the raw data(...) section.

Syntax

Parameters

Parameter
Accepted value

index

Byte offset into the raw data section.

Returns

Unsigned 8-bit value 0..255, promoted to the 32-bit runtime integer.

Example

This compiles for compatibility but emits GPC9000.


dword

Compiler category: Data Section Backing opcode: dint16

Deprecated alias for dint16; reads one signed 16-bit value from the raw data(...) section.

Syntax

Parameters

Parameter
Accepted value

index

Byte offset into the raw data section; the reader consumes two bytes.

Returns

Signed 16-bit value -32768..32767, promoted to the 32-bit runtime integer.

Example

This compiles for compatibility but emits GPC9000.


Output-order reminders

  • get_ival and get_ipolar read raw physical input.

  • get_val and get_polar can observe earlier script changes.

  • get_lval reads the final outgoing value from the previous iteration.

  • Later set_val, polar, swap, block, deadzone, sensitivity, remap, combo, or menu logic can replace earlier work.

  • Treat set_pvar, set_bvar, and save_eeprom as event-driven persistence writes, never base-level main work.

Last updated