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,816
Reaction score
14,978
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've been trying to work on more "complete" artworks and so far... I'm in so much pain Its really annoying how easy is to completely mess up the proportions and perspectives, but I guess I can only keep practicing
xW1ByDU.jpg
Apologies for the bugs featured in the Red Light preview build (although it is a preview), they should've been fixed in the new patch I just released. View the previous profile post for a link to the Itch.io.
Generate 27 Plugins in 1 File | RPG Maker News #106

Feeling cute, might make an essay on the presence of Malaise in the gaming industry. idk
Just went to Metrocon here in Tampa Florida. My first anime convention. They had an anime chess battle and some funny impromtu comedy. The comedy was my favorite part. How is everyone?

Forum statistics

Threads
113,595
Messages
1,076,097
Members
147,595
Latest member
dororo4004
Top