Skip to content

$support

Low-level helpers the language's own shorthand compiles to: reading fields, lists and components.

65 natives. Read-only natives only look things up; the rest change something. Parameter types use the language's names (Types).

cheats_enabled

$support.cheats_enabled() -> bool

Determines if the game has cheats enabled.

Returns bool: True if the game is set to allow cheats, false otherwise.

component_assert_type

read-only
$support.component_assert_type(value: Component, script_name: string, context: string) -> Component

Examine a component ref, and ensure it is the expected type.

ParameterTypeMeaning
valueComponentThe component ref
script_namestringThe script name.
contextstringOptional context for assert message.

Returns Component: The value, or null.

component_get_const_by_field_ptr

read-only
$support.component_get_const_by_field_ptr(component: Component, member_name: string, field_ptr: int) -> var

Gets the value of a constant field.

ParameterTypeMeaning
componentComponentThe component to get the value from.
member_namestringThe name of the member (for debug purposes).
field_ptrintThe field_ptr_t value.

Returns var: The value

component_get_mutable_by_field_ptr

read-only
$support.component_get_mutable_by_field_ptr(component: Component, member_name: string, field_ptr: int, is_ptr: bool, is_controlled: bool) -> var

Gets the value of a mutable field.

ParameterTypeMeaning
componentComponentThe component to get the value from.
member_namestringThe name of the member (for debug purposes).
field_ptrintThe field_ptr_t value.
is_ptrboolTrue for a vvm_field_ptr_t.
is_controlledboolTrue if the component is known to be controlled. False otherwise.

Returns var: The value

component_set_mutable_by_field_ptr

$support.component_set_mutable_by_field_ptr(component: Component, member_name: string, field_ptr: int, value: var, is_controlled: bool)

Gets the value of a constant field.

ParameterTypeMeaning
componentComponentThe component to set the value on.
member_namestringThe name of the member (for debug purposes).
field_ptrintThe field_ptr_t value.
valuevarThe value to assign.
is_controlledboolTrue if the component is known to be controlled, false otherwise.

component_set_mutable_vector_component_by_field_ptr

$support.component_set_mutable_vector_component_by_field_ptr(component: Component, member_name: string, field_ptr: int, component_index: int, value: float, assignment_type: int, is_controlled: bool)

Gets the value of a constant field.

ParameterTypeMeaning
componentComponentThe component that has the vector component.
member_namestringThe name of the member (for debug purposes).
field_ptrintThe field_ptr_t value.
component_indexintThe index of the component to set
valuefloatThe value to assign.
assignment_typeintThe type of vscript_ast_bin_op_t assignment to perform.
is_controlledboolTrue if the component is known to be controlled, false otherwise.

controlled_member_set

$support.controlled_member_set(object: Component, field: string, field_hash: int, value: var, is_const: bool)

Set a controlled component field on another object.

ParameterTypeMeaning
objectComponentComponent with field to set
fieldstringField name
field_hashintField name hash
valuevarValue to assign to the member field
is_constboolTrue if the assignment should be checked for const-correctness, false otherwise.

controlled_mutable_set

$support.controlled_mutable_set(value: Component, field_ptr: int)

Set a controlled component mutable.

ParameterTypeMeaning
valueComponentThe component to set
field_ptrintThe int value of a vvm_field_ptr_t of the field to set.

exit

$support.exit(status: int)

Quit the application.

ParameterTypeMeaning
statusintThe exit code.

exit_app

$support.exit_app()

Close the application that called this function; won't close other open apps.

get_base_name

read-only
$support.get_base_name() -> string

Returns the base name (qagame, etc).

Returns string: The base name string for the current game.

get_content_update_version

read-only
$support.get_content_update_version() -> string

Returns the "u3"-style version of the latest content update.

Returns string: The version of the latest applied content update.

get_cpu_name

read-only
$support.get_cpu_name() -> string

Get vendor's name for the CPU.

Returns string: CPU name.

get_gpu_driver_version

read-only
$support.get_gpu_driver_version() -> int

Get the GPU driver's version number.

Returns int: GPU driver version.

get_gpu_name

read-only
$support.get_gpu_name() -> string

Get vendor's name for the GPU.

Returns string: GPU name.

get_hardware_thread_count

read-only
$support.get_hardware_thread_count() -> int

Get the number of hardware threads available.

Returns int: Hardare thread count.

get_memory_budget

read-only
$support.get_memory_budget(name: string) -> list

Get the amount of memory used and allowed for the named memory budget.

ParameterTypeMeaning
namestringName of the memory budget.

Returns list: List of two elements; memory used in kilobytes and memory budget in kilobytes.

get_monitor_height

read-only
$support.get_monitor_height() -> int

Get the vertical resolution of the monitor where the application is running.

Returns int: Monitor resolution height.

get_monitor_width

