Run it. Then break it on purpose.
FIRST PLAYTEST
A deliberate typo is a good way to learn what the editor is trying to tell you.
The Lua toolbar. Validate checks the source, Apply Changes updates the record, and Run Script sends it to the game preview.
01. Select Validate. Look below the code for Lua validation passed. Select Apply Changes on the Lua toolbar, then Save Project in the main toolbar.
02. Select Run Script. If a preview is already running, PCA uses it. The player should see “Someone is still in the archive.” The output includes “The archive bell rang.”
The message in the running game preview. Replace the words inside the quotes, apply, and run again to see your own line.
What a missing parenthesis looks like#
Go back to the script. Remove the closing parenthesis from function Script.run(context) and choose Validate.
The error points near Log because that is where Lua realizes the previous line never closed.
Put the parenthesis back. Validate again, apply, and save. If validation passes but the game does the wrong thing, check the record or button ID next. Correct spelling in Lua and the correct target in the editor are separate checks.
Lua scripting / Illustrated guide W06
