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,801
Reaction score
14,970
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

Feel free to check out our "Touch the Stars" gamejam submission, "Starlight, Starbright!"
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
So apparently the surprise Google Search page browser game saves your progress when you close the browser.

This really makes me miss the golden age of Flash gaming.
ohh man im ending oneshot now (im doing the last stepping puzzle rn) and the music is so...sad...like...ive been thinking recently about how fast moments pass and...my anxious thoughts combined with that music and nostalgia...like...im comfortably sad...and want to cry internally
We're playing one of the Touch the Stars game jam entries, come join us!

Forum statistics

Threads
113,552
Messages
1,075,790
Members
147,551
Latest member
ananansy
Top