Skip to reading
Save Games & Inventory

PCA Script: the same item and save actions

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

PCA Script uses readable statements for common inventory work and snake-case shared action functions for detailed operations. This record gives one oil and opens the inventory:

Code example
language 1.0
Code example
give oil to player
show gui inventory_lab

Use the current game’s IDs. A second record can dispatch the same Save selected command used by the Button:

Code example
language 1.0
Code example
let options = {"guiId": "save_lab", "elementId": "save_slots", "command": "save-selected"}
save_game_widget_command(options)

Shared action functions wait through the action system. They use the same property names as the GDScript dictionaries. This command still obeys the widget’s mode, range and prompt rules; the language does not bypass them.

The small command example has no mandatory-selection guard. Add your own selection check or use the guarded GDScript version when that is part of your menu’s design.

Page 88 of 96Permalink
Go to page