Skip to reading
PCA Script Programming

21. Properties: live changes and definitions

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
Code example
function run()
    set objects.archive_door.visible to true
    set objects.archive_door.opacity to 0.8
    set objects.archive_door.transform.position to vector3(2, 0, -3)
    set characters.elias.name to "Professor Elias"
end

A definition is the stored description of a character or asset. A loaded scene object is the instance the player sees now. A live property can update that instance. A definition-only property may be saved in the runtime project data but need an object rebuild or a later lookup before its visible effect changes.

The reference marks properties as Live or Definition. “Definition” does not mean your source game project has been permanently rewritten on disk. Runtime record changes and full save-game persistence are separate concerns. Use game variables for durable puzzle facts and reapply visual state from those facts when a room loads.

Do not rename a record by assigning its id. ID and type fields are read-only where marked. Change an ID through the editor so it can update references. To edit a nested array such as GUI elements, dialogue nodes or animation states, change a working copy and assign the full container, or use a dedicated action.

Character definitions and scene actors can share an ID but are not interchangeable.

characters.elias.name changes the shared character definition;

objects.elias.character.displayName addresses a loaded actor’s character data when that actor exists in the scene.

Page 28 of 357Permalink
Go to page