Remove all party members?

captainette777

Mad Scientist
Veteran
Joined
Jan 19, 2018
Messages
78
Reaction score
72
First Language
English
Primarily Uses
RMMV
Hey all, I want to have an event where I want everybody in the party is removed, making the party empty, regardless of who they are. Having the event command just say "remove party member x" over and over again gets really inefficient when you have a ton of actors in your game. Is there a script for this? I googled for it and got results for VX Ace, but not MV.
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,063
Reaction score
10,364
First Language
Czech
Primarily Uses
RMMV
$gameParty._members = []; Maybe you will have to empty $gameParty._battleMembers like that too.
 

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,628
Reaction score
1,082
First Language
English
Primarily Uses
RMMV
I believe it's $gameParty._actors

Though I feel like there could be some side-effects of having a completely empty party...
 

Zarsla

Veteran
Veteran
Joined
Jan 23, 2015
Messages
697
Reaction score
210
First Language
English
Primarily Uses
You can do it, but the games gonna end up crashing, if you do.
 

captainette777

Mad Scientist
Veteran
Joined
Jan 19, 2018
Messages
78
Reaction score
72
First Language
English
Primarily Uses
RMMV
$gameParty._members = []; Maybe you will have to empty $gameParty._battleMembers like that too.
Hmm. So I would just put that in the script event to make it work, right?

I believe it's $gameParty._actors

Though I feel like there could be some side-effects of having a completely empty party...
You can do it, but the games gonna end up crashing, if you do.
Hearing both of you guys, I have this idea that I'll run this script, but then immediately run the "Add Party Member" script to add a party member with no data in it to make it appear that no one is there. Would that work?
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
12,964
Reaction score
13,320
First Language
English
Primarily Uses
RMVXA
Create a common event which runs remove party x for every party member you can ever have. That way you only create it once.
 

BK-tdm

Manga Maker
Veteran
Joined
Jun 21, 2018
Messages
151
Reaction score
136
First Language
English
Primarily Uses
RMMV
What do you need an empty party for? Because having 0 actors will probably end up crashing since by logic you wont have a player character to move or interact either, even if you add an invisible actor the pause menu will show an empty character bust/face/sprite but it will still have stats and hp/mp bars, you're trying to make a "party split up" kind of event?
 

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,628
Reaction score
1,082
First Language
English
Primarily Uses
RMMV
Hearing both of you guys, I have this idea that I'll run this script, but then immediately run the "Add Party Member" script to add a party member with no data in it to make it appear that no one is there. Would that work?
There's only one way to find out, right? (by testing ;))

You can also run something like this which removes all actors except for one. Replace X with the actor ID # that you want to keep. Note this syntax is for MV 1.6+.
Code:
$gameParty._actors = $gameParty._actors.filter(actor => actor.actorId() === X);
$gamePlayer.refresh();
$gameMap.requestRefresh();
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

I think one of my weirdest realizations is that my speed of game development would probably be about the same if I *didn't* work a full-time manual labor job.
Quick question, what's the best way to capture-er, I mean RECRUIT playtesters? Should I make a project thread and use that?
Node Graph out of Date. Rebuilding...
Does anyone know of any good Discord groups for art or biology discussion, that sort of thing?
Trying to access kissanime, Facing issues, Here are 5 working KissAnime Alternatives.

Forum statistics

Threads
98,054
Messages
948,932
Members
129,332
Latest member
SoulDiamond
Top