Skip to reading
Visual Scripting in Depth

60. Handle inventories for different characters

Edition 0.86.4.3

0.86.4.3 edition with revised lessons, updated cross-references and new cinematic/camera-safety supplements. Earlier examples, screenshots and registry figures retain their stated edition context.

Download PDFView PDF page
Source table from 60. Handle inventories for different characters, page 64
NodePurpose
Add Inventory / Remove InventoryChange the active inventory used by the ordinary pickup workflow.
Has InventoryChecks the active inventory for a positive quantity of the chosen item.
Change Inventory QuantityChoose the Player / Character, item and signed change.
Transfer InventoryChoose From Player, To Player, item and quantity.
Switch CharacterChanges the active player, subject to the project’s character setup.

1. Decide whether the game uses a shared inventory or separate character inventories.

2. For a normal player pickup, use Add Inventory with a known definition.

3. For an explicit recipient, choose the character-targeted quantity/give/transfer action that matches the job.

4. After switching characters, inspect the active inventory and associated HUD.

5. Test a transfer with sufficient and insufficient quantities.

6. Recheck any Has Inventory branch after switching the active player.

A variable saying key_taken is not the inventory itself. Keep the distinction useful: the flag prevents a second reward, while the inventory determines who currently holds the key.

If the key can be transferred or consumed, testing only key_taken to unlock a door can be wrong. Test actual possession when possession is the requirement.

Page 64 of 93Permalink
Go to page