Having multiple parties with separate inventories

Hi all -

I plan for my game to have an ensemble cast with no specific main character. Before all the characters meet up and join together to make the main party, I want the perspective to swap between multiple parties (party #1 will have actors 1-4, then after their introductory story is told, it'll switch to another party with actors 5-7, etc.) as the narrative demands.

Easy enough but inventory is the issue here. For immersion and balance reasons I don't want party #2 to have access to the items the player might have picked up while playing party #1 and vice-versa until all of the characters meet. Is there a way to have multiple inventories that can be saved/stored then reloaded at will?

Googling only turned up DAE's Actor Inventories as a potential immersion-safe solution so far, but it won't play nice with VisuStella plugins for me despite comments claiming it's compatible. I just can't get it to function. Hoping others have other plugins or ideas to suggest.
I don't know if this'll play nice with the plugins you're using, but you could try these script calls:
  1. Memorise/store inventory:

    // Store the party inventory data in variable ID 1 $gameVariables.setValue(1, { Armors: Object.assign({}, $gameParty._armors), Items: Object.assign({}, $gameParty._items), Weapons: Object.assign({}, $gameParty._weapons) });

  2. Clear inventory:

    $gameParty.initAllItems();

  3. Restore inventory:

    // Restore party inventory from variable ID 1 const data = $gameVariables.value(1); for (const k in data) { const items = window['$data' + k]; for (const n in data[k]) { $gameParty.gainItem(items[n], data[k][n]); } };
If you're using anything for instanced (a.k.a. "independent") items then you may need something different. For future reference, these examples are from the MV / MZ Script Call List.

Note that (re)storing gold doesn't need scripting:
  • Store: Control Variables -> Game Data -> Other -> Gold;
  • Restore: Change Gold -> Variable.
Holy hell, this seems to work perfectly! You're a lifesaver, thank you! :ptea:

Original thread: https://forums.rpgmakerweb.com/threads/having-multiple-parties-with-separate-inventories.151801/