Swapping actors in battle.

Let's see if I can explain this right.

First off, this is 100% about aesthetics.

Second, I apologize if this can be done without any scripting and is in the wrong forum.

Situation:

I've got a character that summons a monster to take their place through a common event that simply removes the summoner and adds the monster until releasing it or battle ends.

The problem:

If i have any actors in the party below the summoner, the monster gets summoned to the last position in the formation, causing the other actors to shift their positions. Instead of into whatever position the summoner was in, which is what I want. Not really an issue until the monster disappears and the summoner returns.

I've found a few scripts like Yanfy's http://yanflychannel.wordpress.com/rmvxa/core-scripts/party-system/ or Tsukihime's http://xtsukihime.wordpress.com/2013/01/29/free-formation/.

I'm trying my best to avoid locking the formation in any way, which takes away some of the players control.

1.jpg

starting positions.

2.jpg

positions after monster summoned.

3.jpg

positions after monster leaves.

The request:

Is there anyway I can store the summoner's position in the formation and use it to set the monster's position when summoned and vice versa?

this will prevent players from having to reorder the formation after every battle they summon in.
To set a new actor's position in the party, you're going to need to use a small script.

Code:
class Game_Party < Game_Unit  #--------------------------------------------------------------------------  # * Change Members  #--------------------------------------------------------------------------  def swap_members(id1, id2)    i = @actors.index(id1)    @actors[i] = id2 unless @actors.include?(id2) or i == nil    $game_player.refresh    $game_map.need_refresh = true  endend
To use this, just make a script call of $game_party.swap_members(id1, id2) in your common event to swap the members using their IDs (their number on the Actors tab). It won't do anything if id1 isn't in the party or id2 is in the party.
Thank you! That worked out great.  I do have an add-on request if possible. 

Can you add the option to initialize id2 when swapping that actor in?

i have it set up so the summoned monster's initialized level gets increased by a variable each time its summoned.

I appreciate the help! 😀
Easy enough

Code:
class Game_Party < Game_Unit  #--------------------------------------------------------------------------  # * Change Members  #--------------------------------------------------------------------------  def swap_members(id1, id2, init = false)    $game_actors[id2].setup(id2) if init    i = @actors.index(id1)    @actors[i] = id2 unless @actors.include?(id2) or i == nil    $game_player.refresh    $game_map.need_refresh = true  endend
The script call becomes $game_party.swap_members(id1, id2, true) when you want id2 to be initialized. You can either leave it the same as before or change true to false when you don't want them initialized.
Thank you again.  This has streamlined of an entire class for my game and will give me the ability to make a few new skills when i have the time.
What if I wanted to make this a in battle option?

Original thread: https://forums.rpgmakerweb.com/threads/swapping-actors-in-battle.17940/