Skip to reading
PCA Script Programming

Custom properties and nested containers

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

Use the editor’s custom-property definitions to add per-record data such as a lock code, inspection count or faction name. Access it below custom, for example objects.archive_door.custom.locked. This keeps your extension data separate from engine fields.

Code example
function run()
    let locked = objects.archive_door.custom.locked
    if locked
        log("The custom lock flag is set.")
    end
end

Declare a custom property before using it. A missing ordinary record property can be a runtime error; it is not a reliable automatic initializer. For saved story progress, prefer a runtime game variable unless you have tested that record/custom state’s save behavior.

Property path matching is case-insensitive where supported. Do not freely add/remove underscores, hyphens or spaces in a property key: aliases are explicit. Use the canonical path in the table. Dynamic dictionary keys and player-entered text are data, not normalized record names.

Array edits need a deliberate write-back. For a designer-owned array, take a working value, change that value, and assign the whole array back to its parent property, or use a dedicated action. Whether loaded resources rebuild still depends on that parent property.

Page 272 of 357Permalink
Go to page