[MV] Custom Battle Windows

Started by Kiwa, December 08, 2015, 06:05:57 am

Previous topic - Next topic

Kiwa

December 08, 2015, 06:05:57 am Last Edit: December 12, 2015, 12:55:49 am by Kiwa
Kiwa's Custom Battle Windows
Authors: Kiwa
Version: 1.2
Type: Battle Plug in
Key Term: Battle Add-on



Introduction

This Script is an Alternative to the default window design. It re positions the windows and removes the battle log.


Features


  • New Layout

  • Clear Status Window

  • Removes Combat Log

  • UPDATE Removes Party Command Window and adds Escape to Player Command Window




Screenshots
Spoiler: ShowHide














Demo
N/A


Script

Spoiler: ShowHide
Quote

/*********************************************************************
* Kiwa's Custom Battle Windows                                      *
* KiwasCustomBattleWindows.js                                       *
* Version 1.0                                                       *
*********************************************************************/
/*:
 *@plugindesc Changes the Combat Menu position.
 *@author Kiwa
 *@version 1.2
**********************************************************************/

// This command runs the Function automatically without being called.
(function() {
/***************************************************************************
* We are going to overwrite methods that have inharitade from object to   *
* object. The order of the inharitance is as follows:                     *
*                                                                         *
* Window.js < Window_Base.js < Window_Selectable.js < Window_SkillList.js *
* < Window_BattleSkill.js                                                 *
*                                                                         *
* These methods already exist. RPG maker will run them before running     *
* the plugins. By typing them again they will overwrite the old methods   *
***************************************************************************/
//======================Skip party Command Window===============================



//=======================Battle Status Window Size==============================

 // Window Width
 Window_BattleStatus.prototype.windowWidth = function() {
   return  624;
 };

// Window Height
 Window_BattleStatus.prototype.windowHeight = function() {
 return this.fittingHeight(this.numVisibleRows());
 };

//==========================Enemy Select Window Size.===========================

 // Window Width
 Window_BattleEnemy.prototype.windowWidth = function() {
 return 624;
 };

 // Window Height
 Window_BattleEnemy.prototype.windowHeight = function() {
 return this.fittingHeight(this.numVisibleRows());
 };
//============================Party Command List================================

 // Window Width
 Window_PartyCommand.prototype.windowWidth = function() {
     return 192;
 };
 Window_PartyCommand.prototype.numVisibleRows = function() {
   return 4;
 }

//==========================Player Command Window===============================

 // Window Width
 Window_ActorCommand.prototype.windowWidth = function() {
   return 192;
 };

 // Visible Selectable Command Rows
 Window_ActorCommand.prototype.numVisibleRows = function() {
   return 4;
 };


//======================Battle Status Window Position=========================

 // Refreshes the window.
 Scene_Battle.prototype.updateWindowPositions = function() {
   /*var statusX = 0;
   if (BattleManager.isInputting()) {
       statusX = this._partyCommandWindow.width;
   } else {
       statusX = this._partyCommandWindow.width / 2;
   }
   if (this._statusWindow.x < statusX) {
       this._statusWindow.x += 16;
       if (this._statusWindow.x > statusX) {
           this._statusWindow.x = statusX;
       }
   }
   if (this._statusWindow.x > statusX) {
       this._statusWindow.x -= 16;
       if (this._statusWindow.x < statusX) {
           this._statusWindow.x = statusX;
       }
   } */
     this._statusWindow.x       = 190;
     this._statusWindow.y       = 0;
     this._statusWindow.opacity = 0;
     };

//==================Create the Player's action select window===================

 // Creates the Actor's window.
 Scene_Battle.prototype.createActorWindow = function() {
   this._actorWindow = new Window_BattleActor(0, this._statusWindow.y);
   this._actorWindow.opacity           = 255;
   this._actorWindow.setHandler('ok',     this.onActorOk.bind(this));
   this._actorWindow.setHandler('cancel', this.onActorCancel.bind(this));
   this.addWindow(this._actorWindow);
   };

//========================The party's Command window============================

 //Skip Party Command Window
 Scene_Battle.prototype.startPartyCommandSelection = function() {
     this.refreshStatus();
     this._statusWindow.deselect();
     this._statusWindow.open();
     if(BattleManager.startInput) {
         this.selectNextCommand();
     } else {
         this._partyCommandWindow.deactivate();
     }
     this.startActorCommandSelection();
 };

 //Party Command Window Position
 Scene_Battle.prototype.createPartyCommandWindow = function() {
   this._partyCommandWindow = new Window_PartyCommand();
   this._partyCommandWindow.x                 = 624;
   this._partyCommandWindow.y                 = 444;
   this._partyCommandWindow.opacity           = 255;
   this._partyCommandWindow.setHandler('fight',  this.commandFight.bind(this));
   this._partyCommandWindow.setHandler('escape', this.commandEscape.bind(this));
   this._partyCommandWindow.deselect();
   this.addWindow(this._partyCommandWindow);
 };

//=====================The Actor's Command window update=====================

 // Add New Command via 'this.addEscapeCommand'
 Window_ActorCommand.prototype.makeCommandList = function() {
     if (this._actor) {
         this.addAttackCommand();
         this.addSkillCommands();
         this.addGuardCommand();
         this.addItemCommand();
         this.addEscapeCommand();
     }
 };
// Creates the Method 'addEscapeCommand'
 Window_ActorCommand.prototype.addEscapeCommand = function() {
     this.addCommand('Escape', 'escape', BattleManager.canEscape());
 }

 Scene_Battle.prototype.createActorCommandWindow = function() {
   this._actorCommandWindow = new Window_ActorCommand();
   this._actorCommandWindow.x                = 624;
   this._actorCommandWindow.y                = 444;
   this._actorCommandWindow.opacity          = 255;
   this._actorCommandWindow.setHandler('attack', this.commandAttack.bind(this));
   this._actorCommandWindow.setHandler('skill',  this.commandSkill.bind(this));
   this._actorCommandWindow.setHandler('guard',  this.commandGuard.bind(this));
   this._actorCommandWindow.setHandler('item',   this.commandItem.bind(this));
   this._actorCommandWindow.setHandler('escape',   this.commandEscape.bind(this));
   this._actorCommandWindow.setHandler('cancel', this.selectPreviousCommand.bind(this));
   this.addWindow(this._actorCommandWindow);
 };

 // Rewrites the commandEscape method
 Scene_Battle.prototype.commandEscape = function() {
     BattleManager.clearActor(-1, '');
     BattleManager.processEscape();
     this.changeInputWindow();
};

//=================Creates the Enemie choice window Position===================

 Scene_Battle.prototype.createEnemyWindow = function() {
   this._enemyWindow  = new Window_BattleEnemy(0, this._statusWindow.y);
   this._enemyWindow.Opacity          = 255;
   this._enemyWindow.setHandler('ok',     this.onEnemyOk.bind(this));
   this._enemyWindow.setHandler('cancel', this.onEnemyCancel.bind(this));
   this.addWindow(this._enemyWindow);
 };

//=========================The Skill window position===========================

 Scene_Battle.prototype.createSkillWindow = function() {
   this._skillWindow = new Window_BattleSkill(192, 0, 180, 624); // (x, y, h, w)
   this._skillWindow.opacity          = 255;
   this._skillWindow.x                = 0;
   this._skillWindow.y                = 100;
   this._skillWindow.width            = 816;
   this._skillWindow.height           = 525;
   this._skillWindow.setHelpWindow(this._helpWindow);
   this._skillWindow.setHandler('ok',     this.onSkillOk.bind(this));
   this._skillWindow.setHandler('cancel', this.onSkillCancel.bind(this));
   this.addWindow(this._skillWindow);
 };

//===================The Item window size and position=========================
 Scene_Battle.prototype.createItemWindow = function() {
   this._itemWindow = new Window_BattleItem(192, 0, 180, 624); //(x, y, h, w)
   this._itemWindow.x                = 0;
   this._itemWindow.y                = 100;
   this._itemWindow.width            = 816;
   this._itemWindow.height           = 525;
   this._itemWindow.opacity          = 255;
   this._itemWindow.setHelpWindow(this._helpWindow);
   this._itemWindow.setHandler('ok',     this.onItemOk.bind(this));
   this._itemWindow.setHandler('cancel', this.onItemCancel.bind(this));
   this.addWindow(this._itemWindow);
 };

//=======================Create the Help window================================
 Scene_Battle.prototype.createHelpWindow = function(){
   this._helpWindow = new Window_Help();
   this._helpWindow.x                = 0;
   this._helpWindow.y                = 0;
   this._helpWindow.height           = 100;
   this._helpWindow.width            = 816;
   this._helpWindow.opacity          = 255;
   this._helpWindow.visible          = false;
   this.addWindow(this._helpWindow);
 };

//=====================Log window Position and size============================
 Scene_Battle.prototype.createLogWindow = function() {
   this._logWindow = new Window_BattleLog();
   this._logWindow.x                = 0;
   this._logWindow.y                = 444;
   this._logWindow.height           = 100;
   this._logWindow.width            = 816;
   this._logWindow.opacity          = 255;
   this._logWindow.visible          = false;
   this.addWindow(this._logWindow);
 };

//==================Finish the opening automatic Function================
})();




Instructions

Plug and Play with the MV Plugin manager.


Compatibility

No incompatibility unless something else tries to modify the Battle_Scene.


Credits and Thanks

  • Special Thanks to everyone on the forum who has regularly helped me out with questions and helped me with prior scripting.

  • Karberus from the RPG maker forum who made a script I used to understand what was happening.




Author's Notes

This is my first script I've put out. I know it's simple but it was a milestone for me.
I learned a lot from it. Hopefully you can learn from mine.