Skip to reading
Visual Scripting in Depth

Save a repeatable script test

Edition 0.86.4.7

0.86.4.7 tutorial edition with new lessons for Studio 0.86.4.6 and 0.86.4.7. Earlier chapters, screenshots and registry figures retain their stated edition context.

Download PDFView illustrations
PCA 3D ADVENTURE STUDIO                                                                         Visual scripting in depth

STUDIO 0.86.4.6 • LESSON 4 OF 4

Turn a known result into a test you can run after changing a script, function signature or caller.

1. Start from a known answer

Open Clock-and-Debugging.pca3d and choose Debug & Profile → Regression tests. Choose Run all. The three supplied calculations return 60. Select one. Check its Language, Script and Function. Arguments is a JSON array, so a function taking no parameters uses [].

2. Build a case of your own

Choose New and give it a descriptive name. Select language, script and function. Enter starting globals as a JSON object, for example {"pressure":66}, when your script reads that variable. Put only the globals you want to check in Expected globals. Tick Check return value if appropriate and enter the expected result as JSON.

3. Prove that it can fail

Record expectations can populate a draft from a real run. Compare each value with your intended outcome. Save test and save the project. In a copy of a supplied case, deliberately change the expected return from 60 to 61, save it, then choose Run selected. Read the mismatch, restore 60 and rerun.

The workbench test specifies the script, entry, JSON inputs and expected return before it runs.

WHAT TO CHECK

The copied case should fail at 61 and pass at 60. If both runs pass, check the selected case and Check return value. A passing isolated script test is useful alongside a play-through that actually triggers its GUI or dialogue caller.

Tutorial edition 0.86.4.7

Page 97 of 97Permalink
Go to page