Equip Battle Command

Equip Battle Command
Version: 1.1.1
By Jeneeus Guruman​
Introduction

This plugin allows to access equip window to change equipment in battle.

Features

  • Changes equipment on battle.
Screenshots
 
Not necessary since the layout is exactly the same as the equip command in the map menu, regardless if using default or plugins.

How to Use
 
Just put this below scripts that alter the Equip layout like Yanfly's Equip Core but above other scripts.
 
Script

Pastebin

GitHub

Known Bugs

None so far.
 
Update

  • v1.1.1: Fixed a bug while using Yanfly's Equip Core that will clear equipment even the unremovable ones and optimized them even when set to not be optimized (special thanks to snorlord for the help).
  • v1.1.0: Now added "Unchangeable Types" parameter to exclude some slots to enable equip changes in battle.
  • v1.0.2: Fixed a bug that won't refresh the equip item list when the quantity of any equipment (from weapons to armors) altered outside of the equip command in battle.
  • v1.0.1: Now compatible with Yanfly's Equip Core.
Author's Notes

  • This script is free to use commercially or not. If commercially, you must credit me. If not, just don't claim this as your own but not crediting me is okay if you don't want to.
This is great! I have no idea why no-one else has commented  😮 .

It really is very useful! 🙂
Can this one cost a turn for changing equip?
Update

  • v1.0.2: Fixed a bug that won't refresh the equip item list when the quantity of any equipment (from weapons to armors) altered outside of the equip command in battle.
This is great! I have no idea why no-one else has commented  😮 .

It really is very useful! 🙂
Probably because of a plugin from preorder that makes you change weapons (only) in battle too but a little bit buggy in my part. The only difference is that this one also caters armors (body, head, accessory).

Thanks, by the way. 🙂

Can this one cost a turn for changing equip?
Not yet but I'll try to add that feature. Thanks for that suggestion.
Also if i can make another suggestion, if its ok and possible of course, to have the choice of specifying what kind of equipment can be changed in battle.
Also if i can make another suggestion, if its ok and possible of course, to have the choice of specifying what kind of equipment can be changed in battle.
I'll try to add this too and it seems this is easier to make than the other one. Thanks again. 🙂
I'll try to add this too and it seems this is easier to make than the other one. Thanks again. 🙂
Just add a state that seals the unchangeable equips before entering the scene.

That's what I plan on doing.
Just add a state that seals the unchangeable equips before entering the scene.

That's what I plan on doing.
Unless you used Yami's Retain State on Death plugin, having some states that will seal some equipment slot will be a bad idea since all states will be removed on death or when recovering using "Recover All" event command.
Very interesting and useful for the game I'm projecting. Thanks a lot.
Unless you used Yami's Retain State on Death plugin, having some states that will seal some equipment slot will be a bad idea since all states will be removed on death or when recovering using "Recover All" event command.
It gets reapplied every time you enter the scene, it wouldn't matter if it wore off after that.  As long as it doesn't get applied outside of battle, it'll be fine.

(I used this idea with my old project on Ace, so I know the idea will work.)
At line 367 you redefine Scene_Battle.prototype.commandEquipmentCancel for a second time and only remove this._compareWindow.hide();

I'm pretty sure all this does is make the previous lines of code pointless.

I also noticed a compatibility bug with YEP_EquipCore (this is with your plugin beneath YEP_EquipCore) where when you choose to Clear equips outside of battle, Non-Removable Types (Slot 1, weapons in this case) are respected BUT in battle using your plugin they are not. If you try to manually re-equip the removed Non-Removable Type, the game prevents you from re-equipping it under what appears to be the pretense that it was never unequipped to begin with.

You can, however, re-equip it by choosing Optimize.

Also, if you add

this._actorCommandWindow.activate();this.selectPreviousCommand.bind(this);at the end of commandEquipmentCancel then the cursor won't reset to the top of the actor command window every time you exit the equip menu during battle.
At line 367 you redefine Scene_Battle.prototype.commandEquipmentCancel for a second time and only remove this._compareWindow.hide();

I'm pretty sure all this does is make the previous lines of code pointless.

