Skip to reading
Debugging and Performance Profiling

Inspect a value without changing it

Edition 0.86.4.5

New 0.86.4.5 field guide. Complements the existing Error Handling & Debugging manual. Benchmark and regression figures are worked examples from the guide, not general performance guarantees. Native GDScript line debugging and engine-level profiling use Godot tools.

Download PDFView illustrations
On this page

STATE / EXPRESSIONS AND EDITS

The watch evaluates global.tickets >= 2 as true. The second row edits an existing global from a JSON scalar.

Source table from Inspect a value without changing it, page 6
Try this watchWhat it tells you
global.tickets >= 2Whether the player meets the minimum fare right now.
local.left == local.rightWhether the current comparison received equal operands. Select its paused invocation first.
context.roomThe room ID for the active runtime. context.player and context.camera identify other current targets.
inventory.ticketThe current ticket-item quantity if that item key exists. This is separate from the workbench variable global.tickets.

Reproduce the edge case#

To edit the fare, the watch field must contain exactly global.tickets. Put 2 in New JSON scalar and choose Set watched global. A comparison in the watch field cannot serve as an edit target. Enter strings in double quotes, numbers unquoted and Booleans as true or false. The new value must match the existing type.

Record a visit without stopping play#

On Execution, enter node:gate_route:test. As the condition use global.tickets == 2, then choose Toggle logpoint. Run the one- and two-ticket trials. Only two should add a debug logpoint row. To break on the third visit, use hits == 3 as a breakpoint condition and start a fresh capture to reset the hit count.

Keep an experiment repeatable

Evaluate reads an expression and rejects assignments and function calls. Set watched global changes the running game and flags the capture as edited. Toggle an existing breakpoint or logpoint off before adding a different condition to the same key.

Page 6 of 13Permalink
Go to page