09-01-2024, 10:33 PM
KRefreshFormation MV
by Kyonides
Introduction
You can press L or R buttons to change the current formation while walking through the map.
In the RPG Maker series, PageUp and PageDown buttons serve the same purpose as L and R, respectively.
The Plugin
Code:
//========================================================================================
// KRefreshFormation MV.js
//========================================================================================
/*:
* @plugindesc Change the Current Party's Formation with a Button!
* version 0.1.0
* @author Kyonides Arkanthes
*
* @param None
*
* @help Instructions:
* While playing on the map, simply hit:
* L or R buttons
* PageUp or PageDown buttons
*/
Game_Party.prototype.swapFormation = function(dir) {
if (this._actors.size < 2) { return; }
if (dir == "left") {
this._actors.push(this._actors.shift());
} else if (dir == "right") {
this._actors.unshift(this._actors.pop());
}
$gamePlayer.refresh();
};
const Game_Player_update_refresh_heroes = Game_Player.prototype.update;
Game_Player.prototype.update = function(sceneActive) {
if (Input.isTriggered('pageup')) {
SoundManager.playCursor();
$gameParty.swapFormation("left");
} else if (Input.isTriggered('pagedown')) {
SoundManager.playCursor();
$gameParty.swapFormation("right");
}
Game_Player_update_refresh_heroes.call(this, sceneActive);
};
Terms & Conditions
Free for use in any kind of project. There is nothing else you should know about them.