Debug a call that crosses languages
FUNCTIONS, NODES AND THE CALLER
A visual action can call BASIC, and a BASIC record can ask GDScript for a value. The call can reach the right function while the caller still does the wrong thing with the answer.
01. At the caller, log the target record ID, function name and argument values, in order. Make sure the script ID is unique across languages. A missing optional argument and a supplied empty string may mean different things.
02. At the callee, log the values it received and its return value. If this line never appears, check that the record is enabled and that the function name is still current.
03. Back at the caller, inspect the return type. With the GDScript example on page 18, read the ok field first. Reading only value would turn bad input into a legitimate-looking zero.
A visual action can lose a good result#
In Functions as Nodes, check the exposed function name and parameter definitions against the actual function. In Call Script Function, check the selected function, the argument values and the result variable. Query that variable immediately after the action.
BASIC function: Fare(count, rate)
Inputs: 3, 4
Function result: 12
Stored result: 12Those were the values in a tested visual-to-BASIC call. If the function logged 12 but the next node saw an older value, the next two places to inspect would be the selected result variable and any intervening action that writes it.
