Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: BowsetteGamer on Sun 07/01/2024 13:44:55

Title: A Character can have multiple Inventory Windows?
Post by: BowsetteGamer on Sun 07/01/2024 13:44:55
Hello guys, how are you?
I have a question, how can I put a second inventory window on the same character so that specific items (objects) are moved to that second inventory window?
Please help me, I'm a little confused ???
Title: Re: A Character can have multiple Inventory Windows?
Post by: Khris on Sun 07/01/2024 13:52:42
You need to use a dummy character for this since each character has their own inventory.
Set the 2nd InvWindow's Character ID to the one of the dummy.

Transferring an item is done by:
  player.LoseInventory(iQuestItem);
  cInvDummy.AddInventory(iQuestItem);

Using the items of the 2nd inventory is a bit tricky because AGS only supports setting an item as player.ActiveInventory if it is actually held by the player, so you might need to write your own handling.