Equip Battle Command

Discussion in 'JS Plugin Releases (RMMV)' started by Jeneeus Guruman, Nov 5, 2015.

  1. Jeneeus Guruman

    Jeneeus Guruman The Returnee Veteran

    Messages:
    1,078
    Likes Received:
    183
    Location:
    Philippines
    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: Nov 16, 2015
    #1
    MysticSong, markp80nj, PTS and 2 others like this.
  2. Ghost of Christmas Kloe

    Ghost of Christmas Kloe Ghost of a Princess Seagull Veteran

    Messages:
    1,504
    Likes Received:
    907
    Location:
    Somewhere...
    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! :)
     
    #2
  3. Joronjo

    Joronjo Veteran Veteran

    Messages:
    155
    Likes Received:
    29
    First Language:
    English Spanish
    Can this one cost a turn for changing equip?
     
    #3
  4. Jeneeus Guruman

    Jeneeus Guruman The Returnee Veteran

    Messages:
    1,078
    Likes Received:
    183
    Location:
    Philippines
    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.
    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. :)

    Not yet but I'll try to add that feature. Thanks for that suggestion.
     
    #4
    Joronjo likes this.
  5. Joronjo

    Joronjo Veteran Veteran

    Messages:
    155
    Likes Received:
    29
    First Language:
    English Spanish
    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.
     
    #5
  6. Jeneeus Guruman

    Jeneeus Guruman The Returnee Veteran

    Messages:
    1,078
    Likes Received:
    183
    Location:
    Philippines
    First Language:
    Filipino
    I'll try to add this too and it seems this is easier to make than the other one. Thanks again. :)
     
    #6
    Joronjo likes this.
  7. Maliki79

    Maliki79 Veteran Veteran

    Messages:
    530
    Likes Received:
    183
    Location:
    New Jersey
    First Language:
    English
    Just add a state that seals the unchangeable equips before entering the scene.

    That's what I plan on doing.
     
    #7
  8. Jeneeus Guruman

    Jeneeus Guruman The Returnee Veteran

    Messages:
    1,078
    Likes Received:
    183
    Location:
    Philippines
    First Language:
    Filipino
    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.
     
    #8
  9. Minoru Leonardo

    Minoru Leonardo Writer Member

    Messages:
    42
    Likes Received:
    11
    First Language:
    Portuguese
    Very interesting and useful for the game I'm projecting. Thanks a lot.
     
    #9
  10. Maliki79

    Maliki79 Veteran Veteran

    Messages:
    530
    Likes Received:
    183
    Location:
    New Jersey
    First Language:
    English
    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.)
     
    #10
  11. snorlord

    snorlord Warper Member

    Messages:
    4
    Likes Received:
    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.
     
    #11
  12. Jeneeus Guruman

    Jeneeus Guruman The Returnee Veteran

    Messages:
    1,078
    Likes Received:
    183
    Location:
    Philippines
    First Language:
    Filipino
    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: Nov 16, 2015
    #12
  13. Radis3D

    Radis3D Just a Devilz Veteran

    Messages:
    170
    Likes Received:
    33
    Location:
    Surabaya, East Java, Indonesia
    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
     
    #13
  14. PTS

    PTS Member Title? :D Veteran

    Messages:
    35
    Likes Received:
    3
    First Language:
    ru
    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
     
    #14
  15. kc_cyberpunk

    kc_cyberpunk Warper Member

    Messages:
    1
    Likes Received:
    0
    First Language:
    English
    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!
     
    #15
  16. Fifix

    Fifix Villager Member

    Messages:
    10
    Likes Received:
    0
    First Language:
    Polish
    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.
     
    #16
  17. Ludicrousda3ve

    Ludicrousda3ve Veteran Veteran

    Messages:
    30
    Likes Received:
    7
    Location:
    St. Louis, MO USA
    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!
     
    #17
  18. Maliki79

    Maliki79 Veteran Veteran

    Messages:
    530
    Likes Received:
    183
    Location:
    New Jersey
    First Language:
    English
    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: Jun 20, 2016
    #18
    Ludicrousda3ve likes this.
  19. Ludicrousda3ve

    Ludicrousda3ve Veteran Veteran

    Messages:
    30
    Likes Received:
    7
    Location:
    St. Louis, MO USA
    First Language:
    English
    Fairly so, yes. Apparently not enough to understand what the issue here is, though.

    erroreqchange.png
     
    #19
  20. Maliki79

    Maliki79 Veteran Veteran

    Messages:
    530
    Likes Received:
    183
    Location:
    New Jersey
    First Language:
    English
    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.)
     
    #20
    Ludicrousda3ve likes this.

Share This Page