Quick Actor Switching

Silenity

Veteran
Veteran
Joined
Dec 17, 2013
Messages
677
Reaction score
271
First Language
English
Primarily Uses
RMMV
Hello. So I just went through 24 pages of plugins to make sure this wasn't made yet. >_<


So let's get straight to the point. 


I'd like to request a plugin that allows the user to set 2 keys to quickly change the position of their actors.


Example:


A key is pressed - Actors shift to the left. First actor would go to the end of the party and the second actor would become the leader.


S key is pressed - Actors shift to the right. First actor would move to the second position and the last actor would become the leader.


A/S key were just examples but the keys should be a plugin command to be changed to fit the developers game layout.
 
Last edited by a moderator:

Tyruswoo

Game Designer
Veteran
Joined
Jul 13, 2014
Messages
96
Reaction score
68
First Language
English
Primarily Uses
RMMV
Hi Silenity,


I'd start with Yanfly's Button Common Events plugin:










Then, all you need to do is get the Common Event to change the positions of the actors!  I would try using the Change Party Member command, because this allows us to remove and then add actors again, which should move the actor to the back of the party.  We may try using the Change Party Member command directly, or we may need to use it as a script call.  For the script call list, see Archeia's topic on script calls:





We see from the script call list that we can add and remove actors using the following:


$gameParty.addActor(n);
$gameParty.removeActor(n);


I assume that "n" is the actor ID.


Removing and then re-adding the front actor would move the front actor to the back.  The only challenge, then, is figuring out the correct actor ID of whoever the front actor is.


The front actor, who is the party leader, can be determined in the method described in this topic:





So, the front actor's ID should be:


$game_party.members[0].id


(If that doesn't work, it might actually be a function like the following...)


$game_party.members[0].id()


So, we should be able to insert the above for n.  Therefore, we should place the following as a Script command within our common event:


var n = $game_party.members[0].id; // Find the front actor.
$gameParty.removeActor(n); // First, remove the front actor.
$gameParty.addActor(n); // Next, add the front actor.


If we've done this right, our common event should rotate the front party member to the back.  This takes care of one of our common event buttons.  I won't be able to test this tonight, since I'm signing out to sleep, for now, but let me know if this works for you!  I at least hope the above ideas helped you get started!


Your Adventuring Companion,


Tyruswoo


P.S.  If the above script calls don't work, the next thing I would do is use Notepad++ to open up rpg_objects.js within your project's js folder.  We won't want to change anything there, but we'll just want to use CTRL+F to look for Game_Party.prototype.id to check if that is a function, or something similar, to see how to call it.


https://notepad-plus-plus.org/
 
Last edited by a moderator:

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,853
Messages
1,016,986
Members
137,561
Latest member
visploo100
Top