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).
$debug.add_channel_suppression(channel: string, log_level: int)
Suppresses a channel's output.
| Parameter | Type | Meaning |
|---|
channel | string | The name of the channel to suppress. |
log_level | int | The 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. |
$debug.assert_equal(a: var, b: var)
Assert that two values are equivalent.
| Parameter | Type | Meaning |
|---|
a | var | First value |
b | var | Second value |
$debug.assert_stack(depth: int)
Assert that the value stack is specific depth.
| Parameter | Type | Meaning |
|---|
depth | int | The expected stack depth |
Break into the debugger if attached.
$debug.bug_now_art_report(filename: string, player_pos: vec3, camera_pos: vec3)
Generate a art-focused report
| Parameter | Type | Meaning |
|---|
filename | string | An image file name. |
player_pos | vec3 | Player's position. |
camera_pos | vec3 | Camera's position. |
$debug.bug_now_log_error()
Generate a log error
$debug.bug_now_log_warning()
Generate a log warning
$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.
| Parameter | Type | Meaning |
|---|
filename | string | The image file name to compare against. |
threshold | float | Allowable pixel delta (optional). |
$debug.capture_screenshot_image(filename: string)
Capture the back buffer (next output frame) to a file.
| Parameter | Type | Meaning |
|---|
filename | string | An image file name. |
$debug.crash(text: string)
Crash the application.
| Parameter | Type | Meaning |
|---|
text | string | Optional. The error text to display. |
$debug.draw_triggers(need_to_draw: bool)
Draw physics triggers.
| Parameter | Type | Meaning |
|---|
need_to_draw | bool | Whether to draw |
$debug.dump_member_access_data()
Dump the member access information to a file.
$debug.enable_debug_console_input(enabled: bool)
allow input to debug console
| Parameter | Type | Meaning |
|---|
enabled | bool | Should input be enabled? |
$debug.enable_debug_window(enabled: bool, type: int)
allow input to debug console
| Parameter | Type | Meaning |
|---|
enabled | bool | Should input be enabled? |
type | int | Debug menu type |
$debug.get_autotest_name() -> string
Get the name of the autotest.
Returns string: The name of the test.
$debug.get_controller(component: Component) -> Component
Get the controller for a component.
| Parameter | Type | Meaning |
|---|
component | Component | The component to get the controler of |
Returns Component: The controller component.
$debug.get_counter_name_list() -> list
Get all counters name list
Returns list: A list of names of all counters
$debug.get_flythru_add_bots() -> bool
Get whether flythrough needs to add bots in game state
Returns bool: Whether or not add bots
$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
$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
$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
$debug.get_gpu_ms() -> float
Get the current GPU time in milliseconds.
Returns float: Time in milliseconds.
$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.
$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
$debug.get_out_ms() -> float
Get the current out time in milliseconds.
Returns float: Time in milliseconds.
$debug.get_playstation_activity() -> string
Get command line entry for debug playstation activity
Returns string: activity name
$debug.get_resolution_scale() -> float
Get the current dynamic resolution scale.
Returns float: Main scene resolution scale fraction (0-1).
$debug.get_sim_ms() -> float
Get the current sim time in milliseconds.
Returns float: Time in milliseconds.
$debug.get_temporary_list_count() -> int
Get the number of temporary lists in use.
Returns int: The number of temporary lists used.
$debug.is_autotest() -> bool
Determine if autotest is active.
Returns bool: True if autotest running.
$debug.is_debug_console_open() -> bool
return true if the debug console is open
Returns bool: True if debug console is open
$debug.is_long_autotest() -> bool
Determine if an extended/nightly/clean autotest is active.
Returns bool: True if autotest running.
$debug.open_master_debug() -> bool
return true if controller opened debug console
Returns bool: True if controller opened debug menus
Pauses the game scrubber and opens the entity viewer.
$debug.print(text: var, args: list, during_rollforth: bool)
Output a message to the console.
| Parameter | Type | Meaning |
|---|
text | var | The message with {} characters to indicate placeholders for values. |
args | list | List of values to insert into the message. |
during_rollforth | bool | Output when simulating forward without drawing. |
$debug.print_callstack(during_rollforth: bool)
Print the callstack.
| Parameter | Type | Meaning |
|---|
during_rollforth | bool | Output when simulating forward without drawing. |
$debug.print_error(text: var, args: list, during_rollforth: bool)
Output an error message to the console.
| Parameter | Type | Meaning |
|---|
text | var | The message with {} characters to indicate placeholders for values. |
args | list | List of values to insert into the message. |
during_rollforth | bool | Output when simulating forward without drawing. |
$debug.print_error_if(condition: bool, text: var, args: list, during_rollforth: bool)
When the specified condition is true, output an error message to the console.
| Parameter | Type | Meaning |
|---|
condition | bool | The condition to meet in order to print the specified error. |
text | var | The message with {} characters to indicate placeholders for values. |
args | list | List of values to insert into the message. |
during_rollforth | bool | Output when simulating forward without drawing. |
$debug.print_line(text: var, args: list, during_rollforth: bool)
Output a message on a line by itself to the console.
| Parameter | Type | Meaning |
|---|
text | var | The message with {} characters to indicate placeholders for values. |
args | list | List of values to insert into the message. |
during_rollforth | bool | Output when simulating forward without drawing. |
$debug.print_line_if(condition: bool, text: var, args: list, during_rollforth: bool)
When the specified condition is true, output a message on a line by itself to the console.
| Parameter | Type | Meaning |
|---|
condition | bool | The condition to meet in order to print the specified message. |
text | var | The message with {} characters to indicate placeholders for values. |
args | list | List of values to insert into the message. |
during_rollforth | bool | Output when simulating forward without drawing. |
$debug.print_memory_summary(package: var, add_cushion: bool)
Print summary memory stats to screen.
| Parameter | Type | Meaning |
|---|
package | var | Reference to a package file used for naming. Or string name. |
add_cushion | bool | If true, adds cushion amount to current memory used. |
$debug.print_warning(text: var, args: list, during_rollforth: bool)
Output a warning message to the console.
| Parameter | Type | Meaning |
|---|
text | var | The message with {} characters to indicate placeholders for values. |
args | list | List of values to insert into the message. |
during_rollforth | bool | Output when simulating forward without drawing. |
$debug.print_warning_if(condition: bool, text: string, args: list, during_rollforth: bool)
When the specified condition is true, output a warning message to the console.
| Parameter | Type | Meaning |
|---|
condition | bool | The condition to meet in order to print the specified warning. |
text | string | The message with {} characters to indicate placeholders for values. |
args | list | List of values to insert into the message. |
during_rollforth | bool | Output when simulating forward without drawing. |
$debug.register_visibility_class(class_name: string)
adds the specified class name to the replay tool
| Parameter | Type | Meaning |
|---|
class_name | string | The name to display in the replay tool |
$debug.remove_channel_suppression(channel: string, log_level: int)
Remove suppression of a channel's output.
| Parameter | Type | Meaning |
|---|
channel | string | The name of the channel to suppress. |
log_level | int | The 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. |
$debug.set_force_rollback_frame_count(count: int)
Set the minimum number of frames to rollback each simulation loop.
| Parameter | Type | Meaning |
|---|
count | int | Frame count. |
$debug.set_inactivity_timeout_ms(timeout_ms: float)
Set the current number of ms until the inactivity timeout will occur.
| Parameter | Type | Meaning |
|---|
timeout_ms | float | The number of ms. |
Take a screenshot
$debug.toggle_entity_viewer()
opens or closes the entity viewer
$debug.write_data_pipe(name: string, keys: list, values: list, timestamp: float)
writes data to the data pipe
| Parameter | Type | Meaning |
|---|
name | string | The name of the data object |
keys | list | list of string keys |
values | list | list of values |
timestamp | float | (optional) timestamp to supply with data in seconds |
$debug.write_memory_summary_for_vci(package: var, add_cushion: bool)
Write a memory summary to a JSON file for VCI to process.
| Parameter | Type | Meaning |
|---|
package | var | Reference to a package file used for naming. Or string name. |
add_cushion | bool | If true, adds cushion amount to current memory used. |