Is there a javascript command that opens the formation window?

● ARCHIVED · READ-ONLY
Started by Ro-Jo 3 posts View original ↗
  1. I'm rather new with javascript, having only worked with it on this engine. I'm trying to add the ability to change your formation in battle, exactly like you would outside of battle. I've got to the point where "Formation" is a select-able option in battle, but I can't figure out how RM:MV creates the window/scene. I was hoping it would be defined under a single function call, but I can't seem to find anything like that.

    I know that yanfly has a plugin that can do this, but I'd prefer to use the default formation switching as I find their party interface kinda clunky.

    Any help would be appreciated.
  2. I think the formation command just makes use of the Window_MenuStatus that's drawn as part of Scene_Menu. It even has a couple formation methods (formationMode and setFormationMode).

    Looks like, when Scene_Menu draws the commandWindow, it creates a handler for the formation command through Scene_Menu.prototype.commandFormation, which is a collection of methods called on the Window_MenuStatus instance stored on the Scene's _statusWindow property.

    The okHandler for formation looks to ultimately call $gameParty.swapOrder, where you pass in the two indexes of the party members you want to swap. If I open up the main menu and do:
    Code:
    $gameParty.swapOrder(0, 2);
    SceneManager._scene._statusWindow.refresh();
    It appropriately swaps party members around. I tried the same two lines in battle and it works, too, even swapping the sideview Sprites.
  3. Hey thanks for the info; I'll take a look at that and see what I can come up with.