How to remove certain party member by party order?

Status
Not open for further replies.

watermark

Thinking of what to do next
Veteran
Joined
Dec 25, 2012
Messages
653
Reaction score
621
First Language
English
Primarily Uses
RMMV
I want to remove the 3rd actor in a 4 people party, whoever this actor happens to be.


I know there is a "$gameParty.removeActor()" script call, but it needs an actorID. How do I get the id of an actor when I only know her order in the party?
 

Astfgl66

Veteran
Veteran
Joined
Jan 5, 2016
Messages
733
Reaction score
594
First Language
French
Primarily Uses
@watermark


Here you go:


$gameParty.members()[slot].actorId()


Slot starts at 0 for the first party member.


Edit: that's assuming you want to do it with a script call.


You can also set it in a variable:


Control variable -> Game Data -> Party


Will set the variable to the id of the corresponding party member.


You can then use a script call to refer to that variable instead of using the above script call. Although inefficient, it works.
 
Last edited by a moderator:

Hopelessdecoy

Villager
Member
Joined
Feb 28, 2014
Messages
13
Reaction score
1
First Language
English
Primarily Uses
$gameParty.members()[1].actorId()

This doesn't remove the second party member, am I doing something wrong?

Never mind it's:

$gameParty.removeActor($gameParty.members()[1].actorId())

*Face Palm*
 
Last edited:

Flaqko

Villager
Member
Joined
Jun 28, 2017
Messages
19
Reaction score
0
First Language
English
Primarily Uses
RMMV
This still crashed how did you do it?Capture6.PNG Capture7.PNG
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
33,722
Reaction score
8,506
First Language
German
Primarily Uses
RMMV
@Flaqko wrong order, the IDs automatically reshuffle.
1) you remove actor at 1, leaving you with two actors, which become 1&2.
2) you remove actor at 2, leaving you with one actor at 1.
3) you try to remove actor at 3, but that actor no longer is at 3 but at 1, resulting in error.
 

Flaqko

Villager
Member
Joined
Jun 28, 2017
Messages
19
Reaction score
0
First Language
English
Primarily Uses
RMMV
@Flaqko wrong order, the IDs automatically reshuffle.
1) you remove actor at 1, leaving you with two actors, which become 1&2.
2) you remove actor at 2, leaving you with one actor at 1.
3) you try to remove actor at 3, but that actor no longer is at 3 but at 1, resulting in error.

oh ok but is there another way removing multiple party members? if i choose \p[1] i want to remove all the other party members who ever actor are in those slots. if i choose \p[2] i want to remove the other party members
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
33,722
Reaction score
8,506
First Language
German
Primarily Uses
RMMV
as I said, the idea was correct and the order wrong - remove the third actor first, then the second and the first as the last one.
 

SwiftSign

Veteran
Veteran
Joined
Aug 5, 2015
Messages
184
Reaction score
45
First Language
English
Primarily Uses
RMMV
Or you could just use [1] three times, id imagine.
 

Flaqko

Villager
Member
Joined
Jun 28, 2017
Messages
19
Reaction score
0
First Language
English
Primarily Uses
RMMV
ok thank you this works with [1] three times. but now i have another problem so after removing the party members for a solo battle is there a way to add the same actors after the battle has ended? will i need to create a whole new post for this?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
33,722
Reaction score
8,506
First Language
German
Primarily Uses
RMMV
if you store the actor IDs in variables (no script needed, just use control variable game data to get the IDs), then you can add them (either by event command or by script) again after the battle.
 

Flaqko

Villager
Member
Joined
Jun 28, 2017
Messages
19
Reaction score
0
First Language
English
Primarily Uses
RMMV
ohhhh ok so i just did that thank you it worked! Capture.PNG
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
8,941
Reaction score
5,855
First Language
Dutch
Primarily Uses
RMXP

Flaqko, please refrain from necro-posting in a thread. Necro-posting is posting in a thread that has not had posting activity in over 30 days. You can review our forum rules here. Thank you.


Please start a new topic next time. Since you mentioned it's solved, I'll be closing this.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Latest Threads

Latest Posts

Latest Profile Posts

Anyone going to talk about Chris Pratt Mario?
My friend just gave me chocolate milk at lunch today! My day is now 1000x better. Yay, choco milky!! :kaojoy:
RivalRamen_Games wrote on jacobv1014's profile.
I really like your profile picture! Who is that in it? is she an OC?
Making his first game

Forum statistics

Threads
115,332
Messages
1,089,080
Members
150,000
Latest member
dopeboy01
Top