34. Call another script and return a value
Figure 24. Call Script supplies a function name, a JSON argument array and an optional result variable.
1. Add Call Script. Choose the script ID.
2. Leave Function blank for its default entry, or enter an exact function name such as describe.
3. Enter Arguments as a JSON array, for example [7,"Workshop reward"].
4. Set Store Result in Variable to function_result if the caller needs the answer.
5. Add Return in the called visual function, or return a value from the text function.
6. Use the destination variable after the call completes.
Return ends the current graph invocation and sends one value back. That value can be a number, flag, string, array or dictionary. It does not continue through another wire after returning.
Use Call Script Function when you want a friendly exposed function with named, typed parameter controls. Use Call Script for a lower-level explicit function name and positional argument array. Run Visual Script is convenient for calling a default script without storing its return.
A direct Call Script does not use an exposed definition to choose a visual function’s entry. For a multi-entry visual function with named parameters, use Call Script Function. Explicitly requesting a nonexistent text function does not silently fall back to run.
