Using an event to change party formation?

Hi guys,

First up, I'm new here. So Hi!

Really excited about making my first game. Trying to do something interactive for the kids, seeing if I can put some educational \ learning things in the game too.
I've done a bit of googling and searching on the forums here but couldn't find what I was after.

I did find references to Yanflys Party Formation Script, but I was hoping I could just do this using an event.

All I want to do is change the formation of the party when an event is run.

Example:

Party member #2: "I will lead the way from here"
 

Change formation from 1,2,3

To 2,1,3

Can this be done?

Thanks a lot for any help. 🙂
I'm sure I'll be asking more questions in the weeks to come.

- XViper

 
Just use a Call Script command (last command on page 3 of the event commands) and do $game_party.swap_order(0, 1) to exchange the first and second characters.


You might need to consider disabling formation in the menu (there's a Change Formation Access command on page 3 as well) so the player can't just go back in and swap them around again.


You may also need to tinker a bit if the player CAN change formation prior to this. Actor 2 may not be in position 2 when this event is run - they might be in position 4 instead. So if you really want to say "swap actor 2 with whoever is in the first slot", it would be more like this:

Code:
$game_party.swap(0, $game_actors[2].index)
That worked great.
 

Thanks heaps for your quick reply. 🙂

Not too fussed about changing them back, but I became aware of that ability while trying to find my answer for this one. 🙂

Edit: Saw your edit. Thanks very much for that, as that may very well occur later down the track. Very helpful to know.
 

Liking this forum already! 👍  

 
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/using-an-event-to-change-party-formation.16099/