I also noticed a compatibility bug with YEP_EquipCore (this is with your plugin beneath YEP_EquipCore) where when you choose to Clear equips outside of battle, Non-Removable Types (Slot 1, weapons in this case) are respected BUT in battle using your plugin they are not. If you try to manually re-equip the removed Non-Removable Type, the game prevents you from re-equipping it under what appears to be the pretense that it was never unequipped to begin with.

You can, however, re-equip it by choosing Optimize.

Also, if you add

this._actorCommandWindow.activate();this.selectPreviousCommand.bind(this);at the end of commandEquipmentCancel then the cursor won't reset to the top of the actor command window every time you exit the equip menu during battle.
About the calling it for the second time, I did that on purpose since one refers to Yanfly's Equip Core compatibility and the 2nd one is for those who didn't use it. I tried to mix them but it will cause very plenty of visual bugs (and sometimes errors).

As for the bug, I'll look into that and thanks for the added code there. That's what I'm trying to find out why it's always returning to the 1st selection.

EDIT:

Update

  • v1.1.1: Fixed a bug while using Yanfly's Equip Core that will clear equipment even the unremovable ones and optimized them even when set to not be optimized (special thanks to snorlord for the help).
  • v1.1.0: Now added "Unchangeable Types" parameter to exclude some slots to enable equip changes in battle.
I can't comment more..

i think it's great with ammo plugin, because when the ammo is run out i can unequip the weapon :3
Nice plugin, but i found critical bug!

During the battle I choose the option "Equipment". Opens the main window where I can see a list of weapons and armor. Double-press the "Enter" button on keyboard to select "Equip" ("экипировать", rus) and in the center of the screen displays an error message.

 

TypeError​
Cannot read property 'setObject' of underfined​
 

Screenshot attached.

 

PS:

If I choose the option "Equip" by double-clicking the mouse, the error did not appear.

This plugin is installed first on the list. All other plugins are disabled.

screen (1).PNG

screen (2).PNG
This is relevant to my interests. It seems there are a few issues, and I would like changing equipment to take a turn or two, but I'll take a look at it and if I have any luck, I'll post my results here.


Thanks!
Nice plugin, but i found critical bug!


During the battle I choose the option "Equipment". Opens the main window where I can see a list of weapons and armor. Double-press the "Enter" button on keyboard to select "Equip" ("экипировать", rus) and in the center of the screen displays an error message.


 


TypeError
​


Cannot read property 'setObject' of underfined
​


 


Screenshot attached.


 


PS:


If I choose the option "Equip" by double-clicking the mouse, the error did not appear.


This plugin is installed first on the list. All other plugins are disabled.

View attachment 28377


View attachment 28378

I have the exact same problem. I think it's a bug. Can it be fixed? Other than that, I love this plugin! I would also like changing equipment to take one turn in battle.
Same problem here. However, if I use the command first with the mouse, using the keyboard afterwards doesn't cause the error. Very weird!
Same problem here. However, if I use the command first with the mouse, using the keyboard afterwards doesn't cause the error. Very weird!

Since Jeneeus seems to have gone awol, I'll be willing to help.


Could you take a screenshot of the console when you get the error?


If you don't know, the console opens when you press F8 during a test play.


Edit:  NVM the SS.  I found the error.  Are you familiar with editing plugins?
Fairly so, yes. Apparently not enough to understand what the issue here is, though.

erroreqchange.png
Well, no problem. 


Here's the snippet that will fix the issue:

Spoiler
Scene_Battle.prototype.commandEquip = function() {
    this._slotWindow.refresh();
    this._slotWindow.activate();
    this._slotWindow.select(0);


};

You can either find the function in the plugin and edit it, or save this as a separate js file and install in UNDER the original plugin.


If you need me to make a file for you, let me know.


As an aside, I guess I'll go ahead and TRY to make this take up a turn in the default battle engine.


If you guys are using a different one, know that the fix will likely only work in the default engine and I'd have to recode it for others.


(I did do this already for Elle's ATB plugin, which I'm using in my own game.)

Original thread: https://forums.rpgmakerweb.com/threads/equip-battle-command.49324/