Change Party Leader

Status
Not open for further replies.

Parlu10

Veteran
Veteran
Joined
Jul 30, 2018
Messages
35
Reaction score
7
First Language
Italian
Primarily Uses
RMMV
I was wondering if there's a way to change the position of an actor when he's added to the party, and make him the leader. I couldn't find any method to do it, so i hope that someone can help me
Thank you in advance.
 

ShadowDragon

Veteran
Veteran
Joined
Oct 8, 2018
Messages
2,892
Reaction score
1,026
First Language
Dutch
Primarily Uses
RMMV
there are probably scriptcalls, but I dont know them, but do you want it to be forced or
in which way?

In battle or out battle (on the map) because those things can matter to the set up.
 

Gamefall Team

Nebula Games Leader
Veteran
Joined
Jan 10, 2017
Messages
348
Reaction score
473
First Language
Italian
Primarily Uses
RMMZ
As default - if you don't use plugins that may alter this behavior -, when you add an actor It's added on the last position of your party.
So, after using the event command for adding a new party member, you can try to use this script call:

Code:
$gameParty.swapOrder(0, $gameParty.members().length - 1)
This way, you will swap the order of the Party Leader (Index O) with the last member of the party.

Or, a more complex version - if the script above does not work as you want -:

Code:
var all_members = $gameParty.allMembers();
var actor_id_to_find = 2; // This is the actor ID of the actor you have added and you want to swap;
var position_to_swap = 0;
for(var i = 0; i < all_members.length; i++) {
if(all_members[i].actorId() === actor_id_to_find) {
position_to_swap = i;
break;
}
}
$gameParty.swapOrder(0, position_to_swap);
 

naomex1

Warper
Member
Joined
Sep 6, 2017
Messages
1
Reaction score
0
First Language
português Brazi
Primarily Uses
RMMV
Thank you, you were my private Jesus Christ.
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,831
Reaction score
5,221
First Language
Dutch
Primarily Uses
RMXP

naomex1, please refrain from necro-posting in a thread. Necro-posting is posting in a thread that has not had posting activity in over 30 days. You can review our forum rules here. Thank you.

 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,977
Members
137,563
Latest member
cexojow
Top