read-only
$support.get_monitor_width() -> int

Get the horizontal resolution of the monitor where the application is running.

Returns int: Monitor resolution width.

get_os_version

read-only
$support.get_os_version() -> int

Get the operating system version.

Returns int: Operation system version.

get_platform_family

read-only
$support.get_platform_family() -> int

Returns the platform family for the local user.

Returns int: The famliy type of the current platform.

get_platform_generation

read-only
$support.get_platform_generation() -> int

Returns the platform generation for the local user.

Returns int: The generation.

get_platform_kind

read-only
$support.get_platform_kind() -> int

Returns the platform kind for the local user.

Returns int: The platform kind of the current platform.

get_platform_kind_string

read-only
$support.get_platform_kind_string() -> string

Returns the platform kind string for the local user.

Returns string: The platform kind string for the current platform.

get_ram_megabytes

read-only
$support.get_ram_megabytes() -> int

Get the amount of RAM accessible by the CPU in megabytes.

Returns int: Megabytes of RAM.

get_release_version

read-only
$support.get_release_version() -> string

Returns the season.patch.hotfix-style version of the game.

Returns string: The version of the game.

get_sie_region_string

read-only
$support.get_sie_region_string() -> string

Returns the SIE region for the app. Only available on ps4 for now.

Returns string: The SIE region for the app. It will return SIEA or SIEE on ps4, NONE on other platforms.

get_speaker_count

read-only
$support.get_speaker_count() -> int

Get the number of audio speakers connected.

Returns int: Speaker count.

get_system_safe_zone

read-only
$support.get_system_safe_zone() -> float

Get the system setting for the safe zone (not supported on all platforms).

Returns float: A number between 0 and 1 representing the safe zone of the screen. Will be 1.0 on unsupported platforms.

get_system_safe_zone_margins

read-only
$support.get_system_safe_zone_margins() -> vec4

Get the system padding margins for the safe zone (not supported on all platforms).

Returns vec4: A vector containing safe zone margins with x: top, y: bottom, z: left, w: right. The vector components will be 0 on unsupported platforms.

get_thread_arg_list

read-only
$support.get_thread_arg_list() -> list

Gets the special thread-arg list.

Returns list: Threads arg list.

get_version

read-only
$support.get_version(version_kind: int) -> int

Returns the version of the game or backend.

ParameterTypeMeaning
version_kindintThe kind of the version desired. k_vapp_version_kind_changelist for game version, k_vapp_version_kind_network for backend version.

Returns int: The version of the game or backend.

get_vram_megabytes

read-only
$support.get_vram_megabytes() -> int

Get the amount of dedicated video memory accessible by the GPU in megabytes.

Returns int: Video memory in megabytes.

is_headless

read-only
$support.is_headless() -> bool

Determines if the game is running headless.

Returns bool: True if the game is running headless, false otherwise.

is_net_fs

read-only
$support.is_net_fs() -> bool

Returns true if the game is using a network file system, false otherwise

Returns bool: True if using a network file system, false otherwise

is_operation_mode_handheld

read-only
$support.is_operation_mode_handheld() -> bool

True if the current operation mode is handheld.

Returns bool: True if handheld operation mode.

is_origin_igo_enabled

read-only
$support.is_origin_igo_enabled() -> bool

Query whether the Origin IGO is enabled. Note: This can be an expensive check. Call infrequently.

Returns bool: True if Origin IGO is enabled.

is_platform_pc

read-only
$support.is_platform_pc() -> bool

Returns if the platform for the local user is win64, osx, or linux.

Returns bool: If the current platform is pc.

is_platform_steam_deck

read-only
$support.is_platform_steam_deck() -> bool

Returns if the platform is Steam Deck.

Returns bool: If the current platform is Steam Deck.

is_ref_of_type

read-only
$support.is_ref_of_type(ref: Reference, type: string) -> bool

True if the ref type matches the type parameter.

ParameterTypeMeaning
refReferenceThe ref to type check.
typestringThe type to check for.

Returns bool: True if the ref is a matches the type parameter.

is_release

read-only
$support.is_release() -> bool

Determines if the game is a release build.

Returns bool: True if the game is a release build, false otherwise.

is_standalone

$support.is_standalone() -> bool

Determines if the game is running as a standalone, the editor isn't active.

Returns bool: True if the game is running standalone, false otherwise.

is_zip_archive

$support.is_zip_archive() -> bool

Determines if the game has a zip archive attached to the executable.

Returns bool: True if the game has a zip archive attached, false otherwise.

list_create

read-only
$support.list_create() -> list

Create a list object.

Returns list: Result

list_get

read-only
$support.list_get(list: Reference, index: var) -> var

Get the value of the index-th list element.

ParameterTypeMeaning
listReferenceThe list
indexvarThe index

Returns var: Result

list_set

