cheats_enabled
$support.cheats_enabled() -> boolDetermines if the game has cheats enabled.
Returns bool: True if the game is set to allow cheats, false otherwise.
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).
$support.cheats_enabled() -> boolDetermines if the game has cheats enabled.
Returns bool: True if the game is set to allow cheats, false otherwise.
$support.component_assert_type(value: Component, script_name: string, context: string) -> ComponentExamine a component ref, and ensure it is the expected type.
| Parameter | Type | Meaning |
|---|---|---|
value | Component | The component ref |
script_name | string | The script name. |
context | string | Optional context for assert message. |
Returns Component: The value, or null.
$support.component_get_const_by_field_ptr(component: Component, member_name: string, field_ptr: int) -> varGets the value of a constant field.
| Parameter | Type | Meaning |
|---|---|---|
component | Component | The component to get the value from. |
member_name | string | The name of the member (for debug purposes). |
field_ptr | int | The field_ptr_t value. |
Returns var: The value
$support.component_get_mutable_by_field_ptr(component: Component, member_name: string, field_ptr: int, is_ptr: bool, is_controlled: bool) -> varGets the value of a mutable field.
| Parameter | Type | Meaning |
|---|---|---|
component | Component | The component to get the value from. |
member_name | string | The name of the member (for debug purposes). |
field_ptr | int | The field_ptr_t value. |
is_ptr | bool | True for a vvm_field_ptr_t. |
is_controlled | bool | True if the component is known to be controlled. False otherwise. |
Returns var: The value
$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.
| Parameter | Type | Meaning |
|---|---|---|
component | Component | The component to set the value on. |
member_name | string | The name of the member (for debug purposes). |
field_ptr | int | The field_ptr_t value. |
value | var | The value to assign. |
is_controlled | bool | True if the component is known to be controlled, false otherwise. |
$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.
| Parameter | Type | Meaning |
|---|---|---|
component | Component | The component that has the vector component. |
member_name | string | The name of the member (for debug purposes). |
field_ptr | int | The field_ptr_t value. |
component_index | int | The index of the component to set |
value | float | The value to assign. |
assignment_type | int | The type of vscript_ast_bin_op_t assignment to perform. |
is_controlled | bool | True if the component is known to be controlled, false otherwise. |
$support.controlled_member_set(object: Component, field: string, field_hash: int, value: var, is_const: bool)Set a controlled component field on another object.
| Parameter | Type | Meaning |
|---|---|---|
object | Component | Component with field to set |
field | string | Field name |
field_hash | int | Field name hash |
value | var | Value to assign to the member field |
is_const | bool | True if the assignment should be checked for const-correctness, false otherwise. |
$support.controlled_mutable_set(value: Component, field_ptr: int)Set a controlled component mutable.
| Parameter | Type | Meaning |
|---|---|---|
value | Component | The component to set |
field_ptr | int | The int value of a vvm_field_ptr_t of the field to set. |
$support.exit(status: int)Quit the application.
| Parameter | Type | Meaning |
|---|---|---|
status | int | The exit code. |
$support.exit_app()Close the application that called this function; won't close other open apps.
$support.get_base_name() -> stringReturns the base name (qagame, etc).
Returns string: The base name string for the current game.
$support.get_content_update_version() -> stringReturns the "u3"-style version of the latest content update.
Returns string: The version of the latest applied content update.
$support.get_cpu_name() -> stringGet vendor's name for the CPU.
Returns string: CPU name.
$support.get_gpu_driver_version() -> intGet the GPU driver's version number.
Returns int: GPU driver version.
$support.get_gpu_name() -> stringGet vendor's name for the GPU.
Returns string: GPU name.
$support.get_hardware_thread_count() -> intGet the number of hardware threads available.
Returns int: Hardare thread count.
$support.get_memory_budget(name: string) -> listGet the amount of memory used and allowed for the named memory budget.
| Parameter | Type | Meaning |
|---|---|---|
name | string | Name of the memory budget. |
Returns list: List of two elements; memory used in kilobytes and memory budget in kilobytes.
$support.get_monitor_height() -> intGet the vertical resolution of the monitor where the application is running.
Returns int: Monitor resolution height.
$support.get_monitor_width() -> intGet the horizontal resolution of the monitor where the application is running.
Returns int: Monitor resolution width.
$support.get_os_version() -> intGet the operating system version.
Returns int: Operation system version.
$support.get_platform_family() -> intReturns the platform family for the local user.
Returns int: The famliy type of the current platform.
$support.get_platform_generation() -> intReturns the platform generation for the local user.
Returns int: The generation.
$support.get_platform_kind() -> intReturns the platform kind for the local user.
Returns int: The platform kind of the current platform.
$support.get_platform_kind_string() -> stringReturns the platform kind string for the local user.
Returns string: The platform kind string for the current platform.
$support.get_ram_megabytes() -> intGet the amount of RAM accessible by the CPU in megabytes.
Returns int: Megabytes of RAM.
$support.get_release_version() -> stringReturns the season.patch.hotfix-style version of the game.
Returns string: The version of the game.
$support.get_sie_region_string() -> stringReturns 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.
$support.get_speaker_count() -> intGet the number of audio speakers connected.
Returns int: Speaker count.
$support.get_system_safe_zone() -> floatGet 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.
$support.get_system_safe_zone_margins() -> vec4Get 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.
$support.get_thread_arg_list() -> listGets the special thread-arg list.
Returns list: Threads arg list.
$support.get_version(version_kind: int) -> intReturns the version of the game or backend.
| Parameter | Type | Meaning |
|---|---|---|
version_kind | int | The 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.
$support.get_vram_megabytes() -> intGet the amount of dedicated video memory accessible by the GPU in megabytes.
Returns int: Video memory in megabytes.
$support.is_headless() -> boolDetermines if the game is running headless.
Returns bool: True if the game is running headless, false otherwise.
$support.is_net_fs() -> boolReturns true if the game is using a network file system, false otherwise
Returns bool: True if using a network file system, false otherwise
$support.is_operation_mode_handheld() -> boolTrue if the current operation mode is handheld.
Returns bool: True if handheld operation mode.
$support.is_origin_igo_enabled() -> boolQuery whether the Origin IGO is enabled. Note: This can be an expensive check. Call infrequently.
Returns bool: True if Origin IGO is enabled.
$support.is_platform_pc() -> boolReturns if the platform for the local user is win64, osx, or linux.
Returns bool: If the current platform is pc.
$support.is_platform_steam_deck() -> boolReturns if the platform is Steam Deck.
Returns bool: If the current platform is Steam Deck.
$support.is_ref_of_type(ref: Reference, type: string) -> boolTrue if the ref type matches the type parameter.
| Parameter | Type | Meaning |
|---|---|---|
ref | Reference | The ref to type check. |
type | string | The type to check for. |
Returns bool: True if the ref is a matches the type parameter.
$support.is_release() -> boolDetermines if the game is a release build.
Returns bool: True if the game is a release build, false otherwise.
$support.is_standalone() -> boolDetermines if the game is running as a standalone, the editor isn't active.
Returns bool: True if the game is running standalone, false otherwise.
$support.is_zip_archive() -> boolDetermines if the game has a zip archive attached to the executable.
Returns bool: True if the game has a zip archive attached, false otherwise.
$support.list_create() -> listCreate a list object.
Returns list: Result
$support.list_get(list: Reference, index: var) -> varGet the value of the index-th list element.
| Parameter | Type | Meaning |
|---|---|---|
list | Reference | The list |
index | var | The index |
Returns var: Result
$support.list_set(list: Reference, index: var, value: var, is_const: bool)Set the value of the index-th list element.
| Parameter | Type | Meaning |
|---|---|---|
list | Reference | The list |
index | var | The index |
value | var | The value |
is_const | bool | True if we should check the assignment is allowed in const setting, false otherwise. |
$support.member_get(script_type: Component, field: string, field_hash: int) -> varGet the value of another script member.
| Parameter | Type | Meaning |
|---|---|---|
script_type | Component | Script type |
field | string | Field name |
field_hash | int | Field name hash |
Returns var: Result
$support.member_get_ptr(script_type: Component, field: string, field_hash: int) -> varGet a pointer to another script member.
| Parameter | Type | Meaning |
|---|---|---|
script_type | Component | Script type |
field | string | Field name |
field_hash | int | Field name hash |
Returns var: Pointer to result
$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.
| Parameter | Type | Meaning |
|---|---|---|
script_type | Component | Script type |
field | string | Field name |
field_hash | int | Field name hash |
value | var | Value to assign to the member field |
is_const | bool | True if the assignment should be checked for const-correctness, false otherwise. |
skip_read | bool | True 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. |
$support.missing_external()Fail-safe fallback function
$support.negate(a: var) -> varnegation operator
| Parameter | Type | Meaning |
|---|---|---|
a | var | Argument to negate |
Returns var: Result
$support.requires_security_input() -> boolDetermines 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.
$support.set_cheats_enabled(value: bool)Sets if the game has cheats enabled.
| Parameter | Type | Meaning |
|---|---|---|
value | bool | True if cheats should be enabled. |
$support.set_cpu_boost_desired(enabled: bool)Sets if the CPU should be boosted at the expense of GPU performance (Switch only).
| Parameter | Type | Meaning |
|---|---|---|
enabled | bool | True if CPU boost should be enabled. |
$support.set_job_worker_count(count: int)Sets the number of active job workers.
| Parameter | Type | Meaning |
|---|---|---|
count | int | Set the number of active job workers. |
$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).
| Parameter | Type | Meaning |
|---|---|---|
level | int | New log level. |
$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.
| Parameter | Type | Meaning |
|---|---|---|
value | bool | True to enable updates. |
$support.set_platform(name: string, generation: int)Sets the platform for the local user.
| Parameter | Type | Meaning |
|---|---|---|
name | string | Name of the platform to change to. Valid values: ios, ps4, xbox_one, win64, switch |
generation | int | Generation of the platform. Must be 1 (low end) or 2 (high end). |
$support.set_screen_recording_state(enabled: bool)Sets whether screen recording is enabled/disabled. Used to block recording around sensitive screens
| Parameter | Type | Meaning |
|---|---|---|
enabled | bool | True is screen recording should be enabled, False if not. |
$support.set_throttle_mode(mode: int)Sets the latency throttling mode.
| Parameter | Type | Meaning |
|---|---|---|
mode | int | The new mode (0=disabled, 1=enabled). |
$support.set_window_title(title: var, args: list)Sets app window title
| Parameter | Type | Meaning |
|---|---|---|
title | var | The title with {} characters to indicate placeholders for values. |
args | list | List of values to insert into the title. |
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.
$support.entity_get_component(entity: Entity, script_name: string) -> ComponentUsed by compiler.
| Parameter | Type | Meaning |
|---|---|---|
entity | Entity | (Optional) The entity to operate on. Omit to use the entity of the calling script. Warns on NULL. |
script_name | string | The script name. |
Returns Component: The component.
$support.list_destroy(list: list)Called by compiler to attempts to free a temporary list that is no longer being used.
| Parameter | Type | Meaning |
|---|---|---|
list | list | The list to free. |
$support.list_get_length(list: list) -> intUse list.length instead. ***
| Parameter | Type | Meaning |
|---|---|---|
list | list | The list. |
Returns int: Length
$support.list_push_no_copy(list: list, value: var, is_const: bool)Use container.push instead ***
| Parameter | Type | Meaning |
|---|---|---|
list | list | The list. |
value | var | The value to push |
is_const | bool | Whether or not being called in a const context. |