How a button finds a Lua record
GUI EVENTS
The word on a button tells the player what to expect. Its Click Target tells PCA3D which script should do the work.
The highlighted item is a button named Check In this screenshot its Click Target is archive_unlock. Answer.
01. Select a button in GUI Designer → GUI Elements. In the right Inspector, open Element Properties → Events. On smaller screens, use the tab arrows to reach Events.
02. Find Click. In 0.86.3.4 the behavior named run-visual-script also starts Lua records. Enter your Lua record’s ID under Click Target.
03. To tell whether a click reaches the record, put a short Log call at the beginning of its run function. Apply the record, save your game and click the button in the game preview.
Log("The button reached this script.")If moving the pointer starts the script, inspect the Hover setting above Click. Those two events can have different behaviors.
Lua scripting / Illustrated guide W10
