How to remove certain party member by party order?

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?
@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.
$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*
This still crashed how did you do it? Capture6.PNG Capture7.PNG
@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 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
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.
Or you could just use [1] three times, id imagine.
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?
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.
ohhhh ok so i just did that thank you it worked! Capture.PNG

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.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-remove-certain-party-member-by-party-order.64411/