Command Equip

Last Updated: 2012.01.10
Download Link
Github Link

This command allows your actors to be able to change equipment in the middle of battle by directly accessing the equip scene in the middle of battle, and returning back to the battle scene exactly as it was. Furthermore, you can limit how frequently your player can switch equipment for each of the actors.

Modify the settings in the module to your liking.

And that’s all, folks!

33 comments on “Command Equip

  1. This does not work very well with the YSA Battle Add-On: Order Battlers.
    The order gauge is always on the top, even we acess to the equip scene. I didn’t know if i should refer it to you or to Yami!!???

  2. I figured out how to make this skip your turn. It requires other scrips and is a bit complicated, but let me know if you wanna do it, and I’ll try to walk you through it.

      • Ok. Well first of all, you’ll need 3 scripts:

        1.This Command Equip (obviously)
        2.Yami’s Predicted Charge-Turn Battle System
        *I imagine you can do this with any CBS that allows individual actor’s turns, but I only did it with this one
        3.Yanfly’s Skill Restriction
        Make a switch. You’ll need one reserved for this to work.
        Install each script according to the instructions.
        Then, you’ll have to edit 2 of them a bit:

        1: In Command Equip, Search for the following line in the code (Ctrl-F)
        2: Under that line, add the lines
        $game_switches[x] = true if previous_equips != actor.equips
        # x will be the number of the switch you made earlier
        turn_start if previous_equips != actor.equips
        3: What this does is turn on the desired switch to be used later, as well as force the actor to take a turn only if they switched equipment.
        Since they didn’t input an action, the game defaults the action to a regular attack, which brings us to the next step…
        4: Open the Skills tab in Database and add this to the notebox:

        x will be the number of the switch you made earlier
        5: Doing this will, via the Skill Restrict script, null the use of the attack command if the switch is on, making the character do nothing and skipping his turn!
        6: In the PCTB script, Search for the following line in the code (Ctrl-F)
        def start_pctb_action
        and on the line right after that, add the following:
        $game_switches[x] = false
        # x will be the number of the switch you made earlier
        7: This will turn off the switch. Otherwise NO ONE, friend or enemy, would be able to do regular attacks!

        **doing this should not have any bugs and as I’m technically NOT a scripter, I won’t really be able to help too much if they do.
        But if you do find something nasty, post it here and I’ll do what I can to assist you guys.

        Good luck to everyone and thanks to the original scripters for their hard work!

  3. Side note:
    I made a state that seals Head, Armor and Accessory.
    Set it to “Remove at Battle End”
    And Auto Remove at “Action End”
    Duration is 0 ~ 0
    Then I added this to the Script ABOVE the line
    actor.add_state(x) #make x the state number you created earlier
    This makes it so each time you access the equip menu, you give an actor a state that does not allow them to change the specified equip.
    Makes things more interesting, no?

    • Awesome! I was just about to ask how I might be able to restrict the EQ change to hands-only. Doesn’t make sense that someone would be able to change an entire suit of armour in the heat of battle.

  4. Would you be able to make this so that it can be turned on and off with a switch?
    I’d like to introduce it as a new feature very early into the game, but not in the introduction battle sequence.

    • I’ve also got another question;

      I want to make the cooldown for changing equipment for visually obvious. I had an idea of having the text for “Equip” change to different texts you can set for each turn. What do you think of this?

      Example: So say I change equipment and the cooldown is at 3; The next time you went back to the menu, not only would the text be a bit opaque as per usual, but it would say something like “3 turns left”. Then “2 turns left” on the next turn etc. until the cooldown was finished, then it would change back to “Equip”.

    • Nyeh,

      Ctrl + F to find ‘’ and makes sure it is the one that calls Scene_Equip or something like that. Inbetween #—- and SceneManager….. put: ‘actor.add_state(x)’ where ‘x’ is a State you have made that seals off all other equipment slots. State ‘X’ Should be set to Remove at Battle End and Action End with Duration 0 ~ 0.

      This was made courtesy of Maliki79 who posted the idea originally. I just reposted it for you. =)

  5. hey there yanfly I am using this script aswell as a equip events script which allows me tochange the battler graphic, i am trying to achieve change the battler graphic after I equip the next weapon is there a way were I can like refresh the graphic after equip in battler or maybe put this code somewhere in your script


  6. hey there, uhh i’m having an issue with you’re script, whenever i choose the Equip command from battle, when it goes to the equip scene, the battle commands stays on screen at the ‘Equip Scene’, is there any way to fix this please?

  7. Does anybody know what this means??

    Script ‘battle equip; line 218: No Method Error Occured
    undefined method: ‘fixed_equip_type’ for # RPG::actor:0x9d8ed58

    Happens whenever i try to use the command in battle

  8. Hi Yanfly,
    Thanks for this awesome script,
    however I found a little bug or something:

    When you change one actor equipment it skips the turn, which is good, however, if you cancel the latest action or if you use the left-right command selection(option in your Battle Engine script) you’re able to re-select the latest actor and so you’re able to select another action making useless the skip turn option.

    I don’t think I have some other script influencing this.

    I might suggest a solution: instead of accessing the scene_equip right after selecting the command, it should process at the beginning of that actor turn, like every other action.
    I don’t know if possible though.

    Hope you’ll read and answer,
    See ya :-)

    • I was having the same problem but I found a fix for it (at least it works so far)

      Go to Game_BattlerBase, around line 598, where you’ll find “def inputable?”

      it should say: normal? && !auto_battle?

      replace with: normal? && !auto_battle? && battle_equippable?

      This only works if you set the equip cooldown to 1. Anything above will cause the actor to skip turns

  9. Im seeing this weird issue where if that last actor selects equip then exits out of the screeen, at the beginning of the next turn, the battle window at the bottom will shift to the left which ends up hiding the window to select Battle, Escape, Party, & CombatLog

  10. Hey, there was this bug where If I tried to equip anything mid battle, I’d get an Error window saying that line 218. had a problem. But I never seen the problem. Can someone tell me if they experienced this bug as well?

  11. Not sure if anyone may know/will see this, but is it possible to call this via a common event? I can’t seem to figure out how to get it to use the same rules for the battle equip, it just will bring up the regular equipment window in battle.
    Additionally, does anyone know how this could be restricted to certain actors? Some of the characters should not be able to change equipment in battle, but I’m unsure how I might edit the script to allow for that. Thanks for any advice.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s