Skip to content

$debug

Print to the log and draw debug shapes to see what a script is doing.

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

add_channel_suppression

$debug.add_channel_suppression(channel: string, log_level: int)

Suppresses a channel's output.

ParameterTypeMeaning
channelstringThe name of the channel to suppress.
log_levelintThe log level (e.g. k_vlog_warning) to suppress for the specified channel. -1 or >= k_vlog_count, will result in _all_ levels being suppressed.

assert_equal

read-only
$debug.assert_equal(a: var, b: var)

Assert that two values are equivalent.

ParameterTypeMeaning
avarFirst value
bvarSecond value

assert_stack

read-only
$debug.assert_stack(depth: int)

Assert that the value stack is specific depth.

ParameterTypeMeaning
depthintThe expected stack depth

breakpoint

read-only
$debug.breakpoint()

Break into the debugger if attached.

bug_now_art_report

$debug.bug_now_art_report(filename: string, player_pos: vec3, camera_pos: vec3)

Generate a art-focused report

ParameterTypeMeaning
filenamestringAn image file name.
player_posvec3Player's position.
camera_posvec3Camera's position.

capture_and_compare_golden_image

$debug.capture_and_compare_golden_image(filename: string, threshold: float)

Capture the back buffer (next output frame) and compare it to a previously captured screen shot.

ParameterTypeMeaning
filenamestringThe image file name to compare against.
thresholdfloatAllowable pixel delta (optional).

capture_screenshot_image

$debug.capture_screenshot_image(filename: string)

Capture the back buffer (next output frame) to a file.

ParameterTypeMeaning
filenamestringAn image file name.

crash

read-only
$debug.crash(text: string)

Crash the application.

ParameterTypeMeaning
textstringOptional. The error text to display.

draw_triggers

$debug.draw_triggers(need_to_draw: bool)

Draw physics triggers.

ParameterTypeMeaning
need_to_drawboolWhether to draw

enable_debug_console_input

$debug.enable_debug_console_input(enabled: bool)

allow input to debug console

ParameterTypeMeaning
enabledboolShould input be enabled?

enable_debug_window

$debug.enable_debug_window(enabled: bool, type: int)

allow input to debug console

ParameterTypeMeaning
enabledboolShould input be enabled?
typeintDebug menu type

get_autotest_name

read-only
$debug.get_autotest_name() -> string

Get the name of the autotest.

Returns string: The name of the test.

get_controller

read-only
$debug.get_controller(component: Component) -> Component

Get the controller for a component.

ParameterTypeMeaning
componentComponentThe component to get the controler of

Returns Component: The controller component.

get_counter_name_list

$debug.get_counter_name_list() -> list

Get all counters name list

Returns list: A list of names of all counters

get_flythru_add_bots

$debug.get_flythru_add_bots() -> bool

Get whether flythrough needs to add bots in game state

Returns bool: Whether or not add bots

get_flythru_force_8x_rollback

$debug.get_flythru_force_8x_rollback() -> bool

Get whether flythrough needs to set force 8x rollback in debug console

Returns bool: Whether or not need to set force 8x rollback

get_flythru_generate_output_file

$debug.get_flythru_generate_output_file() -> bool

Get whether flythrough needs to generate output file in game state

Returns bool: Whether or not generate output file

get_flythru_record_after_moving

$debug.get_flythru_record_after_moving() -> bool

Get whether flythrough starts recording after camera moving

Returns bool: Whether or not flythrough starts recording after camera moving

get_gpu_ms

read-only
$debug.get_gpu_ms() -> float

Get the current GPU time in milliseconds.

Returns float: Time in milliseconds.

get_inactivity_timeout_disabled

read-only
$debug.get_inactivity_timeout_disabled() -> bool

Check if we should sign players out due to inactivity.

Returns bool: True if the timeout has been disabled.

get_out_frame_index

read-only
$debug.get_out_frame_index() -> int

Get the increment-only out frame index (for e.g. autotest progression)

Returns int: frame index, may be 0 for first frame or if headless

get_out_ms

read-only
$debug.get_out_ms() -> float

Get the current out time in milliseconds.

Returns float: Time in milliseconds.

get_playstation_activity

read-only
$debug.get_playstation_activity() -> string

Get command line entry for debug playstation activity

Returns string: activity name

get_resolution_scale

read-only
$debug.get_resolution_scale() -> float

Get the current dynamic resolution scale.

Returns float: Main scene resolution scale fraction (0-1).

get_sim_ms

read-only
$debug.get_sim_ms() -> float

Get the current sim time in milliseconds.

Returns float: Time in milliseconds.

get_temporary_list_count

read-only
$debug.get_temporary_list_count() -> int

Get the number of temporary lists in use.

Returns int: The number of temporary lists used.

is_autotest

read-only
$debug.is_autotest() -> bool

Determine if autotest is active.

Returns bool: True if autotest running.

is_debug_console_open

read-only
$debug.is_debug_console_open() -> bool

return true if the debug console is open

Returns bool: True if debug console is open

is_long_autotest

read-only
$debug.is_long_autotest() -> bool

Determine if an extended/nightly/clean autotest is active.

Returns bool: True if autotest running.

open_master_debug

read-only
$debug.open_master_debug() -> bool

return true if controller opened debug console

Returns bool: True if controller opened debug menus

pause

read-only
$debug.pause()

Pauses the game scrubber and opens the entity viewer.

print

read-only
$debug.print(text: var, args: list, during_rollforth: bool)

Output a message to the console.

ParameterTypeMeaning
textvarThe message with {} characters to indicate placeholders for values.
argslistList of values to insert into the message.
during_rollforthboolOutput when simulating forward without drawing.

register_visibility_class

$debug.register_visibility_class(class_name: string)

adds the specified class name to the replay tool

ParameterTypeMeaning
class_namestringThe name to display in the replay tool

remove_channel_suppression

$debug.remove_channel_suppression(channel: string, log_level: int)

Remove suppression of a channel's output.

ParameterTypeMeaning
channelstringThe name of the channel to suppress.
log_levelintThe log level (e.g. k_vlog_warning) to unsuppress for the specified channel. -1 or >= k_vlog_count, will result in _all_ levels being unsuppressed.

set_force_rollback_frame_count

$debug.set_force_rollback_frame_count(count: int)

Set the minimum number of frames to rollback each simulation loop.

ParameterTypeMeaning
countintFrame count.

set_inactivity_timeout_ms

$debug.set_inactivity_timeout_ms(timeout_ms: float)

Set the current number of ms until the inactivity timeout will occur.

ParameterTypeMeaning
timeout_msfloatThe number of ms.

write_data_pipe

$debug.write_data_pipe(name: string, keys: list, values: list, timestamp: float)

writes data to the data pipe

ParameterTypeMeaning
namestringThe name of the data object
keyslistlist of string keys
valueslistlist of values
timestampfloat(optional) timestamp to supply with data in seconds

write_memory_summary_for_vci

$debug.write_memory_summary_for_vci(package: var, add_cushion: bool)

Write a memory summary to a JSON file for VCI to process.

ParameterTypeMeaning
packagevarReference to a package file used for naming. Or string name.
add_cushionboolIf true, adds cushion amount to current memory used.