Ramza's Shield Block Plugin -UPDATED APRIL 3 2019-

● ARCHIVED · READ-ONLY
Started by ramza 126 posts Page 5 of 7 View original ↗
  1. Tatsumaro said:
    Hi ramza, thanks for all the work. So i'm testing the codes and:
    • i'm really not familiarized with java coding and steal training to embrace all this RPG MAKER " dialect " can you please correct my reading of the code?
      Code:
      <Select Conditions>
      // this is the state i create for the Shield Block Plugin, i think
      state: 36
      </Select Conditions>
      <After Eval>
      if (!target.isEnemy()){
      // "_equips[X]" X bing the number for the Armor Types in Types
      target._equips[1].setObject(null)
      } else {
      // im not even going to trai understanding what is this :)
      target.addParam(3, -10)
      //maybe add a state to the target to reduce block chance by 100%?
      }
      </After Eval>
    • steal in the Shield Break i have done some testing and the results are:
    1. the defense points of the character decrease after the ataque
    2. target._equips[1].setObject(null) removes the armor, i rely talking about the clouding, the actor is naked ate the battle end. The shield is in Armor Types 1 but in Equipment Types 3, if i create a new Armor Type for the shield i dont have the Seal Equip option in weapons traits.
    3. it targets actors even if its not inflicted whit whit no state: 36, and it steals removes the chest piece
    • the Counter Condition code didn't work i don't know whai.
    target._equips[1] is the equipment item in slot 1 of the target. Slot 1 is the second equipment slot. By default this is the offhand slot (which is to say the shield slot or the second weapon slot if the target is dual wield type). Since you mention that your chest item is being removed, your chest item is probably in slot 1, so change this number to whatever slot your shield actually is in.

    The select condition tag probably isn't working because you need a separate yanfly plugin to use it. YEP_X_SelectionControl.

    The part you have commented as not understanding, is lowering the defense parameter of the target, but only when that target isn't an actor. This allows the shield break skill to have some functionality when an ally uses it on an enemy, as enemies don't have equipment, their shield can't be removed, so their defense param is lowered instead. I also suggested adding a state to the target to lower their block chance, to simulate the shield actually being gone, as, once again, enemies are never actually wielding shields.

    Tatsumaro said:
    All of this takes to my second point in this long text. I saw that you open your "script shop" PERFECT i believe you are the best man for this job :)

    I need 3 things done in my game:
    1. A code that, when switch X is on and all team elements are dead, before the end of the battle, a Skill has 23% chance of reviving all the team members.
    2. I'm using Character Creator EX and
      CCEX Dynamic Actors from SDR to create a more visual look for my game, i need to remove the "shield" of my character arms in battle when is target white Shield Break
    3. some work in the menu related whit Moogle_X_EquipmentLearning, there is a window that i wood like to only appear if is needed and remove the "right" "left" conundra from the menu. This is hard to explain like this, i prefer to make a video explaining everything.
    Please send me a budget, if you want i can sand you my project so you can see what i'm talking about the 2 and 3 "quests" :cutesmile:.

    PS: i also love to hear you feedback of my mechanics.
    My apologies for not responding to this sooner, I didn't get a notification for this reply to the topic, and was pretty inactive for a while there, so I wasn't checking for new posts on them. I'm not sure how much of the above you still need worked on, it was a while ago, after all, but here's my thoughts anyways:

    First one:
    • Dealing with effects in a battle where the battle should end, but doesn't is very tricky. You can use the YEP_X_StateCategories plugin to keep the trigger state from being removed when your actors die. This is needed, as without it, no state will have any effect after the death of an actor.
    • With the above step implemented, you can then give that state a custom deselect effect that checks if the current target is dead, and then if all of the other allies of that target are also dead, and then does a random number check to see if your 23% chance triggers, then revive all allies. If you're feeling lucky, you could even try a force action to give the effect a neat animation or action sequences.
    Second one:
    • I'm not at all familiar with this plugin. If there is a conditional way to not show an armor piece, use that to conditionally only show the shield on the character if they are afflicted with the shield block state (36 from above I think).
    • If that isn't an option, it might not be too difficult to add in, or request that SRD add this functionality into his plugin. But again, though, I'm not at all familiar with this plugin so that may prove to be more difficult than I think.
    Third one:
    • I should never be anyone's first choice for menu work, it takes me forever, and the end result is usually a hardcoded mess that I wouldn't recommend anyone use. Additionally, I'm not familiar with the equipment learning plugin either, you're probably better off looking for someone with more experience with menus to help you out here.
    Also, as a side note, These plugin requests should've probably gone into my script shop topic, not this one, I might've been more likely to see them in a decent amount of time there too. Full disclosure though, I haven't checked that topic for replies before posting this either, so maybe not XD

    Emperor DragonBreath said:
    Ramza, would it be possible to give bucklers a chance of only negating certain attacks? For example, an Iceflame shield(Yes, I did get it from Bravely Default) is guaranteed to negate fire and water (or ice, hence the name) attacks, but has a much lower chance of negating physical attacks that are not of the fire or water(or ice) attributes. Would that be possible, using this plugin?
    If we're being honest, a lot of things are possible with this plugin, sometimes you have to think outside the box to figure them out, though.
    In this case, the plugin is coded in such a way as that a state or an armor can only have one block value. When you make your buckler, it has a 5% chance to block anything that is specified as a blockable attack, as an example. Likewise, any state that increases or decreases block chance does so with a very specific number in mind, that cannot be changed, so a shield mastery type passive state will only ever increase block chance by a flat 10%, as variables aren't possible to feed into that value.
    With that being said, however, there is nothing stopping you from adding a second passive state to your iceflame buckler, that detects an incoming attack as meeting the requirements to be nullified, (ie: being the correct element) and then applies a third state that adds 100% block chance, and then removes that state on a deselect effect.

    Picture it like this:
    • Iceflame Buckler has a base 5% block chance
    • It has two passive states that the player never sees:
      • The block state from my plugin, which allows the shield block things
      • Fire/Ice null which is used to provide the extra blocking effect against ice/fire attacks.
    • The second state is used exclusively to set up our extra resistance to ice/fire, which itself is a third state with a <Block Chance: 100> tag on it.
    • Because a passive state is generally always active, we can use it to detect any incoming attacks on the target, before they hit, and change the incoming damage result accordingly, using a <Custom Select Condition> note tag. It might look something like this:
      Code:
      <Custom Select Condition>
      var fire = 3
      var ice = 4
      var elements = this.getItemElements();
      // Check if the elements contains fire or ice
        if (elements.contains(fire) || (elements.contains(ice)) {
      //add state 50 to the target of the attack
         target.addState(50)
        }
      </Custom Select Condition>
      <Custom Deselect Condition>
      //remove the state when the attack has concluded
       target.removeState(50)
      </Custom Deselect Condition>
    • Note that I used state id 50 as a placeholder in the above code, change it whatever your third state will be (the one with a <block chance: 100> note tag.
  2. Hey there Ramza, so I sort of tracked down a bug and was really hoping there was an easy fix, this plugin is so perfect for my project I don't know what I would do with out it.:smile: So I have been getting a crash when the block is used in battle, this used to work perfectly btw. Here's an example of the error.
    Code
    TypeError: Failed to execute 'createLinearGradient' on 'CanvasRenderingContext2D': float parameter 3 is non-finite.
    at TypeError (native)
    at Bitmap.gradientFillRect (file:///C:/Users/Miah/Documents/Games/Gladatora/js/rpg_core.js:1287:24)
    at Bitmap.gradientFillRect (file:///C:/Users/Miah/Documents/Games/Gladatora/js/plugins/YEP_CoreEngine.js:941:41)
    at Window_BattleStatus.Window_Base.drawGauge (file:///C:/Users/Miah/Documents/Games/Gladatora/js/plugins/YEP_CoreEngine.js:2188:17)
    at Window_BattleStatus.Window_Base.drawActorHp (file:///C:/Users/Miah/Documents/Games/Gladatora/js/rpg_windows.js:555:10)
    at Window_BattleStatus.Window_Base.drawActorHp (file:///C:/Users/Miah/Documents/Games/Gladatora/js/plugins/YEP_SkillCore.js:1186:44)
    at Window_BattleStatus.Window_Base.drawActorHp (file:///C:/Users/Miah/Documents/Games/Gladatora/js/plugins/YEP_X_SkillCostItems.js:899:42)
    at Window_BattleStatus.drawGaugeArea (file:///C:/Users/Miah/Documents/Games/Gladatora/js/plugins/YEP_BattleStatusWindow.js:562:10)
    at Window_BattleStatus.drawItem (file:///C:/Users/Miah/Documents/Games/Gladatora/js/plugins/YEP_BattleStatusWindow.js:533:10)
    at Window_BattleStatus.processStatusRefresh (file:///C:/Users/Miah/Documents/Games/Gladatora/js/plugins/YEP_BattleEngineCore.js:5291:10)

    What I was able to track the problem down to is interaction between either yanflys buffstatecore plugin or yanfly's equip core plugin. I say either because it actually works if either one is disabled but if both are enabled your plugin crashes. However if buffstate core is disabled leaving equip core active the animation for the block doesn't play.

    I tried with yanflys old versions of those plugins and it still crash which leads me to believe it is because of the 1.5.2 rpg maker update which I am using. Also I don't think it matters but I am still using that line of code you gave me on the previous page to patch the block stat back into the yanfly status menu core but that doesn't seem to be affecting anything. I did try putting your plugin below both of those but no luck there.

    Well bud love your plugin I really really hope we can get this fixed.:smile: Let me know if you need any other info from me.
  3. In my experience, a n error involving that linearGradient function happens when the HP gauge tries to draw a gauge value that isn't valid. I haven't run into this issue myself as of yet, and I can't really reproduce it, but I suspect it might be an issue with the block % plugin parameter. Are you using that?
  4. Yeah I do use the block % param. I have it set to 100% in the plugin itself but also have shields that block 50% both have been triggering the crash. I've had what you described in the past as well with the hp gauges causing the linearGradient crash but I think that might have had a different float point, can't remember for sure though.
  5. Alright, now that I've slept, let's try to fix this for you.

    First of all, please ensure your notetag on your shield for the block percentage looks like this:
    <BLOCK PERCENT: 50>
    Note that there should be no '%' sign in the tag. The same goes for the plugin parameter.

    RMMV sometimes goes crazy with rounding problems, so if your project is using some high damage numbers, it might end up with a tiny decimal number attached to a value you shouldn't have, which will cause the gradient error when the current hp is anything other than an integer.

    I know it's likely that you're using the cut and paste version of the state I have posted in here, but I want to make sure, please post your note tags for the block state.

    My block state has a Math.round() function in it, which is probably why I can't reproduce this, and the state is where the damage is calculated.
    Code:
    <Custom React Effect>
    var blockValue = (target.isEnemy() ? target.enemy().blockValue : target.equips()[1].blockValue)
    var blockPercent = (target.isEnemy() ? target.enemy().blockPercent : target.equips()[1].blockPercent)
    if (target.result().isBlocked()) {
     target._blocked = true
        value -= Math.round(value * (blockPercent/100));
        value -= blockValue
        value = Math.max(value, 0)
        var blockAnim = (target.isEnemy() ? target.enemy().blockAnimation : target.equips()[1].blockAnimation)
          target.startAnimation(blockAnim, true, 0);
          target.requestMotion('guard')
      }
    </Custom React Effect>
    <Custom Deselect Effect>
     target._blocked = undefined
    setTimeout(function () {
     target.requestMotion('walk')
    }, 180);
    </Custom Deselect Effect>


    As an aside, I was having an issue where block chance was showing up on the status menu core as a crazy decimal (30.000001%) because of this rounding error dividing a whole number by 100 and ending up with a small leftover fraction.
  6. Yep I am using the correct <Block Percent: 50> tag, no % there. As for the high damage numbers I am testing on level 1 characters which do between 100 and 200 damage. Also I am using your code copy pasted for the state, I even re copied and pasted it yesterday in my testing t be sure. I'll paste the code below just to be sure.

    State Code
    <Custom React Effect>

    var blockValue = (target.isEnemy() ? target.enemy().blockValue : target.equips()[1].blockValue)

    var blockPercent = (target.isEnemy() ? target.enemy().blockPercent : target.equips()[1].blockPercent)

    if (target.result().isBlocked()) {

    value -= Math.round(value * (blockPercent/100));

    value -= blockValue

    value = Math.max(value, 0)

    var blockAnim = (target.isEnemy() ? target.enemy().blockAnimation : target.equips()[1].blockAnimation)

    target.startAnimation(blockAnim, true, 0);

    target.requestMotion('guard')

    }

    </Custom React Effect>

    <Custom Deselect Effect>

    setTimeout(function () {

    target.requestMotion('walk')

    }, 180);

    </Custom Deselect Effect>

    This just recently started happening for me, I've been using the plugin for a while now and it was always fine before. That's why I think it must have had something to do with the 1.5.2 update breaking something since the old versions of the conflicting plugins doesn't work anymore either. I haven't personally noticed the issue you talked about with the block chance showing wrong but since I've been testing this I've kept the block patch for the status window tuned off.
  7. Are you using that Core updates and optimization plugin from Yanfly as well?

    This plugin directly changes some functions of the battle system, and needed to be placed directly below battle engine core because several other plugins make further changes to these same functions. It's possible the optimization plugin also overwrites some of the same functions and is causing this problem somehow.

    I'm really at a loss as to how the 1.5.2 update could've broken this plugin. I'm on that update as well and have no issues.
  8. Nope I'm not using the Core updates and optimization plugin from Yanfly. I tried but it currently doesn't play well with srd's super tools.:smile: I guess I could be wrong that it's caused by 1.5.2 but if that's the case I'm also at a loss because it worked perfectly before I updated and I tested by removing every plugin but the 4 which are yanflys BattleEngineCore, then your plugin then the buffstatecore and the equip core.I'm sorry I haven't been more helpful here, side note I am not sure I mentioned this but it only happens when an enemy attacks a player who has the block skill, not if the enemy blocks a players attack.
  9. @Jeremiah Eastman Alright, I think I figured out what's going on. At least I hope I did. Let's do some testing, shall we?
    First, some questions:
    How are you testing this? Are you using test battle? Or are you loading a save file? Or do you start a new game each time?
    In your testing scenario, I want you to get to a point where it always crashes, (ei: load the same save that always crashes, test that it crashes, reload). Then I want (before it crashes) for you to open the console and type $gameParty.members()[X].equips()[1].blockPercent into the console. This should return the blockPercent of your shield into the console:

    upload_2018-4-9_7-53-53.png
    Note the id used should be the position in the party of the actor you're checking. If you get an undefined message, check to make sure the actor in slot X is actually wearing a shield.

    My plugin has a parameter to set the default blockPercent value on what turns out to be all armor, so even if your shield doesn't have the <BLOCK PERCENT: x> tag on it, it should still get the default value written to it.

    The next thing to do is to add to the block state note tag. As you mentioned the issue doesn't happen to enemies, that would seem to imply to me that when it's trying to grab the blockPercent value from your shield, it's pulling undefined, which it then divides by 100, then multiples the damage value by the result (value * (undefined/100)) == value * NaN == NaN). Subtracting a value that is Not a Number from your HP will cause your HP to also be NaN, which will cause the gauge to throw an error and the game to crash.

    With that being said, backup your old note tag ( just in case) and replace it with the following:
    Code:
    <Custom React Effect>
    var blockValue = (target.isEnemy() ? target.enemy().blockValue : target.equips()[1].blockValue)
    var blockPercent = (target.isEnemy() ? target.enemy().blockPercent : target.equips()[1].blockPercent)
    if (target.equips()) {console.log(blockPercent, target.equips()[1].blockPercent)}
    if (target.result().isBlocked()) {
     target._blocked = true
        value -= Math.round(value * (blockPercent/100));
        value -= blockValue
        value = Math.max(value, 0)
        var blockAnim = (target.isEnemy() ? target.enemy().blockAnimation : target.equips()[1].blockAnimation)
          target.startAnimation(blockAnim, true, 0);
          target.requestMotion('guard')
      }
    </Custom React Effect>
    <Custom Deselect Effect>
     target._blocked = undefined
    setTimeout(function () {
     target.requestMotion('walk')
    }, 180);
    </Custom Deselect Effect>

    As I understand it, the game crashes whenever an actor that can block is hit, whether or not they successfully block. That is also pointing me toward the issue of the shield not actually having a blockPercent value on it. The first two lines in the react effect take place before it checks to see if a block actually happened, but with the error you're seeing, it would appear that it's simply passing undefined through to the next step of the calculation, instead of crashing immediately. Our console log note here should output the following:
    <- 100, 100
    What I expect we'll see is either nothing at all, or undefined, undefined

    Edit:
    I suspect the following things as the cause of this problem right now:
    • You're testing using an old save which didn't have your shield as a database item when the save was created, therefore the shield has not had it's notetags read, and doesn't have the default blockPercent value on it.
    • Your actor isn't wearing a shield at all, or it's in a slot that isn't slot 1. The state note tag was designed to be placed on a passive state that is only active if the actor is wearing an item in equipment slot 1.
    • One of those plugins you narrowed the problem down to is overwriting my function that reads note tags, causing none of the default values to be written to the armors in your database. (This one seems hard because those same functions also write the block params to enemies, which seem to work fine)
    • One of those plugins listed, or another plugin that interacts with items using equipcore is removing my extra parameters from armors after the database is loaded.
    • Your <BLOCK PERCENT: x> note tag is typo'd, and you changed the default blockPercent value in the plugin parameters from the default (100) to a blank space. (This seems pretty unlikely though)
  10. Hey there I am not able to test it right now but I thought I would answer a couple of your questions really quick. For testing I always start a new game. On my shields that have 100% for Block percent I don't use a block percent tag I let the plugin parameter take that but the shields with a 50% block percent I add the tag.

    No it doesn't crash when attacking a person who can block unless they block. After I realized it was an issue with blocking to make testing easier I upped the block chance to 100% so it would then crash every time the person is attacked but it was definitely not happening when an attack is not blocked.

    You said:
    • Your actor isn't wearing a shield at all, or it's in a slot that isn't slot 1. The state note tag was designed to be placed on a passive state that is only active if the actor is wearing an item in equipment slot 1.
    This is an interesting one, I recently had to move a different equipment slot that had been at the end of the equipment to the the first spot in the list to fix an issue I was having. So the old structure looked like,
    Weapon
    Shield
    Arm
    Leg
    Bond

    which I changed to,

    Bond
    Weapon
    Shield
    Arm
    Leg

    This was the only fix I could find to keep the bond slot from unequipping during a class change, that slot once filled is supposed to never be unequipped. This sounds like a good culprit but could that be affected by those plugins? Remember that with both of those other 2 plugins active it doesn't work but if either is off it works.
  11. That's definitely the culprit. It'd be pulling 'undefined' from the item in slot 1, which is your weapon, because the weapon doesn't have a blockPercent value. I suspect one of those plugins is actually what you used to change the equipslots in that way (equipcore does this I think).

    You can probably change the block note tag to check slot 2 instead of 1. I'm not sure what else will be messed up by this change though. At the very least, changing it to check slot 2 will stop this crash. If you run into anything else, I can probably lend some insight as to what needs changing.

    Edit: I can tell you for sure that putting your weapon in slot 1 and your shield in slot 2 is super incompatible with my other plugins, specifically the dual wield one.
  12. Sweet thank you very much for putting up with me.:smile: I'll give switching the note tag a shot and do some testing. And yeah it was equip core that allowed me to switch the slots that way. Big thanks for your help in all of this.
  13. Hello there Ramza!

    I've got a really simple question. I don't know if I overlooked the scripts recomendations but I can't find no way to translate the "Block" as a parameter - my game is in portuguese language originally so I would like to translate this, but there's no way on the plugin configuration to change the name of the Block parameter in-game. Since I understand virtually nothing about plugins, I would like to ask how I can change the parameter name on the plugin.

    Thanks!
  14. @SergeX I don't have a plugin param for changing the name of the exparam built into this plugin, as it doesn't by default show any information. I did share this 'patch' on the fourth page which adds it to the status menu core screen. replace the all caps text with whatever your desired text would be. Copy everything inside the code tag, paste it into a blank .js file, add it to the plugin manager directly below the block plugin.
    ramza said:
    Alright, so I can certainly redo the dirty edit I made originally again for the newer version, but it might be easier with a patch instead.

    So paste the following code into a blank .js file, and import it into your plugin manager BELOW the statusmenucore script.
    Code:
    Ramza.Wind_StatusInfo_prototype_draw_Attribute_Data = Window_StatusInfo.prototype.drawAttributeData
     Window_StatusInfo.prototype.drawAttributeData = function(attr, dx, dy, dw) {
        switch (attr) {
            case 'blk':
            this.drawAttributeName('PUT THE DESIRED LONG ATTRIBUTE NAME HERE', dx, dy, dw);
            if (this._actor.isStateAffected(Ramza.BlockParams.blockStateId)){
                this.drawAttributeRate(this._actor.blk, dx, dy, dw);
            } else {
                this.drawAttributeRate(0, dx, dy, dw);
            }
            break;
            default:
            Ramza.Wind_StatusInfo_prototype_draw_Attribute_Data.call(this, attr, dx, dy, dw)
            break
            }
    }
    Replace the big capital-lettered section in there with the desired long name for block chance. That should work. Let me know if it doesn't I take a better look.
  15. While I'm not currently 100% sure, I'm fairly certain the custom counter eval from counter control can be used to check the actionresult that just occurred to see if it was blocked, allowing the counter skill to be enabled if it was. A notebox for a skill like that might look something like this:
    Code:
    <Counter Condition>
    Physical hit
    eval: target.result().isBlocked()
    </Counter Condition>

    Hello, im trying to make this work, but whit no results to show :frown: do you think the state can be alter to a If / else condition? traing

    Something like this:

    <Custom React Effect>
    var blockValue = (target.isEnemy() ? target.enemy().blockValue : target.equips()[1].blockValue)
    var blockPercent = (target.isEnemy() ? target.enemy().blockPercent : target.equips()[1].blockPercent)
    if (target.result().isBlocked()) {
    value -= Math.round(value * (blockPercent/100));
    value -= blockValue
    value = Math.max(value, 0)
    var blockAnim = (target.isEnemy() ? target.enemy().blockAnimation : target.equips()[1].blockAnimation)
    target.startAnimation(blockAnim, true, 0);
    target.requestMotion('missile')
    }else{
    if (user.hasSkill(641)) = (target.result().isBlocked()) {
    value -= Math.round(value * (blockPercent/100));
    value -= blockValue
    value = Math.max(value, 0)
    var blockAnim = (target.isEnemy() ? target.enemy().blockAnimation : target.equips()[1].blockAnimation)
    target.startAnimation(blockAnim, true, 0);
    target.requestMotion('missile');
    actor use skill 4
    </Custom React Effect>

    <Custom Deselect Effect>
    setTimeout(function () {
    target.requestMotion('walk')
    }, 180);
    </Custom Deselect Effect>

    You must be laughing so hard from my coding skills :) But what do you think of my idea, the counter skill will always be the same skill, and can only be used if the actor as learned the skill 641
  16. maybe this help.

    <Custom React Effect>
    var blockValue = (target.isEnemy() ? target.enemy().blockValue : target.equips()[1].blockValue)
    var blockPercent = (target.isEnemy() ? target.enemy().blockPercent : target.equips()[1].blockPercent)
    if (target.result().isBlocked()) {
    value -= Math.round(value * (blockPercent/100));
    value -= blockValue
    value = Math.max(value, 0)
    var blockAnim = (target.isEnemy() ? target.enemy().blockAnimation : target.equips()[1].blockAnimation)
    target.startAnimation(blockAnim, true, 0);
    target.requestMotion('missile')
    }else{
    if (
    this._actor.isStateAffected(641) == (target.result().isBlocked())
    {
    value -= Math.round(value * (blockPercent/100));
    value -= blockValue
    value = Math.max(value, 0)
    var blockAnim = (target.isEnemy() ? target.enemy().blockAnimation : target.equips()[1].blockAnimation)
    target.startAnimation(blockAnim, true, 0);
    target.requestMotion('missile');
    BattleManager.queueForceAction(target, 4, 0);
    </Custom React Effect>
  17. Tatsumaro said:
    maybe this help.

    <Custom React Effect>
    var blockValue = (target.isEnemy() ? target.enemy().blockValue : target.equips()[1].blockValue)
    var blockPercent = (target.isEnemy() ? target.enemy().blockPercent : target.equips()[1].blockPercent)
    if (target.result().isBlocked()) {
    value -= Math.round(value * (blockPercent/100));
    value -= blockValue
    value = Math.max(value, 0)
    var blockAnim = (target.isEnemy() ? target.enemy().blockAnimation : target.equips()[1].blockAnimation)
    target.startAnimation(blockAnim, true, 0);
    target.requestMotion('missile')
    }else{
    if (
    this._actor.isStateAffected(641) == (target.result().isBlocked())
    {
    value -= Math.round(value * (blockPercent/100));
    value -= blockValue
    value = Math.max(value, 0)
    var blockAnim = (target.isEnemy() ? target.enemy().blockAnimation : target.equips()[1].blockAnimation)
    target.startAnimation(blockAnim, true, 0);
    target.requestMotion('missile');
    BattleManager.queueForceAction(target, 4, 0);
    </Custom React Effect>
    Does this actually work at all? I've messed with queuing forced actions from inside states like this before and haven't been able to get them to work. Plus, your if condition in the middle there is... problematic. It would make your skill happen if a block happened AND the target had the state, but it'd also happen if a block didn't happen AND the target didn't have the state.You wanna use if (target.isStateAffected(641) && target.result().isBlocked()) for that.

    Lemme mess around with counter control a bit and see if I can find a more user friendly way to get this to work.

    edit:
    Alright, I've dug around with this a little bit and here's what I can find.

    • The action result for blocking is cleared before it can be read by counter control. Meaning defender.result().blocked will always return false, so it cannot be used as a counter condition.
    • Adding a local variable to the block state for the counter control to read instead of the action result sort of works, but the react effect of the state doesn't happen until after a counter condition has been checked, meaning it has no way to read the result until the following turn.
    • An attempt at modifying the action.result() section in my block chance plugin to add a local variable to read after a block has the same issue as above, the local variable is set when a block occurs, but the counter condition is checked before the action result happens, apparently, as the counter won't happen until something else hits the battler after he blocked the first time.
    With this, I have to conclude that using a block as a counter condition seems to be impossible, and I'm not sure I know how to fix it. You might be on the right track with your forced action fix, but forced actions are buggy, and don't play nice with most of the battle systems out there, in fact, they don't work at all in YEP_STB for example.
  18. Hi Ramza, thanks for the help.

    "messed with queuing forced actions from inside states like this before and haven't been able to get them to work" - what about common events? can we call a common event?

    if (target.isStateAffected(641) && target.result().isBlocked()), my code skills suck .

    Maybe you get better luck whit counter control, its a great plugin but i can not make it counter, sometimes it works but is completely random
  19. New in v 2.17:
    • Fixed compatibility with YEP_ExtraParamFormula, an actor's block chance will now no longer be NaN when both of these plugins are loaded. Keep in mind, in order for this fix to work, this plugin must be loaded after YEP_ExtraParamFormula. You should be following the correct load order for all yanfly plugins, and this plugin should be loaded after BattleEngineCore, before your other battle plugins.
    • Revision a; fixed an issue where the parameters scene in the Status menu core would show NaN values for all exparams until the scene had been refreshed at least once (by switching actors).
  20. The block percentage appears correctly in the menu but in combat it does not seem to work (against the default attack) I put it in 100%. Any idea what it can be? Also I started a new project so the only plugins I installed are:
    -yanfly battle core
    -dual weild
    -shield block
    -the menu one
    -yep auto passive state
    maybe you can upload a demo to know what I am doing wrong