Change party formation with a button press

Canini

Veteran
Veteran
Joined
Mar 29, 2016
Messages
1,025
Reaction score
686
First Language
Swedish
Primarily Uses
RMVXA
Hello and thanks for looking! I need a really simple (hopefully) script. Say you have a game with two characters, lets call them X and Y. I need a script that changes their formation with the press of a keyboard button (Q). Hopefully these images are clear enough:


X is in front. The player presses the Q button on their keyboard.


Now Y is in front!


If the player presses Q again X returns to the front.

In other words, exactly what the change position in the default menu does but with the press of a button. The party will never have more than two characters.
 

GuanyuMaker

Veteran
Veteran
Joined
Mar 9, 2015
Messages
63
Reaction score
74
First Language
Portuguese
Primarily Uses
RMMV
Is there a vx ace version of this?
Oh. Im so sorry. Missed the thread. I've done something with script calls myself before for vxace but cant remember well how to do it. Basically you need to remove the first party member and add it back, however so long i dont touch vxace that i cant tell you exactly what to do.

EDIT:
I would create a parallel common event and put a conditional inside for the key you want to press for it. Inside the condition a script call with this:

Code:
temp = $game_party.members[0].id
$game_party.remove_actor(temp)
$game_party.add_actor(temp)
Not sure if it will work as I dont have VXACE anymore to test it for you.
 
Last edited:

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,661
Reaction score
563
First Language
English
Primarily Uses
RMVXA
If you use Yanfly Party system script, then Soulpour has a fix to allow party swap.
By using script call $game_party.swap_order(n,n)
 

Harosata

Dramatic Lightning's BFF
Veteran
Joined
Aug 20, 2015
Messages
246
Reaction score
70
First Language
English
Primarily Uses
RMVXA
Himework's Rotate Formation, which uses A and S to rotate party formation. Simply #comment out one of the calls on the bottom if you want only one button.
 

Canini

Veteran
Veteran
Joined
Mar 29, 2016
Messages
1,025
Reaction score
686
First Language
Swedish
Primarily Uses
RMVXA
@Harosata

Exactly what I was looking for! I actually managed to solve it myself by following @GuanyuMaker suggestion and using a common event, but the script should still be super useful for someone else having a set-up like this.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Are we allowed to post about non-RPG Maker games?
I should realize that error was produced by a outdated version of MZ so that's why it pop up like that
Ami
i can't wait to drink some ice after struggling with my illness in 9 days. 9 days is really bad for me,i can't focus with my shop and even can't do something with my project
How many hours have you got in mz so far?

A bit of a "sparkle" update to the lower portion of the world map. :LZSexcite:

Forum statistics

Threads
105,883
Messages
1,017,236
Members
137,608
Latest member
Arm9
Top