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

● ARCHIVED · READ-ONLY
Started by ramza 126 posts Page 6 of 7 View original ↗
  1. My guess, just from a quick glance at the first post and your list here, would be that it's not working in battle because you don't have Yanfly's Battle Core installed. Sorry if I'm mistaken. If I'm not, I hope this helps.
  2. BlueVikingr said:
    My guess, just from a quick glance at the first post and your list here, would be that it's not working in battle because you don't have Yanfly's Battle Core installed. Sorry if I'm mistaken. If I'm not, I hope this helps.
    My mistake, its battle core
  3. Ah, I see. Sorry.

    Do you also have Yanfly's Core plugin? Because I think the Battle Core requires that to work, and it not being there could affect things. Other than that, I have no more possible ideas. Sorry...
  4. Dcraft said:
    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
    Forgive my formatting as I'm on mobile. You mentioned specifically that you have the autopassive states plugin, but not BuffStatesCore. I suspect that is the problem, as that plugin is needed for the block passive state to work, it uses the special state note tags to perform the actual math and animation for blocking.

    You also don't mention anything about using the block state, so just in case, in the plugin help, there is a section with some note tags that need to be on your block state for it to do anything.

    The flow of this plugin goes as follows:
    • An attack selects a battler
    • The attack is checked to see if it is blockable
    • The target is checked to see if he has the block state, and that his block chance is greater than zero
    • If the above check passes, a block check is made during the action result, adding the possibility of a block to occur
    • If the action result confirms a block has happened, the block states custom react effect is enabled.
    • The react effect checks the block % of the battler, and removes that % from the incoming damage.
    • The react effect removes the block value number from the remaining incoming damage value
    • The remaining incoming damage value is dealt to the battler. A motion guard is requested, and the block animation from the shield note tag is played on the target.
    If the BuffsStatesCore plugin isn't used, the react effect note tag does nothing, and you get no block effect, even though the action result will show a block result.
  5. After installing BuffStatesCore is perfectly working now, thanks for the help
  6. I am trying to have certain armor(off-hand weapons) sometimes bypass Blocking/Shields.

    I thought initially that <Lower Block: x> was for this, but upon reflection realized that would be more of a debuff effect, exuded through an applied state, or cursed armor.

    That said, is there currently a way to assign a notetag-variable to Armor/Enemy that could be used to reduce their Block % in the Custom React you have created?

    Either way, thank you for this awesome code. I love shield specialist in RPGs and your work here has me pretty excited.
  7. @Grunwave
    You could use a passive state on the shield piercing weapon, and then a before and after eval on every skill that checks of the state is present, then does a random roll and adds <unblockable> to the skill being used (and then removes the tag in the after eval.

    It's important that this unblockable tag is added before the damage goes through, as the action effect checks if the skill is blockable first thing in the sequence.

    Obviously, this method is a little hacky, but it should work without having to make an update to the plugin.

    I hadn't considered shield piercing equipment, or skills before, so I will see if I can streamline this a bit better and add it to the plugin. No Guarantees on how long it takes me, though.
  8. Shield Block has been updated to v 2.20 with the following changes:

    • Added a new note tag for weapons, enemies, and states; <SHIELD PIERCE: x>. An attacker's total shield pierce value from all sources is subtracted from a defender's block chance during the action result, reducing the chance for the defender to block to a minimum of 0%.
    • Added function to all actors getPiercing() which returns the sum of all sources of shield piercing on the actor.
    • Updated documentation to include YEP_BuffsStatesCore as a required dependency. This has always been the case, but it was never listed in the dependency section of the plugin help before.
    • Revision a: Fixed the <BLOCK CHANCE: x> note tag to properly take a negative value, meaning you no longer need to use <LOWER BLOCK CHANCE: x> specifically to lower the block chance. The <LOWER BLOCK CHANCE: x> note tag remains unchanged and available to people who were already using it.
    • Revision b: Fixed a crash error that would happen whenever a battler that can block (has the block state) was targeted by an attack that could be blocked.
  9. Thanks again Ramza =)

    This has literally added a whole new layer to my combat system.

    Does <SHIELD PIERCE: -x> function? I think I want to make my bow weapons weak to shields =)
  10. It doesn't yet, but it'll be a simple task for me to change that for you when I get home tonight.
  11. Block chance has been updated to v2.21 with the following changes:
    • <SHIELD PIERCE: x> note tag has been modified to allow negative shield pierce values, this causes the reverse of the original effect to happen. A defender being attacked by an attacker with a negative shield pierce value will have an increased chance to block of x%. Note that if the defender couldn't normally block, this effect does not grant them the ability to block.
  12. This forum needs a love button.
  13. @ramza Any way we can place both block percentage and block rate in Yanfly's status core? I see you have a mod to Yanfly's status core that allows for rate but not percentage.
  14. @Johnboy I posted a little snippet a few pages back for people who weren't using the dual wield and dual wield menu extensions to still be able to show block chance on the attributes page.
    Getting it to work with the blockpercentage is a little different, as the only source of this value is the equipped shield. I modified that snippet below, to check first if the actor has the block state, and then if their shield exists, and then checks for the blockPercent value, showing it as a % (100 value being 100%). Even if you're using the dual wield and menu extension plugins, you should still be able to load this plugin after the menu extension, and it should still work (although I haven't tested it). The shortcode for showing the blockPercentage is blkp edit the big capital letters in the snippet to change what the long name is.

    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;
            case 'blkp':
            this.drawAttributeName('PUT THE DESIRED LONG ATTRIBUTE NAME HERE', dx, dy, dw);
            if (this._actor.isStateAffected(Ramza.BlockParams.blockStateId) && this._actor.equips()[1] && this._actor.equips()[1].blockPercent){
                this.drawAttributeRate((this._actor.equips()[1].blockPercent / 100), 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
            }
    }
  15. @ramza Thanks. You're awesome.
  16. Man I love this plug in. I don't understand why it isn't part of the main engine.

    @ramza Would it be possible to add or remove a state if an attack is blocked or not blocked? That would allow for some uber awesome shield block passives that I'm planning for my project. (Should be compatible with Yanfly's passive states) :LZSsmile:


    Example:

    <add state blocked: x>
    Adds state with ID x when successfully blocked an attack.

    <add state not blocked: x>
    Adds state with ID x when failed to block an attack.

    <remove state blocked: x>
    Removes state with ID x when successfully blocked an attack.

    <remove state not blocked: x>
    Removes state with ID x when failed to block an attack.


    And if you are willing to implement this into your plugin there could be added some more distinctions like:

    <add state blocked physical: x>
    Adds state with the ID x if a physical skill is successfully blocked.

    <remove state not blocked magical: x>
    Removes state x if a magical skill is not blocked.

    And I have a question. Is it possible to have a passive state that would allow the user to be able to block magical attacks aswell? Perhaps with the regular % block chance or a custom eval?

    I do not know how hard it would be to implement all of this but I leave it as a suggestion/request. :LZSsmile:
    I would be very happy though to have the basic state triggers available.:kaoluv:

    Cheers :kaohi:
  17. @XZINED I'm glad you like it. This was one of my largest problems with the default engine, along with improper dual wielding implementation. After dealing with it for a while, I had no choice but to fix it myself. lol.

    As for what you're asking, those things are actually possible already, just not in what I'd consider an elegant way. Adding or removing states when an attack is blocked can be done in two ways:
    1. A passive state on the actor that triggers on react effect with a higher priority than the block state.
    2. Built into the block state react effect itself.
    For the first one you can make a passive state that has a react effect and uses the same sort of if condition that the block state itself uses. target.result().isBlocked() is true if an incoming attack has been blocked. Combine this with a check on the incoming attack to see if it was physical, or magical, or of a certain element or whatever, and then add or remove states as needed.

    Your second request about allowing magic to be blocked is also possible using methods already built into the plugin, but again, in a very not so elegant way. First, if you want your magical block chance to be different from your physical block chance, you need a state that adds or removes block chance %, it'll only be used briefly, and won't stay on the actor for more than a fraction of the incoming action phase. We also need yet another passive state, which causes the effect to happen in the first place (this'd be your passive from a skill or held item or whatever).

    That passive state is what we use to activate the effect. We use custom select and deselect effects to make a magical skill blockable conditionally, during the phase of the battle where the actor with the state is being targeted.

    Code:
    <Custom Select Effect>
    if (this.item() && this.isForOpponent()) {
      if (this.isMagical()){
        this._formerBlockable = this.item().blockable;
        this.item().blockable = true;
        target.addState(x)
      }
    }
    </Custom Select Effect>
    <Custom Deselect Effect>
    if (this._formerBlockable){
      this.item().blockable = this._formerBlockable
      this._formerBlockable = undefined
      target.removeState(x)
    }
    </Custom Deselect Effect>
    What we're doing in this code block is making an incoming skill blockable, and then adding a state to the actor to modify is block chance (state id X), then when the attack has concluded, the blockable trait is changed back to the way it was previously, and the block % state is removed from the actor.

    Obviously note tags are a much more user friendly way to accomplish this, but with a little bit of thinking outside of the box, you can hack in a lot of features as well.
  18. @ramza Wow, thank you very much for your fast and detailed reply!

    I didn't know that so many things can be done already with your plugin! Thank you for explaining it. Maybe it would be worth to include it somewhere in your plugin description.

    At the moment I am not able to test this yet. But when I did I will give feedback if it worked. :LZSsmile:

    Maybe one day you will find the motivation to implement that features, that are basicly already existant, into your plugin. Then more noobs like me could utilize them "out of the box".
    But for now I'm happy that I can most likely realize my ideas. :LZSsmile:

    Thanks again! :kaohi:
  19. Hey. Having a small issue with the Parry add-on plugin.
    Both the Dualwield plugin and shield block plugin work fine but for some reason the parry add-on seems to cause my game to crash on start up.

    Here's the current set-up
    Reality Chronicles - RPG Maker MV 8_4_2019 5_08_36 PM.png

    And the syntax error I keep receiving
    Reality Chronicles 8_4_2019 5_09_24 PM.png
    Please Help. I'm not sure what's wrong.
  20. Intret said:
    Hey. Having a small issue with the Parry add-on plugin.
    Both the Dualwield plugin and shield block plugin work fine but for some reason the parry add-on seems to cause my game to crash on start up.

    Here's the current set-up
    View attachment 120611

    And the syntax error I keep receiving
    View attachment 120612
    Please Help. I'm not sure what's wrong.

    Hello, sorry for the delay on responding to you.
    It looks like when I updated the plugin to v1.01 I fatfingered a regex statement on the note tag reading. Replace line 282 with the following line to correct the problem immediately:
    Code:
    var note1 = /<(?:PARRY CHANCE):[ ]*([+-]?\d+)>/i;
    I have also updated the plugin on itch, or rather, it will be updated shortly, so by the time you read this message, redownloading the plugin should also correct the problem.