How to swap multiple characters?

This does not explain what you are trying to do. The leader is always at the front.

If you have actor 1 then 2 and 1 is the leader, when you press A you obviously want to change the order to 2 then 1.

But what if your actors are in this order: 1 2 3
When you press A, do you want actor 1 to move to the end and actor 2 will become the leader (2 3 1)?
Then when you press A again, the same will happen (3 1 2)?
And when you press A a third time, the same will happen, bringing you back to the original order (1 2 3)?
Are you just moving the leader to the end each time?

If the above is what you want, then your entire event needs to be this:
Code:
Conditional Branch: if Button A is Pressed
  Script: $game_party.actors.push($game_party.actors.shift)
End

and insert the following script above Main:
Code:
class Game_Party < Game_Unit
  attr_accessor   :actors
end


If this is not what you are trying to do, then you need to explain how, in a party of 3 or 4, you determine who is going to be the next leader, and whether they just move to the front and everyone else stays in the same order, or if the old leader actually swaps places with the new leader.


I'm afraid your translation wasn't very helpful. What are these?
View attachment 256158
That's....that's exactly what I needed and it works just as intended (Kyonides' suggestion made things easier too). Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-swap-multiple-characters.155825/