Question about HIME's Party Manager

Hello all!

What I'm attempting to do:
I'm attempting to use HIME's Party Manager to create a system where the player can separate members of the main party in order to solve puzzles that would take, say, 4 separate actions (basic example: 4 buttons must be stood on simultaneously to open a door). So far, I've been able to get the basic properties of the plugin working and can create new parties, add/remove actors to/from parties, and switch to created parties.

I'd like to get it to a point where the player can hit a button that allows the first follower to separate from the party and come under player control. This removes the first follower from the party, and creates a 2nd party. Ideally, the player could hit the button again and control the next follower in the party. Once all of the actors are in separate parties and are separately controlled, the player should be able to cycle through the actors until they hit another button to merge the parties into one again.

The problem:
I've been able to do most of what I'm attempting from a structured point of view, that is: player is always in position 0, Actor 2 is always in Position 1, Actor 3 is always in Position 2, etc. And that works when I have things written this way:

Spoiler: Party Creation Variable
1687536922526.png


Checks to see what actor is in follower position 1.

Spoiler: Party System
1687536949946.png

However, eventually I'd like the player to have the ability to pick and arrange the order of their party. This means that it's not always a given that an actor will be in a certain follower position.

The question:
Is there a way to check what party member is in Party Position 1 of Party 1 instead of the active party?
Through the plugin command scripts I can check to see if a party has an actor, but not what position that actor is in.

Or...

Is there a way to add the remaining party members to the newly created party in a general sense instead of adding specific actors?

What I've tried:
I've tried adding something like this to the Party Creation Variable event:

If:
JavaScript:
Party.hasActor(1, 2) && $gameActors.actor(2)==$gameParty.members()[1]

Then:
Party Creation Variable = 1

etc.

But that only checks to see if Party 1 has Actor 2 AND if the current party has actor 2 in follower position 1, which obviously only works when there's one party, but doesn't do anything when you're controlling the second party.

- - - - -

I would appreciate any suggestions that anyone might have, thanks!
Try
Code:
Party.removeActor(1, $gameParties.getParty(1).members().indexOf($gameActors.actor(2)))
You can improvise this with a bunch of add and remove party member commands to change who you're controlling, an event spawner to spawn events with your party member graphics, and $gamePlayer.swap($gameMap.event(id)) to swap map positions between them
Try
Code:
Party.removeActor(1, $gameParties.getParty(1).members().indexOf($gameActors.actor(2)))
Just so I understand what this is doing, this is removing, from party 1, the followers. Correct? So in theory:

JavaScript:
Party.addActor(2, $gameParties.getParty(1).members().indexOf($gameActors.actor(2)))
should add those followers to party #2, right?
@ATT_Turan, I've tried the script, and maybe I'm using it incorrectly, but it seems that this is removing all of the followers from the 1st party entirely. When I try to switch back it crashed and gives errors about Game_Party.Game_Unit.aliveMembers and such:

Spoiler: Error
1687553528648.png

Here's how I had it set up, which is obviously wrong haha.
Spoiler
1687553611350.png

What's interesting though is that when it's set up like below, it seems to replace the actor in position 0 with the one from position 1 when drawing the idle party
Spoiler: Interesting Error
1687553838745.png


Party with Link in position 0:
1687553937564.png


Party with correct members but incorrect idle party (should be Link next to the guy in red):
1687554031669.png


I don't think I 100% understand what the script you suggested is supposed to do.
Just so I understand what this is doing, this is removing, from party 1, the followers. Correct?
I was going off of the following:
This means that it's not always a given that an actor will be in a certain follower position.
And I gave you the code to remove a specific actor from a party, regardless of knowing its position.

JavaScript:
Party.addActor(2, $gameParties.getParty(1).members().indexOf($gameActors.actor(2)))

That will fail because the actor is no longer in party 1. It will also fail because it's returning an index from an array, not an actor ID as the addActor() method expects. It's also pointless, because you already had code that would add actor 2 to your second party.

The problem with trying to give you specific things is you mention a number of different things in your first post, so I'm really not sure which one you really want.

Do you want to always shunt over the first follower? Do you want to do it in some order of actor ID the way you have your original code? I'm just not sure what you're going for.

If you just want to push over the first follower, you would do something like:
Code:
let id=$gameParties.getParty(1).members()[1].actorId();
Party.removeActor(1, id);
Party.addActor(2, id);
And I gave you the code to remove a specific actor from a party, regardless of knowing its position.
Ah, I see that now. Thank you.

The problem with trying to give you specific things is you mention a number of different things in your first post, so I'm really not sure which one you really want.
Sorry, I sometimes have a habit of making things a little wordy. This sometimes dilutes what I'm trying to ask/accomplish. I guess I was trying to say what I wanted to accomplish, and then gave two possible ways of maybe accomplishing that, neither of which I could figure out.

If you just want to push over the first follower, you would do something like:
Code:
let id=$gameParties.getParty(1).members()[1].actorId();
Party.removeActor(1, id);
Party.addActor(2, id);
This is more of what I was originally trying to accomplish. Just so I understand what this is doing, is this is getting the members from Party 1, then essentially assigning Follower 1 as "actorId"? Then the plugin command scripts are removing the Actor "id" from Party 1, then adding Actor "id" to Party 2, correct? If that's the case, I can just us the code as is, right?

Or do I need to put the actual actor id into the places where "actorId" and "id" is located?

Sorry for all the questions, I really appreciate you taking the time to answer these.
Just so I understand what this is doing...
It's doing exactly what I said - taking the first follower from party 1 and putting them into party 2. Your first post indicated you wanted to do this for one actor (the first follower) on each button press.

, is this is getting the members from Party 1, then essentially assigning Follower 1 as "actorId"?
Not quite, it's assigning follower 1's actor ID to the variable "id".

If that's the case, I can just us the code as is, right?
Correct, I would've given instructions if you needed to fill anything in. It should work as written.
Perfect! I was just trying to avoid my previous mistake of not quite understanding what's doing, throwing it into a place where it wasn't intended, and crying about it.

I'll try this out later today/tonight and let you know how it goes! I know and others appreciate you being such an active and knowledgeable member of these forums.

Original thread: https://forums.rpgmakerweb.com/threads/question-about-himes-party-manager.158617/