Equip Battle Command

Jeneeus Guruman

The Returnee
Veteran
Joined
Mar 28, 2012
Messages
1,078
Reaction score
196
First Language
Filipino
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.
 
Last edited by a moderator:

Ghost of Christmas Kloe

Ghost of a Princess Seagull
Veteran
Joined
Nov 15, 2015
Messages
1,504
Reaction score
914
First Language
English
Primarily Uses
N/A
This is great! I have no idea why no-one else has commented  :o .

It really is very useful! :)
 

Joronjo

Veteran
Veteran
Joined
Sep 17, 2015
Messages
155
Reaction score
29
First Language
English Spanish
Primarily Uses
Can this one cost a turn for changing equip?
 

Jeneeus Guruman

The Returnee
Veteran
Joined
Mar 28, 2012
Messages
1,078
Reaction score
196
First Language
Filipino
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  :o .

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.
 

Joronjo

Veteran
Veteran
Joined
Sep 17, 2015
Messages
155
Reaction score
29
First Language
English Spanish
Primarily Uses
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.
 

Jeneeus Guruman

The Returnee
Veteran
Joined
Mar 28, 2012
Messages
1,078
Reaction score
196
First Language
Filipino
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. :)
 

Maliki79

Veteran
Veteran
Joined
Mar 13, 2012
Messages
667
Reaction score
256
First Language
English
Primarily Uses
N/A
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.
 

Jeneeus Guruman

The Returnee
Veteran
Joined
Mar 28, 2012
Messages
1,078
Reaction score
196
First Language
Filipino
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.
 
Joined
Nov 13, 2015
Messages
42
Reaction score
13
First Language
Portuguese
Very interesting and useful for the game I'm projecting. Thanks a lot.
 

Maliki79

Veteran
Veteran
Joined
Mar 13, 2012
Messages
667
Reaction score
256
First Language
English
Primarily Uses
N/A
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.)
 

snorlord

Warper
Member
Joined
Oct 25, 2015
Messages
4
Reaction score
0
First Language
English
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.
 

Jeneeus Guruman

The Returnee
Veteran
Joined
Mar 28, 2012
Messages
1,078
Reaction score
196
First Language
Filipino
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.
 
Last edited by a moderator:

Radis3D

Just a Devilz
Veteran
Joined
Nov 1, 2015
Messages
172
Reaction score
33
First Language
Indonesian
Primarily Uses
RMVXA
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
 

PTS

Member Title? :D
Veteran
Joined
Jan 6, 2016
Messages
35
Reaction score
3
First Language
ru
Primarily Uses
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
 

kc_cyberpunk

Warper
Member
Joined
Feb 4, 2016
Messages
1
Reaction score
0
First Language
English
Primarily Uses
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!
 

Fifix

Villager
Member
Joined
Jul 1, 2015
Messages
10
Reaction score
0
First Language
Polish
Primarily Uses
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.
 

Ludicrousda3ve

Veteran
Veteran
Joined
Dec 21, 2013
Messages
30
Reaction score
7
First Language
English
Same problem here. However, if I use the command first with the mouse, using the keyboard afterwards doesn't cause the error. Very weird!
 

Maliki79

Veteran
Veteran
Joined
Mar 13, 2012
Messages
667
Reaction score
256
First Language
English
Primarily Uses
N/A
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?
 
Last edited by a moderator:

Ludicrousda3ve

Veteran
Veteran
Joined
Dec 21, 2013
Messages
30
Reaction score
7
First Language
English
Fairly so, yes. Apparently not enough to understand what the issue here is, though.

erroreqchange.png
 

Maliki79

Veteran
Veteran
Joined
Mar 13, 2012
Messages
667
Reaction score
256
First Language
English
Primarily Uses
N/A
Well, no problem. 


Here's the snippet that will fix the issue:

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.)
 

Users Who Are Viewing This Thread (Users: 1, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Hi, there.
I'm Creta Park, as Software engineer and Indie game developer.

Profile : creft.me/cretapark
GitHub : github.com/creta5164
Blog : creta5164.tumblr.com


My stuff

Who shares/sells their scripts/plugins on itch.io? Can I pick your brain?
If you ever need fantasy names and you're bored, make a fictional alphabet. Switch around the letters and see what you get :p
I JUST GOT PROMOTED TO 9TH GRADE BOIS!

Forum statistics

Threads
98,168
Messages
949,908
Members
129,453
Latest member
tanzx
Top