Skip to reading
GDScript Programming & Godot

RemoveInventory()

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

Remove Inventory

Remove copies of an item through the current inventory route.

Source table from RemoveInventory(), page 95
Option key / fieldMeaning and inputDefault
Item itemIdChoose an inventory definition ID.Blank
Count countNumber of copies or repetitions. Use a whole number.1

Timing. Waits for the runtime routine to return; no further completion wait is promised by this schema.

Code example
await RemoveInventory({"itemId": "key", "count": 1})

In use. Remove one fuse after it has successfully been installed. Test the condition first, then remove it. Removing a missing item is not a substitute for a Has Inventory branch, and the next action in an ordinary list will still run.

ChangeInventoryQuantity()#

Change Inventory Quantity

Apply a signed quantity change to an item for a character.

Source table from RemoveInventory(), page 95
Option key / fieldMeaning and inputDefault
Player / Character characterIdChoose a Character Designer ID; player is a runtime alias where supported.Blank
Inventory Item itemIdChoose an inventory definition ID.Blank
Change By amountSigned quantity change: positive adds, negative removes.1

Timing. Waits for the runtime routine to return; no further completion wait is promised by this schema.

Code example
await ChangeInventoryQuantity({"characterId": "player", "itemId": "key", "amount": 1})

In use. Use amount -1 to consume a battery, or +3 to grant three coins. This is a change by an amount, not an instruction to set an absolute total. Choose the same owner that the inventory GUI is displaying.

Page 95 of 378Permalink
Go to page