Follow a fault from the GUI to the script
STUDIO 0.86.4.6 / 0.86.4.7 • LESSON 1 OF 3
When a puzzle accepts the wrong input, identify the first point where the value changes incorrectly. The clock workbench gives you a known result to compare.
1. Check the source of the event
In GUI Designer select the control and confirm its binding direction. For a multi-hand clock check the stable hand ID. If you expect one digit at a time, inspect Dialed. For continuous adjustment inspect Turn. In a GUI action choose Run Script, or choose Call Script Function to send individual typed arguments.
2. Use the debugger for the part that failed
In Debug & Profile use the captured events and their source details to locate the authoring record. For a Lua, BASIC or native GDScript source line, select Line debugger and choose the record. Set a gutter breakpoint before the wrong value is written. Use Into or Over to see how the result was calculated.
3. Keep a test for the discovered fault
If the script produced the wrong result for a known input, add a case in Regression tests. Check both the return and any global the puzzle relies on. Then replay the GUI interaction. A passing script test plus a failing widget points back to the binding, event or argument mapping.
WHAT TO CHECK
For a reference case, Clock-and-Debugging.pca3d supplies gear_native (line 3), gear_lua (line 4) and gear_basic (line 4). Calling run with [] should produce 60 in each test.
Related original lesson | p. 9 Tutorial edition 0.86.4.7
