Skip to reading
Shaders, Effects & Layered Scenery

72. Use the same actions in PCA Script

Edition 0.86.4.0

Revised 0.86.4.0 edition with new supplements; earlier 0.86.3.4 lessons and screenshot labels are retained within the supplied PDF.

Download PDFView PDF page

PCA Script can call the same shared actions. Keep each dictionary expression on a single physical line in this example. The editor’s visual line wrapping is fine; inserting newlines inside the expression changes how this parser reads it.

Code example
language 1.0
function run()
    let effect = "hand_orb"
    AttachParticleEffect({entityId:effect,targetId:"player",targetPoint:"right_hand_grip"})
    ChangeObjectProperty({entityId:effect,property:"particle.enabled",value:true})
end

For simple property changes, PCA Script’s readable property syntax is useful:

Code example
language 1.0
function run()
    set objects.hand_orb.particle.enabled to false
    set objects.heat_plume.particle.heatDistortion to 0
end
Source table from 72. Use the same actions in PCA Script, page 76
Language / toolUse the shared effect contract
GDScriptawait AttachParticleEffect(options) and the typed action helpers.
PCA ScriptShared action calls or readable set objects.<id>.<path> to value statements.
Lua / BASICTheir existing shared action calls use the same IDs, option names and value types.
Visual scripts / action listsChoose the catalog action and edit its parameter fields.

The language changes how you write the call; it does not remove rendering limits or make every particle field rebuild live. Keep the authoring/runtime distinctions from lesson 37.

Page 76 of 93Permalink
Go to page