Having multiple parties with separate inventories

Aethesia

Twin Mask Ensemble
Member
Joined
Jun 6, 2014
Messages
13
Reaction score
9
First Language
English
Primarily Uses
RMMZ
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.
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
4,114
Reaction score
3,172
First Language
EN
Primarily Uses
RMMZ
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.
 

Aethesia

Twin Mask Ensemble
Member
Joined
Jun 6, 2014
Messages
13
Reaction score
9
First Language
English
Primarily Uses
RMMZ
Holy hell, this seems to work perfectly! You're a lifesaver, thank you! :ptea:
 

Latest Threads

Latest Posts

Latest Profile Posts

no longer using rm2k3
Don't you hate when you're trying to sleep and suddenly the smoke detector needs batteries? That's exactly what happened to me. Now I'm sluggish and tired after that darn thing started chirping at 11:30 at night. Man I wish I had one of those smart smoke detectors that sends a message to your phone way before it starts chirping.
Interior of a bus, may do more vehicle interiors :kaoswt2:
1670089782219.png
I can hardly believe it is the third day of Christmas and I have yet to put up decorations! Spending my morning cooking breakfast and getting them up.
https://itch.io/s/83641/1-week-sale Do you want a Roguelike game like a turn-based Hades? Get Zodiac Hunters now while it's on sale!

Forum statistics

Threads
127,016
Messages
1,183,204
Members
166,878
Latest member
Phunction
Top