Bobstah's Battle Commands Customization v2.2.1 - Updated 05/17/2017

Discussion in 'JS Plugin Releases (RMMV)' started by Bobstah, Oct 24, 2015.

  1. waynee95

    waynee95 Lunatic Coder Veteran

    Messages:
    640
    Likes Received:
    527
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    @lonewolph
    i79-STypes(Elements):1,2,3,4!

    This would add a command called "Elements" with the icon 79 and holds all skills with skill types 1 to 4.
     
  2. lonewolph

    lonewolph Veteran Veteran

    Messages:
    194
    Likes Received:
    14
    First Language:
    English
    thank you, this worked
     
  3. Kisai

    Kisai Veteran Veteran

    Messages:
    35
    Likes Received:
    17
    First Language:
    English
    Primarily Uses:
    N/A
    Would it possible to do something like this with this plugin?

    [​IMG]
    In the first turn of this battle, all other actions are removed from the list, leaving only Attack.

    [​IMG]
    A few turns later, "Sword Art" becomes available, but "Attack" is grayed out and disabled.

    [​IMG]
    Later, someone else comes into the battle to help out. His only command available is Items.

    [​IMG]
    Afterwards, the first character's menu options include Item, while also returning accessibility to Attack.

    [​IMG]
    The second character now gets access to Attack as well.

    And after this battle, all battle commands become available.

    Obviously this is already possible with a plugin I'm currently using, but it's not compatible with this one, and was wondering if this plugin could do the same as in this image. Graying out commands, or making them unavailable entirely.
     
  4. waynee95

    waynee95 Lunatic Coder Veteran

    Messages:
    640
    Likes Received:
    527
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    @Kisai
    That is not possible with the plugin. However I did an addon to that plugin for myself which enables you to define certain conditions for commands. Depending on the condition the commands will be greyed out/not shown.

    I could post that addon here, if you want.
     
    SoSick. likes this.
  5. Kisai

    Kisai Veteran Veteran

    Messages:
    35
    Likes Received:
    17
    First Language:
    English
    Primarily Uses:
    N/A
    If it's not too much trouble. ^^ Honestly, the main reason I wanted to use this plugin was for the icons that show up next to the commands. I tried using this but it didn't seem to work. I just thought adding icons would be kind of visually neat.
     
  6. waynee95

    waynee95 Lunatic Coder Veteran

    Messages:
    640
    Likes Received:
    527
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    This is an edit by waynee95.
    https://www.dropbox.com/s/ndh9qorv6hyikhw/BOB_BattleCommandList_waynee95-edit.js?dl=0

    Make sure to not rename this file and import it instead of the original one. Make sure to place the plugin at the bottom, otherwise the Yanfly commands will not work.

    It allows you to specify conditions for commands in order to disable/enable or show/hide them. It also includes every yanfly command addition I posted in this thread (Actor Party Switch, Equip Battle Skills, etc..)

    Added features of this edit:
    • Equip - Adds the YEP_X_ChangeBattleEquip command
    • ActorSwitch - Adds the YEP_X_ActorPartySwitch command
    • EquipSkills - Adds the YEP_EquipBattleSkills command
    • EquipSkill:slotID - Adds the skill equipped in the specified slot id
    • BattleStatus - Adds the YEP_X_InBattleStatus command
    All these command should work with the features already provided by the original plugin, like icon etc.

    Conditional Battle Commands
    This plugin adds a new syntax to the commands.

    i208-Items!{put condition here}

    You can add a block of { } at the end of every command. Inside this block you can define your condition. If you add the ! before the { }-Block it will
    hide the command if that condition is false, if there is no ! it will just grey the command out if the condition is false.

    The following variables are available inside the { }-Block:
    a - for the current actor
    s - switches (for example s[42] would refer to switch with id 42)
    v - variables (for example v[12] would refer to variable with id 12)
    p - party

    Here are some example commands:
    Attack{a.level > 5} - This would grey out the attack command until the actor is level 5
    Attack!{a.level > 5} - This would hide the attack command until the actor is level 5
    i34-Items!{!a.isStateAffected(10)} - This would hide the items command if the user is affected by state 10

    This should work with most of the commands. Although I haven't tested every command!

    @Bobstah I hope you don't mind that I post an edited version here.
     
    Last edited: Mar 21, 2019
    LittleSY, SoSick., Veno and 1 other person like this.
  7. waynee95

    waynee95 Lunatic Coder Veteran

    Messages:
    640
    Likes Received:
    527
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    Here's the code when you want to add the Status Command from YEP_X_InBattleStatus. Place this plugin below YEP_X_InBattleStatus Plugin.

    Place this at the bottom of the plugin file. (If you use my edited version above, this code is already included.)
    Code:
    //=============================================================================
    // YEP_X_InBattleStatus by waynee95
    //=============================================================================
    if (Imported.YEP_X_InBattleStatus) {
       Bobstah.BattleCmds.YEP_X_InBattleStatus_processCommandEntry = Window_ActorCommand.prototype.processCommandEntry;
       Window_ActorCommand.prototype.processCommandEntry = function (cmd) {
           if (cmd.command === "battlestatus") {
               return this.addInBattleStatusCommand();
           } else {
               return Bobstah.BattleCmds.YEP_X_InBattleStatus_processCommandEntry.call(this, cmd);
           }
       }
    
       Bobstah.BattleCmds.YEP_X_InBattleStatus_addInBattleStatusCommand = Window_ActorCommand.prototype.addEquipChangeCommand;
       Window_ActorCommand.prototype.addInBattleStatusCommand = function () {
           if (this._cmdContext === null) {
               return Bobstah.BattleCmds.YEP_X_InBattleStatus_addInBattleStatusCommand.call(this);
           }
           if (this._cmdContext.hide === true) {}
           var icon = this._cmdContext.iconOverride || null;
           var name = Yanfly.Param.IBSCmdName;
           this.addCommand(name, 'inBattleStatus', true, null, icon);
           return true;
       };
    
       Bobstah.BattleCmds.YEP_X_InBattleStatus_createActorCommandWindow = Scene_Battle.prototype.createActorCommandWindow;
       Scene_Battle.prototype.createActorCommandWindow = function () {
           Bobstah.BattleCmds.YEP_X_InBattleStatus_createActorCommandWindow.call(this);
           var win = this._actorCommandWindow;
           win.setHandler('inBattleStatus', this.commandInBattleStatus.bind(this));
       };
    
       Scene_Battle.prototype.onInBattleStatusCancel = function () {
           this._helpWindow.hide();
           this._inBattleStatusWindow.hide();
           this._inBattleStateList.hide();
           this._inBattleStateList.deactivate();
           this._actorCommandWindow.activate();
           this._statusWindow.deselect();
           if (Imported.YEP_X_PartyLimitGauge) {
               $gameSystem.setShowPartyLimitGauge(this._showPartyLimitGauge);
               $gameSystem.setShowTroopLimitGauge(this._showTroopLimitGauge);
           }
       };
       Scene_Battle.prototype.commandInBattleStatus = function () {
           this._helpWindow.show();
           this._inBattleStatusWindow.show();
           this._inBattleStateList.show();
           this._inBattleStateList.activate();
           var actor = BattleManager.actor() ? BattleManager.actor() : $gameParty.battleMembers()[0];
           this._inBattleStateList.setBattler(actor);
           if (Imported.YEP_X_PartyLimitGauge) {
               this._showPartyLimitGauge = $gameSystem.isShowPartyLimitGauge();
               this._showTroopLimitGauge = $gameSystem.isShowTroopLimitGauge();
               $gameSystem.setShowPartyLimitGauge(false);
               $gameSystem.setShowTroopLimitGauge(false);
           }
       };
    }
    
    
    Example: i34-battlestatus!

    @Bobstah
    Also it seems there is a bug, when you don't want to show icons. Even when the "Show Icons" Parameter is set to 0, the command text will be pushed to the right, because it will still add the icon width to the x position.
    Here is a fix for that. Just find that function inside the plugin and replace it.
    Code:
    Window_ActorCommand.prototype.drawItem = function(index) {
        var icon;
        if (Bobstah.Param.BattleCommandList_ShowIcons === 0) {
            icon = null;
        } else {
            icon = this.commandIcon(index);
        }
        var rect = this.itemRectForText(index);
        var align = this.itemTextAlign();
        this.resetTextColor();
        var nx = rect.x;
        var nw = rect.width;
        if (Bobstah.Param.BattleCommandList_ShowIcons === 1) {
            var iconPadding = Bobstah.Param.BattleCommandList_IconPadding;
            // Only offset the command text x position, when show icons is enabled
            nx += iconPadding + Window_Base._iconWidth;
            nw -= iconPadding + Window_Base._iconWidth
        } else {
            var iconPadding = 0;
        }
     
        if (icon !== null) {
            this.drawIcon(icon, rect.x, rect.y);
        }
        this.changePaintOpacity(this.isCommandEnabled(index));
        this.drawText(this.commandName(index), nx, rect.y, nw, align);
        if (this.commandCostShow() && this._list[index].symbol === "customSkill") {
            this.drawCommandCost(this.commandExt(index), rect.x, rect.y, rect.width);
        }
        return;
    };
     
    Last edited: Jul 6, 2018
  8. BloodletterQ

    BloodletterQ Chaotic Neutral Assassin Veteran

    Messages:
    1,461
    Likes Received:
    1,052
    Location:
    My head's in the clouds at least...
    First Language:
    English
    Primarily Uses:
    N/A
    I have a few questions:
    -How can I add the escape command to the actor command?
    -How can I make the help menu come up for all commands?
     
  9. waynee95

    waynee95 Lunatic Coder Veteran

    Messages:
    640
    Likes Received:
    527
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    @BloodletterQ
    Just give a skill the Special Effect: Escape and then add that skill to the command window using iX-Skill:ID!

    The help window comes up only if the command has a description.
     
  10. wrap

    wrap Villager Member

    Messages:
    9
    Likes Received:
    6
    First Language:
    Japanese
    Primarily Uses:
    RMMV
    Hello. I translate Japanese into English by Google translation.
    This plugin can be done very well.
    However, I hope to improve some functions.
    I uploaded a video.


    1. When I change LineHeight, Icon position is not displayed correctly.
    Also, only the default Command icon (in this case, GUARD) is a bit dark?

    2. Selecting an ally Actor When you cancel a skill (in this case, HEAL), it is returned to the first.

    3. The added Command is not Command remembered.
    The default Command is Command remembered.
     
  11. SoSick.

    SoSick. Veteran Veteran

    Messages:
    223
    Likes Received:
    190
    Location:
    UK
    First Language:
    english
    Primarily Uses:
    RMMV
    Wow this plugin looks dope.. Just a question before I give it a whirl.. Will it be possible for to me create a limit break system with this? Very similar to ff7.. I would like it so once TP reaches 100 attack is replaced with limit..then once the player selects limit they can choose from limit skills they have learned? Thanks :)
     
  12. BloodletterQ

    BloodletterQ Chaotic Neutral Assassin Veteran

    Messages:
    1,461
    Likes Received:
    1,052
    Location:
    My head's in the clouds at least...
    First Language:
    English
    Primarily Uses:
    N/A
    @waynee95 I'm curious if there's a way to add a description to all the commands, including escape, item and the like.
     
  13. Alchemancy

    Alchemancy Terra Incognita Veteran

    Messages:
    47
    Likes Received:
    6
    Location:
    United States
    First Language:
    English
    Primarily Uses:
    RMMV
    I'm having problem with this plugin involving the STypes commands. I'm also running YEP_SkillCore if that makes a difference.

    Each character has some MP skills and TP skills. I have them sorted into their own skill types for field menu purposes (called Spells and Techniques, respectively.) I turned on the plugin and added the following notes to a class:

    <Battle Commands>
    i22-Attack
    i8-Guard(Defend)
    i7-STypes(Specials):11,12,13,14,15,16,77,78,79,80,81,82,83,84,85,86
    i6-Items
    </Battle Commands>

    Skills 11-16 are my MP abilities and 77-86 are my TP abilities. In theory, this should show all 16 skills under a single menu called Specials. It does not. In the field menu, there is now a skill set called Specials above Spells and Techniques. Specials shows an empty skill list, though the other two still have the aforementioned skills. In battle, the Specials menu doesn't appear at all. It only shows Attack, Defend, and Items. The icons work fine. What have I done wrong? I thought this was a basic function of the plugin. Nothing is sealed, and all the abilities are already taught to the class/actor.

    Any help is greatly appreciated. Thanks!
     
  14. SuperMasterSword

    SuperMasterSword That Guy You Dont Know Veteran

    Messages:
    117
    Likes Received:
    48
    Location:
    Awesomeville
    First Language:
    Javascript
    Primarily Uses:
    RMMV
    @Alchemancy That's not how the STypes command works, all you have to put after it is the id's of Spells and Techniques in the STypes list in the database.
     
    Veno and waynee95 like this.
  15. Alchemancy

    Alchemancy Terra Incognita Veteran

    Messages:
    47
    Likes Received:
    6
    Location:
    United States
    First Language:
    English
    Primarily Uses:
    RMMV
    Thanks, @SuperMasterSword . I now understand that the IDs used in STypes are for the types, not the skills themselves. Silly me! They are grouped correctly now in combat under Specials.

    Unfortunately, this poses another problem. They are no longer separated in the field menu under Spells and Techniques. They are combined into Specials, just like in the battle command menu. Is there a way to differentiate? I'd like to keep the original skill types for the field menu only. Possible? Thanks.
     
  16. SuperMasterSword

    SuperMasterSword That Guy You Dont Know Veteran

    Messages:
    117
    Likes Received:
    48
    Location:
    Awesomeville
    First Language:
    Javascript
    Primarily Uses:
    RMMV
    @Alchemancy Changing the Skill Menu STypes parameter to 0 should fix it I think.
     
  17. Alchemancy

    Alchemancy Terra Incognita Veteran

    Messages:
    47
    Likes Received:
    6
    Location:
    United States
    First Language:
    English
    Primarily Uses:
    RMMV
  18. Alchemancy

    Alchemancy Terra Incognita Veteran

    Messages:
    47
    Likes Received:
    6
    Location:
    United States
    First Language:
    English
    Primarily Uses:
    RMMV
    Ah! Another problem. I'm not sure how to classify this. I'm using this script in conjunction with YEP_X_ActorPartySwitch (as well as its prerequisite scripts, BattleEngineCore and PartySwitch.) I want individual party members to be able to switch to and from the back row (a la Final Fantasy X.) The code can achieve this as a class/actor level command, so any given battlers menu shows:

    iX-Attack
    iX-Guard
    iX-Skills
    iX-Items
    iX-Switch

    I've successfully given the first four commands icons with BOB's code, but can't seem to give Switch one. It's technically not a skill, so I don't know if I should even list it under <BattleCommands>. I've also tried using ARP_CommandIcons, and arranged all these in different orders in the Plugin menu to achieve different outcomes. I still can't seem to give the Switch command an icon. Does anyone know a work-around for this?

    I ask this here because it Switch has an icon when BOB's script turned OFF. It seems to override it.
     
  19. phamtruong1992

    phamtruong1992 Mage Art - Green Dragon Veteran

    Messages:
    154
    Likes Received:
    185
    Location:
    South Asia
    First Language:
    English
    Primarily Uses:
    RMMV
    The link has been broken. Could you repost it? Thanks in advance my dude.
     
  20. waynee95

    waynee95 Lunatic Coder Veteran

    Messages:
    640
    Likes Received:
    527
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    phamtruong1992 likes this.

Share This Page