$support.list_set(list: Reference, index: var, value: var, is_const: bool)

Set the value of the index-th list element.

ParameterTypeMeaning
listReferenceThe list
indexvarThe index
valuevarThe value
is_constboolTrue if we should check the assignment is allowed in const setting, false otherwise.

member_get

read-only
$support.member_get(script_type: Component, field: string, field_hash: int) -> var

Get the value of another script member.

ParameterTypeMeaning
script_typeComponentScript type
fieldstringField name
field_hashintField name hash

Returns var: Result

member_get_ptr

read-only
$support.member_get_ptr(script_type: Component, field: string, field_hash: int) -> var

Get a pointer to another script member.

ParameterTypeMeaning
script_typeComponentScript type
fieldstringField name
field_hashintField name hash

Returns var: Pointer to result

member_set

$support.member_set(script_type: Component, field: string, field_hash: int, value: var, is_const: bool, skip_read: bool)

Set the value of another script member.

ParameterTypeMeaning
script_typeComponentScript type
fieldstringField name
field_hashintField name hash
valuevarValue to assign to the member field
is_constboolTrue if the assignment should be checked for const-correctness, false otherwise.
skip_readboolTrue if the assignment should skip reading back the value for caching/comparison. Might avoid a sync to the component when true but might also introduce extra write actions.

negate

read-only
$support.negate(a: var) -> var

negation operator

ParameterTypeMeaning
avarArgument to negate

Returns var: Result

requires_security_input

$support.requires_security_input() -> bool

Determines if the game needs a specific input combo to boot. For NCL security after more people working from home.

Returns bool: True if the game shouldn't boot without input code, false otherwise.

set_cheats_enabled

$support.set_cheats_enabled(value: bool)

Sets if the game has cheats enabled.

ParameterTypeMeaning
valueboolTrue if cheats should be enabled.

set_cpu_boost_desired

$support.set_cpu_boost_desired(enabled: bool)

Sets if the CPU should be boosted at the expense of GPU performance (Switch only).

ParameterTypeMeaning
enabledboolTrue if CPU boost should be enabled.

set_job_worker_count

$support.set_job_worker_count(count: int)

Sets the number of active job workers.

ParameterTypeMeaning
countintSet the number of active job workers.

set_log_level

$support.set_log_level(level: int)

Sets the log reporting level. Logs below the specified level will be filtered out (error=0, warning=1, note=2).

ParameterTypeMeaning
levelintNew log level.

set_mutable_cache_update_state

$support.set_mutable_cache_update_state(value: bool)

Enable or disable writes to the mutable cache. Enabled by default. Disable mutable cache updates when writing large numbers of mutables on other components that will not be read back during the lifetime of the current thread.

ParameterTypeMeaning
valueboolTrue to enable updates.

set_platform

$support.set_platform(name: string, generation: int)

Sets the platform for the local user.

ParameterTypeMeaning
namestringName of the platform to change to. Valid values: ios, ps4, xbox_one, win64, switch
generationintGeneration of the platform. Must be 1 (low end) or 2 (high end).

set_screen_recording_state

$support.set_screen_recording_state(enabled: bool)

Sets whether screen recording is enabled/disabled. Used to block recording around sensitive screens

ParameterTypeMeaning
enabledboolTrue is screen recording should be enabled, False if not.

set_throttle_mode

$support.set_throttle_mode(mode: int)

Sets the latency throttling mode.

ParameterTypeMeaning
modeintThe new mode (0=disabled, 1=enabled).

set_window_title

$support.set_window_title(title: var, args: list)

Sets app window title

ParameterTypeMeaning
titlevarThe title with {} characters to indicate placeholders for values.
argslistList of values to insert into the title.

Compiler helpers

The engine marks these as emitted by its own compiler. Most have shorthand in this language; prefer it where the guide shows one. Some are still the only way to do something, and the cookbook uses those deliberately.

entity_get_component

read-onlycompiler helper
$support.entity_get_component(entity: Entity, script_name: string) -> Component

Used by compiler.

ParameterTypeMeaning
entityEntity(Optional) The entity to operate on. Omit to use the entity of the calling script. Warns on NULL.
script_namestringThe script name.

Returns Component: The component.

list_destroy

read-onlycompiler helper
$support.list_destroy(list: list)

Called by compiler to attempts to free a temporary list that is no longer being used.

ParameterTypeMeaning
listlistThe list to free.

list_get_length

read-onlycompiler helper
$support.list_get_length(list: list) -> int

Use list.length instead. ***

ParameterTypeMeaning
listlistThe list.

Returns int: Length

list_push_no_copy

compiler helper
$support.list_push_no_copy(list: list, value: var, is_const: bool)

Use container.push instead ***

ParameterTypeMeaning
listlistThe list.
valuevarThe value to push
is_constboolWhether or not being called in a const context.