X Tutup

GreenOx97

Regular
Regular
Joined
Nov 8, 2023
Messages
68
Reaction score
7
First Language
English
Primarily Uses
N/A
Hi

So, I've got a bit of an unusual feature I'm trying to implement that sounds simple on paper, but has been really tricky for me to put in.

What it is, it's this sort of 'side-game' feature players can access from save points. When they select to start the side-game, the current party members will all be swapped out, and a new actor will take over and be transported to another map. The player will play out the side-game with the new actor.
Once the side-game is over, that actor will be swapped out, main party swapped back in and teleported back to the save point, and the player will resume controlling the main party where they left off.

So I've worked out how to do the first half, but I'm struggling with the second part, where the main party comes back in. How can I make the game remember which actors were in the party when they started the side-game? I know there's a feature in Control Variables where you can store party members as a variable, but how do you actually do anything with it? I've seen the option under Other where you can store Party Members as a whole, and individually under Party with Actor IDs. I'm just not sure how to use that info to bring the party back.
 

Andar

Regular
Regular
Joined
Mar 5, 2013
Messages
43,281
Reaction score
13,765
First Language
German
Primarily Uses
RMMV
You don't want to use control variable for this.
While it is possible to do so it will not be easy as you already have found out.

If it were for MV I would simply point you to Tsukihime's Party Manager for multiple parties and then switch between them.
Since you're using MZ you can either try if Tsukihim's plugin is still compatible (the website is himeworks.com) or search for a different plugin to implement multiple parties with MZ.

Sorry, I haven't used MZ yet and can't point you to a direct link
 

Winshifter

Regular
Regular
Joined
Feb 24, 2017
Messages
177
Reaction score
135
First Language
Spanish
Primarily Uses
RMMZ
I can think of this in two ways, there might be more even with plugins, but if you want to keep it vanilla, I can basically consider the following two options.

First option:
You have one variable for each party member, lets name them partyMember1, partyMember2...and so on until all party members tha can be at any given time in your entire rooster of party. So, lets assume you will have in total 10 characters, you will need 10 variables or, if you just want to remember your main party, then in vanilla would be only 4 variables. When you go to switch to the other character, you save in each variable the id of the party member corresponding to each position in the party, so partyMember1 will save the id of the player on first position, partyMember2 of the one in second position and so on. So after you save, you do your thing with minigame, then after returning, you simply move each character into its position based on the value on variables on partyMember variables.

Second option:
You only use one variable but you basically have to initialize it as an array with the script command like this:

$gameVariables.setValue(x, []);
$gameVariables.getValue(x).push($gameParty.battleMembers());

where x is the number of the variable you want to use, for example, variable number 8.
A simplified version could simply be:

$gameVariables.setValue(x, $gameParty.battleMembers());

So when you return from the mini game, all you have to do is revert making battleMembers what you saved, like this:

$gameParty.battleMembers() = $gameVariables.getValue(x);

So those are the two ways using vanilla, not plugins. Note, this is just a throw away idea, not ready for copy/paste code, it's not meant to be a working code, just an example how to think to make the process to work, the specifics will be for you to iron it out.
 

Solar_Flare

Regular
Regular
Joined
Jun 6, 2020
Messages
1,590
Reaction score
876
First Language
English
Primarily Uses
RMMV
I second the recommendation of Hime's plugin! I took a quick look at it, and I think it'll probably work in MZ. (The associated Party Switching Scene plugin, however, is not MZ compatible.)

The link is here.
 

Piyan Glupak

Regular
Regular
Joined
Nov 14, 2016
Messages
548
Reaction score
385
First Language
English
Primarily Uses
RMMZ
Himeworks Party Manager (suggested by Andar) does work in MZ:
https://himeworks.com/2016/02/party-manager-mv/
It uses script calls rather than plugin commands, so there is a reasonable chance that it doesn't require FOSSIL. I had already added FOSSIL to my MZ project before I add Himeworks Party Manager.

If it does need FOSSIL, you would want one of the forks of FOSSIL. (I understand that the original author abandoned it before an update to MZ which caused it to need patching.)

Here is a link to page 31 of the FOSSIL thread. I would look back from page 31 and try the first patched version that you come across. I have a feeling that it might be on page 30 of the thread.
https://forums.rpgmakerweb.com/thre...s-in-mz-300-plugins-fossilized.135523/page-31

I have come across at least a couple of plugins written for MZ that do the same job, but I haven't tried them. At least one of them has a thread on the board for completed MZ plugins.
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
7,031
Reaction score
7,498
First Language
EN
Primarily Uses
RMMZ
Alternatively (no plugin needed), here are some Script commands you could use:
JavaScript:
// Store current party member IDs in variable 1.
$gameVariables.setValue(1,
  $gameParty.members().map(function(actor) {
    return actor.actorId();
  })
);
JavaScript:
// Clear all party members.
$gameParty.members().forEach(function(actor) {
  $gameParty.removeActor(actor.actorId());
});
JavaScript:
// Restore saved party members from variable 1.
$gameVariables.value(1).forEach(function(actorId) {
  $gameParty.addActor(actorId);
});

(Click image to view full size.)
scl-party-clear-memorise-restore.png
This information was taken from the MV / MZ Script Call List.
 

Latest Threads

Latest Profile Posts

Twitch stream is live with Resident Evil 9! Feel free to drop by!
1000207302.png
All of the skill/system icons: Done
Pepper hopped up on my bed to snuggle earlier... and now there's grains of kitty litter all over the foot of my bed. Now she's in her own bed fast asleep. Sometimes, I like to wonder what Pepper dreams about... does she dream of chasing her toys? Pouncing on the lizards she sees on her patio? Purring in a sunny window? Receiving pets and scritchies?
Oh no... she's back in my bed.
Really interesting seeing the public be so okay with the placeholder art in Slay the Spire 2. I guess they trust in the potential of the final product, but it would be cool if the general consumer had a better understanding of dev pipelines.
Haven't updated my status in awhile. I'm taking a short break from working on my game because I have a sliiiight burnout,,

Forum statistics

Threads
154,253
Messages
1,407,563
Members
209,652
Latest member
SoapH
Top
X Tutup