Caethyril's MZ Plugins

● ARCHIVED · READ-ONLY
Started by caethyril 209 posts Page 8 of 11 View original ↗
  1. cozathemaster said:
    Is there any way to fix this?

    you could also cheat and alias the "cancel" functions like this:


    Alias the Cancel Functions
    const alias_PKonEnemyCancel = Scene_Battle.prototype.onEnemyCancel;
    Scene_Battle.prototype.onEnemyCancel = function() {
    alias_PKonEnemyCancel.call(this);
    $gameParty.select(null);
    $gameTroop.select(null);
    };


    const alias_PKonActorCancel = Scene_Battle.prototype.onActorCancel;
    Scene_Battle.prototype.onActorCancel = function() {
    alias_PKonActorCancel.call(this);
    $gameParty.select(null);
    $gameTroop.select(null);
    };


    const alias_PKonItemCancel = Scene_Battle.prototype.onItemCancel;
    Scene_Battle.prototype.onItemCancel = function() {
    alias_PKonItemCancel.call(this);
    $gameParty.select(null);
    $gameTroop.select(null);
    };

    That way you don't have to make any edits to existing plugins. Just through that script in its own file below battle Core and any other battle related VS plugins
  2. Puppet Knight said:
    Alias the Cancel Functions
    const alias_PKonEnemyCancel = Scene_Battle.prototype.onEnemyCancel;
    Scene_Battle.prototype.onEnemyCancel = function() {
    alias_PKonEnemyCancel.call(this);
    $gameParty.select(null);
    $gameTroop.select(null);
    };


    const alias_PKonActorCancel = Scene_Battle.prototype.onActorCancel;
    Scene_Battle.prototype.onActorCancel = function() {
    alias_PKonActorCancel.call(this);
    $gameParty.select(null);
    $gameTroop.select(null);
    };


    const alias_PKonItemCancel = Scene_Battle.prototype.onItemCancel;
    Scene_Battle.prototype.onItemCancel = function() {
    alias_PKonActorCancel.call(this);
    $gameParty.select(null);
    $gameTroop.select(null);
    };
    Oh neat! However, I would suggest a scope change to avoid potential naming conflicts (untested):
    edited code
    JavaScript:
    /*:
     * @target MZ
     * @plugindesc Cae_OnUseEffects + VisuStella Battle Core patch.
     * @author Puppet Knight
     * @url https://forums.rpgmakerweb.com/posts/1439065/
     */
    ;void (() => {
    
      const  alias_PKonEnemyCancel = Scene_Battle.prototype.onEnemyCancel;
      Scene_Battle.prototype.onEnemyCancel = function() {
        alias_PKonEnemyCancel.call(this);
        $gameParty.select(null);
        $gameTroop.select(null);
      };
    
      const  alias_PKonActorCancel = Scene_Battle.prototype.onActorCancel;
      Scene_Battle.prototype.onActorCancel = function() {
        alias_PKonActorCancel.call(this);
        $gameParty.select(null);
        $gameTroop.select(null);
      };
    
      const  alias_PKonItemCancel = Scene_Battle.prototype.onItemCancel;
      Scene_Battle.prototype.onItemCancel = function() {
        alias_PKonItemCancel.call(this);
        $gameParty.select(null);
        $gameTroop.select(null);
      };
    
    })();
    Otherwise, if that solves the problem, great! :kaojoy:
    [Edit: corrected a typo pointed out by Puppet Knight in the following post.]


    cozathemaster said:
    I have a question: actually, I only use the "Cae on Use Effects" plugin for the "action Popups" part.

    Is there any possibility of greatly simplifying your plugin so that I can only use those functions?
    In theory you could go through the code and remove or comment out the unwanted sections, starting at the // ========== Alterations ========== // comment.

    Like, there's a part that is commented // +Battle popups //: you would want to keep that. But the 2 parts after it are commented // +Subskills // and // +Target restrictions //: you could try deleting those (and similar), and hope that doesn't break the popup stuff.

    Alternatively:
    cozathemaster said:
    If not, what I absolutely need is the ability to edit the "Popup Width Mult" and the Popup Font Size.
    This may be much easier, especially since those are fixed values. Just need to find the relevant code, which I think is this:
    cae_onuseeffects 1.6 excerpt
    JavaScript:
            // Override! Redefine the popup text seen when an action is missed/evaded.
            void (() => { // unconditional bcuz multiple shared aspects here
                Sprite_Damage.prototype.createMiss = function() {
                    const txt = $.getMissText();
                    if (!txt) return;
                    const h = this.fontSize();
                    const w = Math.floor(h * $.popups.widthMult);
                    const sprite = this.createChildSprite(w, h);
                    sprite.bitmap.drawText(txt, 0, 0, w, h, "center");
                    sprite.dy = 0;
                };
            })();
    
            // Override! Change battle popup font size.
            void (() => { if (!$.popups.fontSize) return;
                Sprite_Damage.prototype.fontSize = function() { return $.popups.fontSize; };
            })();
    Reformatted to remove dependence on other parts of the plugin (untested):
    independent plugin code
    JavaScript:
    /*:
     * @target MZ
     * @plugindesc Change battle popup font size.
     * @author Caethyril
     * @url https://forums.rpgmakerweb.com/index.php?threads/125657/
     * @help Reformatted snippet from Cae_OnUseEffects.
     *
     *  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     * Terms of use:
     *   This plugin is free to use and/or modify, under these conditions:
     *     - None of the original plugin header is removed.
     *     - Credit is given to Caethyril for the original work.
     */
    // Override! Apply width multiplier for "miss" popup.
    Sprite_Damage.prototype.createMiss = function() {
      const txt = "Miss"
      if (!txt) return;
      const h = this.fontSize();
      const w = Math.floor(h * 6);  // apply mult
      const sprite = this.createChildSprite(w, h);
      sprite.bitmap.drawText(txt, 0, 0, w, h, "center");
      sprite.dy = 0;
    };
    
    // Override! Change battle popup font size.
    Sprite_Damage.prototype.fontSize = function() { return 30; };
    (Note that setting the Popup Font Size parameter to 0 causes it to skip that patch, so according to your screenshot you're not actually using that feature.)
  3. caethyril said:
    const alias_PKonItemCancel = Scene_Battle.prototype.onItemCancel; Scene_Battle.prototype.onItemCancel = function() { alias_PKonActorCancel.call(this); $gameParty.select(null); $gameTroop.select(null);
    good call, only change needs to be to the alias call: should be


    `alias_PKonItemCancel` updated my original post to correct that error
  4. Ok, I tested the patch and it worked wonders!! Thank you so much, @Puppet Knight and @caethyril, really! I spent almost all Saturday and Sunday trying to figure out the cause of the problem and then trying to find a solution... my game has one less infuriating bug thanks to you guys xD :D!!

    @caethyril : The photo I uploaded was of the 'default' plugin; I took it from a blank project where I was doing the testing, but indeed in my official project, I am using that option. Thank you very much for pointing it out anyway, and for the help with the option to take part of the plugin.

    Ps.: I don't know how to tag you so you see my response xD, but I hope you get some notification to see this


    :D
  5. Asking here before I post in JS Support in case your plugin can help/is blocking my ask.


    In my project I've set it MP to work as a shield instead of a skill cost by doing the below:

    Game_Action: execute Damage update
    // Add in MP (Aura) Damage Mechanic
    // Overwrite executeDamage
    Game_Action.prototype.executeDamage = function(target, value) {
    const result = target.result();
    if (value === 0) {
    result.critical = false;
    }
    if (this.isHpEffect()) {
    // Calculate the potential damage to MP (Aura)
    let mpDamage = Math.min(target.mp, value);
    // Apply the calculated damage to MP
    target.gainMp(-mpDamage);
    // Adjust the damage value to account for the absorbed MP damage
    value -= mpDamage;
    // Apply any remaining damage to HP
    if (value > 0) {
    target.gainHp(-value);
    if (value > 0) {
    target.onDamage(value);
    }
    }
    }

    if (this.isMpEffect()) {
    this.executeMpDamage(target, value);
    }
    };


    That works as designed. One thng I've noticed however is that the damage popup that happens is only ever one or the other.


    Ex: If only MP damage occurs for this.isHpEffect()then that damage will show, however if MP AND HP damage is occuring, only the HP damage pop up will show.


    I'd like to have both show one after another to properly convey whats happening to the player
  6. Puppet Knight said:
    Asking here before I post in JS Support in case your plugin can help/is blocking my ask.
    You could at least check first: turn off my plugin in your project, save to apply Plugin Manager changes, then test. That would also test the correct context, with any other plugins you're using.

    Puppet Knight said:
    One thng I've noticed however is that the damage popup that happens is only ever one or the other.
    By default only 1 popup is shown per result. I don't believe anything in Cae_OnUseEffects changes that? Again, you could easily check this yourself, e.g. make a skill with 2 effects: Gain HP and Gain MP.
  7. caethyril said:
    By default only 1 popup is shown per result. I don't believe anything in Cae_OnUseEffects changes that? Again, you could easily check this yourself, e.g. make a skill with 2 effects: Gain HP and Gain MP.
    Just verified this. I'm going to have to manually make those extra sprites happen then. Ty anyway!
  8. Greetings Caethyril! Thank you very much for your work on these plugins!

    I have a question about Cae_OnUseEffects. I am trying to have a popup appear when the player attempts to inflict a state the target is immune to. In other words, if say, a Sleep spell (that inflicts the Sleep state) is used on an enemy that is immune to Sleep (the state), a popup will appear saying "Immune" so that the player knows why the enemy wasn't affected by that ability (state).

    I've read through the thread here and tried a bunch of different things, but I can't seem to figure out how to get this to work. Is it possible for the popup functionality in the plugin to do this? And how would I go about doing so if it is possible?

    A few of the things I've tried putting into the JS: Condition section of a custom popup.

    a) return target.isStateAffected()

    b) return target.isStateAffected(57)


    c) if (target.isStateAffected(57)) {

    if (value > 0) {

    target.setStateDisplay(57, 1);

    return true;

    }

    }

    return false;

    d) return target.stateRate() == 0

    e) return target.stateRate(57) == 0

    Just a few examples there of various things I've tried, but I'm just not having any luck at the moment getting this to work.

    Any help would be greatly appreciated and thank you in advance :).

    -Niniann
  9. @Niniann - you have roughly the right idea (and syntax). The tricky part is that this condition gets checked for all actions against all targets, so you need to check not only whether the target is immune, but also whether the action tried to add a relevant state.

    Unfortunately the action result only tracks states that were added successfully. I think what you want should be possible by manually checking the action effects, though.

    Maybe something like this (untested):
    JavaScript:
    const f = id => {
      if (id === 0)
        return subject.attackStates().some(f);
      return target.isStateResist(id)
          || target.stateRate(id) === 0;
    };
    return result.isHit() && this.item().effects.some(e => {
      if (e.code === Game_Action.EFFECT_ADD_STATE)
        return f(e.dataId);
      return false;
    });
    I.e. "return true only if:
    • The action hit the target, and
    • The action adds at least 1 state for which the target has State Resist or 0% State Rate".

    [Edit: corrected target.attackStates() to subject.attackStates().]
  10. caethyril said:
    @Niniann - you have roughly the right idea (and syntax). The tricky part is that this condition gets checked for all actions against all targets, so you need to check not only whether the target is immune, but also whether the action tried to add a relevant state.

    Unfortunately the action result only tracks states that were added successfully. I think what you want should be possible by manually checking the action effects, though.

    Maybe something like this (untested):
    JavaScript:
    const f = id => {
      if (id === 0)
        return target.attackStates().some(f);
      return target.isStateResist(id)
          || target.stateRate(id) === 0;
    };
    return result.isHit() && this.item().effects.some(e => {
      if (e.code === Game_Action.EFFECT_ADD_STATE)
        return f(e.dataId);
      return false;
    });
    I.e. "return true only if:
    • The action hit the target, and
    • The action adds at least 1 state for which the target has State Resist or 0% State Rate".
    Thank you very much for the reply and assistance :).

    I tried the code "out of the box" and it doesn't work (doesn't cause any crash, but also doesn't result in any popups). But I will try some experimentation from your foundation here and see if I can get it working!

    Edit 1: I noticed your edit in your post there and added that in and after some experimentation it is working! With a caveat though. Here is the issue:

    So, because (I believe) of the result.isHit this popup will only appear if the Skill that inflicts a State that a target is immune (has a State Resist) to incurs damage or healing of some sort. It won't appear if the skill only inflicts a state (i.e. the Sleep spell only inflicts the Sleep State, no damage or healing is applied).

    I'm going to see if I can tweak some things here to get it to show the popup regardless of whether or not damage is taken by the target.

    Edit 2: It's not caused by the result.isHit, tried taking that out and it functions the same as if it were there. Still experimenting.
  11. Niniann said:
    So, because (I believe) of the result.isHitthis popup will only appear if the Skill that inflicts a State that a target is immune (has a State Resist) to incurs damage or healing of some sort. It won't appear if the skill only inflicts a state (i.e. the Sleep spell only inflicts the Sleep State, no damage or healing is applied).

    Edit 2: It's not caused by the result.isHit, tried taking that out and it functions the same as if it were there. Still experimenting.
    OK, some notes:
    • result.isHit() is true if the action was used, hit the target, and was not evaded. Whether it is "used" depends on testApply, which by default cannot fail in battle.
    • By default an action's Effects only apply if the action hits (cf Game_Action.prototype.apply in rmmz_objects.js).
    • If the skill/item is Certain Hit, it will ignore the target's State Rate when adding states.
    • State Resist should always apply, since that works at a deeper level.


    I've noticed another limitation: this approach ignores the chance of applying the state(s), because it can't tell whether something like "Add State: Poison 40%" passed its 40% roll or not. I don't know whether you make use of that, and I don't see an easy way around it...
    • Ideally you'd want to add a flag to the result when a state is resisted, but by default State Rate multiplies the chance-to-apply value. So it'd probably need an override or two, which could easily break other plugins.

    • Alternatively you could fake it by rolling the chance again in the custom popup condition.
    However, if you only need to check State Resist, that would be easier. E.g. (untested):
    plugin code
    JavaScript:
    /*:
     * @target MZ
     * @plugindesc Sets a flag on action result when a state is Resisted.
     * @author Caethyril
     * @url plz wait for edit
     * @help Free to use and/or modify for any project, no credit required.
     */
    void (() => {
    'use strict';
      const PROP = "resistedState";
      void (alias => {
        Game_ActionResult.prototype.clear = function() {
          alias.apply(this, arguments);
          this[PROP] = false;
        };
      })(Game_ActionResult.prototype.clear);
      void (alias => {
        Game_Battler.prototype.addState = function(id) {
          alias.apply(this, arguments);
          if (this.isStateResist(id))
            this.result()[PROP] = true;
        };
      })(Game_Battler.prototype.addState);
    })();
    With this small plugin loaded, I think you could shorten the custom popup condition to:
    JavaScript:
    return target.result().resistedState;
  12. caethyril said:
    OK, some notes:
    • result.isHit() is true if the action was used, hit the target, and was not evaded. Whether it is "used" depends on testApply, which by default cannot fail in battle.
    • By default an action's Effects only apply if the action hits (cf Game_Action.prototype.apply in rmmz_objects.js).
    • If the skill/item is Certain Hit, it will ignore the target's State Rate when adding states.
    • State Resist should always apply, since that works at a deeper level.


    I've noticed another limitation: this approach ignores the chance of applying the state(s), because it can't tell whether something like "Add State: Poison 40%" passed its 40% roll or not. I don't know whether you make use of that, and I don't see an easy way around it...
    • Ideally you'd want to add a flag to the result when a state is resisted, but by default State Rate multiplies the chance-to-apply value. So it'd probably need an override or two, which could easily break other plugins.

    • Alternatively you could fake it by rolling the chance again in the custom popup condition.
    However, if you only need to check State Resist, that would be easier. E.g. (untested):
    plugin code
    JavaScript:
    /*:
     * @target MZ
     * @plugindesc Sets a flag on action result when a state is Resisted.
     * @author Caethyril
     * @url plz wait for edit
     * @help Free to use and/or modify for any project, no credit required.
     */
    void (() => {
    'use strict';
      const PROP = "resistedState";
      void (alias => {
        Game_ActionResult.prototype.clear = function() {
          alias.apply(this, arguments);
          this[PROP] = false;
        };
      })(Game_ActionResult.prototype.clear);
      void (alias => {
        Game_Battler.prototype.addState = function(id) {
          alias.apply(this, arguments);
          if (this.isStateResist(id))
            this.result()[PROP] = true;
        };
      })(Game_Battler.prototype.addState);
    })();
    With this small plugin loaded, I think you could shorten the custom popup condition to:
    JavaScript:
    return target.result().resistedState;
    caethyril,

    Thank you again for your assistance! So for my purposes, I only need the popup to appear if the target has a State Resist. There is already a "Miss" popup when a % chance state fails to hit, and combined with clear skill descriptions, I think that is telling enough.

    That being said, I tried your new code here and it doesn't appear to be working unfortunately. There is no crash, but there is no popup either.

    Just to be clear, I created a new plugin using your code and placed it below Cae_OnUseEffects, and then inputted the custom popup condition as you described in the appropriate location.

    I will keep experimenting! :)
  13. @Niniann - ...past-me should've looked at my plugin's code before replying, sorry. :kaoslp:

    It seems like I designed the custom popups explicitly for use with the existing damage popups:
    cae_onuseeffects excerpt
    JavaScript:
    // Alias! Evaluate custom popup data just before dealing damage.
    void (alias => {
        Game_Action.prototype.executeDamage = function(target, value) {
            $.evaluateCustomPopupData.apply(this, arguments);
            alias.apply(this, arguments);
        };
    })($.alias.Game_Action_executeDamage = Game_Action.prototype.executeDamage);
    
    // Alias! Create custom popups according to plugin parameters.
    void (alias => {
        Sprite_Battler.prototype.createDamageSprite = function() {
            $.createCustomPopupsPre.apply(this, arguments);
            alias.apply(this, arguments);
            $.createCustomPopupsPost.apply(this, arguments);
            $.clearCustomPopupData();
        };
    })($.alias.Sprite_Battler_createDamageSprite = Sprite_Battler.prototype.createDamageSprite);
    I.e. it only runs the custom popup conditions when dealing damage/healing, and shows them after the requested damage popup.

    A workaround could be to set the skill to HP Damage, with a formula of 0. Then use the plugin's "JS: Hide Popup Formula" plugin parameter to hide its damage popup, e.g.
    JavaScript:
    return value === 0 && item.damage.formula === "0";
    I.e. "hide iff the result is 0 and the formula is 0". That allows actions with a more complicated formula to still show a "0" popup. I just tried and it seems to work for me (touch wood).
  14. caethyril said:
    @Niniann - ...past-me should've looked at my plugin's code before replying, sorry. :kaoslp:

    It seems like I designed the custom popups explicitly for use with the existing damage popups:
    cae_onuseeffects excerpt
    JavaScript:
    // Alias! Evaluate custom popup data just before dealing damage.
    void (alias => {
        Game_Action.prototype.executeDamage = function(target, value) {
            $.evaluateCustomPopupData.apply(this, arguments);
            alias.apply(this, arguments);
        };
    })($.alias.Game_Action_executeDamage = Game_Action.prototype.executeDamage);
    
    // Alias! Create custom popups according to plugin parameters.
    void (alias => {
        Sprite_Battler.prototype.createDamageSprite = function() {
            $.createCustomPopupsPre.apply(this, arguments);
            alias.apply(this, arguments);
            $.createCustomPopupsPost.apply(this, arguments);
            $.clearCustomPopupData();
        };
    })($.alias.Sprite_Battler_createDamageSprite = Sprite_Battler.prototype.createDamageSprite);
    I.e. it only runs the custom popup conditions when dealing damage/healing, and shows them after the requested damage popup.

    A workaround could be to set the skill to HP Damage, with a formula of 0. Then use the plugin's "JS: Hide Popup Formula" plugin parameter to hide its damage popup, e.g.
    JavaScript:
    return value === 0 && item.damage.formula === "0";
    I.e. "hide iff the result is 0 and the formula is 0". That allows actions with a more complicated formula to still show a "0" popup. I just tried and it seems to work for me (touch wood).
    caethyril,

    Ah ha! That explains why I could not for the life of me get this to work without applying damage on the skill haha. Thank you so much for digging into the plugin :).

    Just tested and you're 100% correct, with the damage formula set to 0 and the code to hide the damage popup if the skill's formula is 0, it all works like a charm.

    I very much appreciate your assistance here. Take care and thank you again!

    Cheers,

    -Niniann
  15. caethyril said:
    @Niniann - ...past-me should've looked at my plugin's code before replying, sorry. :kaoslp:

    It seems like I designed the custom popups explicitly for use with the existing damage popups:
    cae_onuseeffects excerpt
    JavaScript:
    // Alias! Evaluate custom popup data just before dealing damage.
    void (alias => {
        Game_Action.prototype.executeDamage = function(target, value) {
            $.evaluateCustomPopupData.apply(this, arguments);
            alias.apply(this, arguments);
        };
    })($.alias.Game_Action_executeDamage = Game_Action.prototype.executeDamage);
    
    // Alias! Create custom popups according to plugin parameters.
    void (alias => {
        Sprite_Battler.prototype.createDamageSprite = function() {
            $.createCustomPopupsPre.apply(this, arguments);
            alias.apply(this, arguments);
            $.createCustomPopupsPost.apply(this, arguments);
            $.clearCustomPopupData();
        };
    })($.alias.Sprite_Battler_createDamageSprite = Sprite_Battler.prototype.createDamageSprite);
    I.e. it only runs the custom popup conditions when dealing damage/healing, and shows them after the requested damage popup.

    A workaround could be to set the skill to HP Damage, with a formula of 0. Then use the plugin's "JS: Hide Popup Formula" plugin parameter to hide its damage popup, e.g.
    JavaScript:
    return value === 0 && item.damage.formula === "0";
    I.e. "hide iff the result is 0 and the formula is 0". That allows actions with a more complicated formula to still show a "0" popup. I just tried and it seems to work for me (touch wood).
    Greetings!

    I hope this is not considered a double post, but it's been a month since my last post here and I've stumbled upon a "new" issue with Cae_OnUseEffects.

    Specifically the issue is with using the "JS: Hide Popup Formula".

    With this:
    JavaScript:
    return value === 0 && item.damage.formula === "0";
    in the "JS:Hide Popup Formula" box, if a skill with a damage formula of 0 that also applies a State that inflicts HP damage each turn (i.e. the State's effect is -HP regeneration), no popup will show each turn indicating the damage taken, even if it is more than 0.

    For example, if I create a skill that does 0 damage but applies a Poison State that has the effect of HP Regeneration: -10%, there will be no damage popup for the initial cast of the Skill (which is correct), but also there will be no popup indicating the damage taken each turn from the State (I believe this is not intended).

    Seems like the Hide Popup code is sort of "extending" itself to to hide State damage if the Skill damage that applied the state is 0.

    Note: If I set the Skill damage to 1, so that no damage popup is hidden, the State damage tick is displayed properly.
  16. Niniann said:
    I hope this is not considered a double post, but it's been a month since my last post here
    The double-post rule is mostly to combat spam, and has a 72-hour cooldown. 1 month is totally OK!

    Niniann said:
    if I create a skill that does 0 damage but applies a Poison State that has the effect of HP Regeneration: -10%, there will be no damage popup for the initial cast of the Skill (which is correct), but also there will be no popup indicating the damage taken each turn from the State (I believe this is not intended)
    Oops. When I upgraded the hide popup thing to a formula, I made it cache the result. But I forgot to clear that cached value with the other custom popup data.

    Try editing this part (line 1194):
    JavaScript:
    $.clearCustomPopupData = function() { delete $.popups._data; };
    ...to this:
    JavaScript:
    $.clearCustomPopupData = function() { delete $.popups._data, delete $.popups._hide; };
    I did a quick test and it seems to work for me; if it helps on your end as well then I'll upload a fixed version~ :kaohi:
  17. caethyril said:
    The double-post rule is mostly to combat spam, and has a 72-hour cooldown. 1 month is totally OK!


    Oops. When I upgraded the hide popup thing to a formula, I made it cache the result. But I forgot to clear that cached value with the other custom popup data.

    Try editing this part (line 1194):
    JavaScript:
    $.clearCustomPopupData = function() { delete $.popups._data; };
    ...to this:
    JavaScript:
    $.clearCustomPopupData = function() { delete $.popups._data, delete $.popups._hide; };
    I did a quick test and it seems to work for me; if it helps on your end as well then I'll upload a fixed version~ :kaohi:
    Just tested it and it's working perfectly now! The damage popup of 0 continues to be hidden, but the State tick damage is displayed.

    Thank you for your work on your plugin! I greatly appreciate it :).

    PS: Ahhh, good to know on the double-post rule, I try to make sure I'm not violating that but sometimes I'm a little unsure if I am or not. This clarification helps! :).
  18. Great, you're welcome! I've updated the plugin to v1.7 with the fix (no other changes).
  19. Greetings again,

    I have run into another snag with Cae_OnUseEffects, though I believe this time there may not be much that can be done. I wanted to report it anyway for the sake making everyone aware.

    So the following is the default custom popup for something being hit in the battle scene by an attack in which it is an Element they are weak too, i.e. have a higher than 1 Element Rate.

    const rate = this.calcElementRate(target);
    return rate > 1;

    This works perfectly fine, normally. However, it gets a little funky when you combine Cae_OnUseEffects with a plugin like Visustella's ElementStatusCore, which has a notetag option to allow equippable Armor and States to apply an effect that increases element damage dealt.

    What ends up happening if you have, say, an accessory that increases fire Element damage dealt by 50% (e.g. from using the notetag: <Dealt Element 2 Rate: 150%>), when you attack an enemy with a fire Element spell, normal attack, whatever, Cae_OnUseEffects will show that as a weakness and display the custom popup. This is regardless of whether the enemy has any sort of "natural" (i.e. database entry) weakness against the fire Element.

    Going to experiment with this a bit and see if I can mellow out the interaction and get the plugins playing nice together, will report back if I figure something out :).

    Edit 1: Working on trying a couple things here that may fix the interaction.

    Currently trying the following code in the plugin parameter JS: Condition for the weakness custom popup:

    if (item.damage.elementId() == 2 && target.elementRate(2) < 1) {
    return true;
    } else {
    return false;
    }

    This doesn't quite work yet, as item.damage.elementId() is not a function, but the idea is to check if the Skill being used is the fire Element (ID = 2) and the target of the Skill has a weakness to the fire Element, then show the weakness popup. Otherwise, don't show the popup.

    Alternatively, I have wrapped the original code in an if statement, which functions correctly, but can't account for every scenario:

    if (subject.isStateAffected(55)) {
    return false;
    } else {
    const rate = this.calcElementRate(target);
    return rate > 1;
    }

    What this does is check specifically for a State (in this case State 55, which increases fire Element damage dealt), if the user of a Skill has the State, don't show the weakness popup. But this simply negates weakness popups entirely, even if the user of a Skill strikes an Enemy that does indeed have a weakness to the fire Element.