Changing party lead via an event command?

Is there anyway to change the party order for actors when walking in the map screen? I’m trying to make it so different actors will take the lead depending on which map they are in, i.e. Actor 2 will take the lead when in their own home, rather than the main player character?
The easiest but also simplest solution would be to remove and re-add all actors with your desired sequence.
Perfect, thank you 🙂
Try this script.

$gameParty.removeActor(ActorID);
$gameParty.addActor(ActorID, 0 );

Example :
$gameParty.removeActor(2);
$gameParty.addActor(2 , 0);
Thanks, I'll keep that as a back up if I have any issues with the first way in the future 🙂
Actor 2 will take the lead when in their own home, rather than the main player character?
And just like that this idea is stolen for my project because it just makes so much sense. lol
Haha - yeah, it's a little thing but thinking it'll add to the visual story telling 🙂
Try this script.

$gameParty.removeActor(ActorID);
$gameParty.addActor(ActorID, 0 );
Where did you get that code? addActor() only takes one argument, you can't add an extra 0 to say "add them at the front."

You can do this via code if desired with
Code:
$gameParty.swapOrder(0, $gameParty.indexOf($gameActors.actor(actorID)))

But I think what Aerosys suggested is the most accessible solution for a new user/non-coder.

Original thread: https://forums.rpgmakerweb.com/threads/changing-party-lead-via-an-event-command.171731/