Remove all the party members but the main character.

palom

Villager
Member
Joined
Aug 23, 2017
Messages
5
Reaction score
0
First Language
spanish
Primarily Uses
RMVXA
Hi again, I have a doubt. It's possible to make a common event that remove all the characters leaving just a specific actor?. For example: We have a system that let you customize your party, so the actors that follows you will be always different dependin on the player. But during an event we need to let the Hero alone.

I'm looking for an efficient way to clean your party without using the "remove party member" command actor per actor because that could become an unnecesary long code on long terms.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,699
Reaction score
2,800
First Language
English
Primarily Uses
RMMZ
$gameParty._actors = [id of actor you want to keep in];
$gamePlayer.refresh()
$gameMap.requestRefresh()
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
42,806
Reaction score
14,974
First Language
English
Primarily Uses
RMMV
You might also want to save the current lineup, if you need to add the other party members back afterwards.

In that case, put this above Trihan's code:
Code:
$gameParty._savedActors = $gameParty._actors.clone();

and at the point where you want to add them all back, put this:
Code:
$gameParty._actors = $gameParty._savedActors.clone();
$gamePlayer.refresh();
$gameMap.requestRefresh();
 

palom

Villager
Member
Joined
Aug 23, 2017
Messages
5
Reaction score
0
First Language
spanish
Primarily Uses
RMVXA
Thank you very much. I'll apply those script call.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,699
Reaction score
2,800
First Language
English
Primarily Uses
RMMZ
That's a good point, Shaz.
 

Latest Threads

Latest Posts

Latest Profile Posts

I had one goal when I set out to make my Game Jam game. It didn't have to be super good and the game didn't have to have the best writing - it just had to NOT CRASH.

So yeah, someone was streaming it and it crashed.
Add Special Effects on Map with Tilesets | RPG Maker News #105

Come, join Move That Box! DISCORD!
Excited to see all the entries for the 2021 Touch the Stars Gamejam.
just finished playing one shot. im kinda disappointed with return the sun ending ngl. i was hoping there would be some after credits scene that would play with my emotions

Forum statistics

Threads
113,560
Messages
1,075,834
Members
147,556
Latest member
rozmirp
Top