Swapping actor positions.

Hello I'm new 🙂 Hoping this request isn't too much Script request, and that i've posted it in the right place! 🙂
 
What I'm wanting to do in RMXP ( I have a legit 1.04 version) is change actor's positions in a party, via an event script call. This is outside of battle.
I found TWO posts on this site that are very nearly what I need, but they are for RMVX, my request is for RMXP.

This 1 concerning battle. and THIS ONE

In the second Shez has posted

$game_party.swap(0, $game_actors[2].index)I think this is exactly what I want.

I want to be able to choose an actor by ActorID, and manually place them in my preffered party position. Sadly it didn't work for me in RMXP.

Can anyone proffer a fix please? Pretty Please!? 🤣

As a side note I am running leon's party changer script, spoilered here just in case it matters, as I know its functionality broadly covers this area.

Linked as I can't see how to spoiler, sorry.

EDIT realised this request may be pointless if I can't store variables via Party ID, only Actor ID.

IS it possible to make a script call that Say sets - Variable[5] tog ame_party_actor[2]'s Strength stat? Or can variables only be set via actor ID in an event?
Forgive me if I am wrong, but can't you just make an event that removes both party members then add them in the exactly sequence you want? I mean, events can be easier than scripts most of the time. 😉
Yeah but I have 20 odd party members, would have to remove all 20+ each time, and re add, just worried at the possible slowdown and effort.
The $game_party.swap_order method can pretty much be copied from Ace to XP and used in exactly the same way.

Add this to a new script slot:

class Game_Party def swap_order(index1, index2) @actors[index1], @actors[index2] = @actors[index2], @actors[index1] $game_player.refresh endendAnd in a Call Script command, put
Code:
$game_party.swap_order(0, 3)
to swap the positions of the first and fourth party member. Remember the index begins at 0, not 1.
sets - Variable[5] tog ame_party_actor[2]'s Strength stat
Code:
$game_variables[5] = $game_actors[2].str
Ah it's Shaz, the originial inspiration  for my post!

Looking good so far, the implemented script works, and I can use the script command you posted.

However what I'm looking to do is  Choose by  ACTOR ID, and put them into my Chosen Party slot, Like for that previous poster you posted this:

$game_party.swap(0, $game_actors[2].index)

I tried cutting&pasting it into  a script call, but it gave me a syntax error. I spent 25 minutes hacking and slashing at the script but I had no idea what I was doing, so of course got nowhere.

So forgive me but could you please address this for me, if it is at all possible to do so?
That is exactly the call you would make. But the method is called swap_order, not just swap. So this:

Code:
$game_party.swap_order(0, $game_actors[2].index)
would put actor 2 in the first position (0) and put whatever actor WAS in that position, wherever actor 2 was.
User_The_Scythe_Has_Fallen_Cookie.png


For you Shaz.

My humblest thanks. This is great, I'm all sorted now. Ta so very much 🙂 🙂

Edit I noticed you live in Australia, so I got you this instead:

3648431-399526-fly-swatter.jpg


Help you squish some of them deadly pests like you squished my bug 😛 😛
lol! That could come in really handy over here 😀


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/swapping-actor-positions.19836/