Skip to reading
PCA Script Programming

Common mistakes and their fixes

Edition 0.86.4.1 HF1

0.86.4.1 Hotfix 1 edition. Earlier lessons and screenshots retain their original version context; revised references and supplements describe the newer behavior.

Download PDFView PDF page

Earlier edition reference / Current 0.86.4.0 property paths > p. 329

Source table from Common mistakes and their fixes, page 307
SymptomLikely cause / correction
Unknown functionUse an exact builtin or catalog wrapper. Native-only GiveInventory/HideObject are not automatic PCA give_inventory/hide_object wrappers; use the readable phrase, add_inventory or set_object_visible as appropriate.
Nothing happens after a property writeA definition changed while the loaded object/control still uses built resources. Use the live helper/action or reload/rebuild at a deliberate time.
A drop-down shows the record but the call failsThe action needs the ID and correct kind, not a display label. Duplicate camera/spawn IDs can make a direct reference ambiguous.
Use Definitions appears to do nothingAdd a function and its parameters first. The button accepts metadata; it does not infer source functions.
The text box returns its original textRead the loaded element’s text through get_gui_element_property in a running game. Designer preview is not runtime event execution.
The timer runs faster every visitA second periodic job was started. Add a guard and a deliberate stop/restart lifecycle.
The line says true, but the test is wrongThe value may be text "true" instead of Boolean true, or a local may shadow the game variable.
A wait never finishesThe flag is never set, the clip loops, or the expected event is not emitted. Add a bounded wait and log the actual condition.
The reward happens twiceBoth a response and a listener do the work, or a completion flag is set after a long wait. Set one-time state early.
It works until load or room re-entryTransient state/visual changes were not rebuilt from saved game variables.
An array edit does not update a designer objectWrite back the whole container or use a dedicated live action.
A file seems unchangedWrite helpers overwrite only user:// files and return a Boolean. Check the path, return value and read-back.
Page 307 of 357Permalink
Go to page