How to Force Switch Positions in Formation

Am I completely blind, or am I missing a way to force switch actors into certain positions? Maybe I misunderstood something in the options on MZ. I want to force one particular actor to be the party leader, but even with VisuStella's Party System plugin, I don't see any option to do this.

Furthermore, is there a way to save a party's position to return it to what it was after a certain event finishes? Thanks for any advice.
In case it helps: without plugins, you can swap two members' positions using a script call, e.g.
JavaScript:
$gameParty.swapOrder(0, 1);
I.e. "swap the leader (index 0) with the first follower (index 1)".

So I think you could:
  1. Make sure actor ID 123 (forced party leader) is in the party (Change Party Member);

  2. Store the current position of that actor in variable ID 456 (Control Variables -> Script):
    JavaScript:
    $gameParty.allMembers().indexOf($gameActors.actor(123))

  3. Swap that actor into the first position for the cutscene (Script):
    JavaScript:
    $gameParty.swapOrder(0, $gameVariables.value(456));

  4. Afterwards, use the script call in step 3 to swap back again.
(Replace 123 and 456 with appropriate IDs.)
I want to force one particular actor to be the party leader, but even with VisuStella's Party System plugin, I don't see any option to do this.

1702088379139.png
In case it helps: without plugins, you can swap two members' positions using a script call, e.g.
JavaScript:
$gameParty.swapOrder(0, 1);
I.e. "swap the leader (index 0) with the first follower (index 1)".

So I think you could:
  1. Make sure actor ID 123 (forced party leader) is in the party (Change Party Member);

  2. Store the current position of that actor in variable ID 456 (Control Variables -> Script):
    JavaScript:
    $gameParty.allMembers().indexOf($gameActors.actor(123))

  3. Swap that actor into the first position for the cutscene (Script):
    JavaScript:
    $gameParty.swapOrder(0, $gameVariables.value(456));

  4. Afterwards, use the script call in step 3 to swap back again.
(Replace 123 and 456 with appropriate IDs.)
caethyril - That worked perfectly. I setup If then Else statements to determine "If member zero = X" else "If memeber one = X" etc, used that to set the variable to the appropriate position, then use the swap script you suggested to ZERO with the new set variable, and it worked great.

Turan - I apologize if I was not clear on what I wanted to do. When I said "force," I did not mean lock. I should have taken more time to think about my wording in my post. As far as I understand it, Visustella's "Lock Member" function only holds them in a particular position, but it does not switch them out, or move them from one position to another. Please correct me if I'm wrong about that, and thank you for that added advice.
As far as I understand it, Visustella's "Lock Member" function only holds them in a particular position, but it does not switch them out, or move them from one position to another.
You don't need any plugins for that. The code caethyril provided is more efficient, but you can use event commands to remove the actors currently in the party then put them back in - whoever you add to the party first is in the first slot, i.e. the leader. (or remove everyone except them, then re-add and they'll stay as first)

But that's just extra info - it sounds like you've correctly implemented the script calls, so you should be good to go.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-force-switch-positions-in-formation.163697/