How to implement every possible Yanfly Tips & Tricks effect in MZ with VisuStella plugins

● ARCHIVED · READ-ONLY
Started by Trihan 251 posts Page 10 of 13 View original ↗
  1. ATT_Turan said:
    You'll then have to make the damage formula deal the target's full health and put the healing into a post-damage notetag that has user.gainHp(user._allyHp + user.allyMat * 14).
    The first things were clear, but you are telling me to put a healing into the post-damage notetag when I'd like to damage the whole enemy party instead. I don't know if rpgmaker works like that, but I'm a little bit confused with that healing:rswt

    EDIT: Looking deep this amazing forum, I found some keys and I've finally got it through a strange way". I managed to select the ally, then do the dmg to the whole enemy party based on the target's maxHp. I will drop it here if someone's interested in having the mechanic, even when I'can't make not to target the user yet (even with the VS notetag).

    Code:
    <Cannot Target User>
    <JS Skill Enable>
      const group = user.friendsUnit();
      const allies = group.aliveMembers();
      enabled = allies.length > 1;
    </JS Skill Enable>
    
    <Custom Cost Text>
      Un colega \i[159]
    </Custom Cost Text>
    
    <JS Pre-Start Action>
      $gameVariables.setValue(35, target.hp);
     </JS Pre-Start Action>
    
    <JS Post-Damage>
      for (var foe of user.opponentsUnit().aliveMembers()){
      var dmg = $gameVariables.value(35) * 10;
      foe.gainHp(-Math.ceil(dmg));
      if (foe.isDead())
        foe.performCollapse();
    }
    </JS Post-Damage>

    Of course, if some of the coders around have any suggestions or modifications for better results, I'm all eyes and ears for you.
    Thanks for your time anyways.
  2. Siul said:
    The first things were clear, but you are telling me to put a healing into the post-damage notetag when I'd like to damage the whole enemy party instead. I don't know if rpgmaker works like that, but I'm a little bit confused with that healing:rswt
    Please take the time to explain more explicitly, then. You never said you were turning it into a skill that damages the entire troop or I would've given you the code for that :stickytongue:
    (I got the impression you were killing off an ally to heal the user)

    Siul said:
    I will drop it here if someone's interested in having the mechanic, even when I'can't make not to target the user yet
    Well, you're not using any notetags to control the targeting. Just put in <Cannot Target User>
  3. ATT_Turan said:
    Please take the time to explain more explicitly, then. You never said you were turning it into a skill that damages the entire troop or I would've given you the code for that :stickytongue:
    (I got the impression you were killing off an ally to heal the user)
    Sorry man, my bad there I guess. I wanted to kill an ally (not the user) then do that ally's maxhp as dmg to all foes.
    About the targeting notetag, I have that exact notetag just above the whole code, but it ain't working. I'm still working on it, but sometimes it feels worth to learn js instead of bothering people:rswt2::rswt2:
  4. Thank you for the updates :) May I ask when the next one is coming?

    Also, I am looking at the Leech seed one - the "origin" variable actually works there even if Battle Core page doesn't list it?
  5. Sometime at the weekend, hopefully. I've had a busy week with the game I assistant dev for.
  6. You're my hero now
  7. Can someone please walk me through the character transformation state? I'm using MZ, have the correct plugins and the skills/state created, but nothing happens in battle.
  8. Just wanted to say thanks for doing this
  9. A huge thank you for all of your hard work!
  10. Is there a way to make the Runic State trick be element-specific instead of targeting magic in general? Also, if so, can multiples of this note tag be inserted, or would the trick need to be adjusted to work on multiple elements? Been trying to figure out how to do this for an eternity.
  11. Xeri said:
    Is there a way to make the Runic State trick be element-specific instead of targeting magic in general?
    Add the element ID to the conditional. For example:
    Code:
    if (this.isMagical() && this.isHpEffect() && value > 0 and && this.item().damage.elementId == 2)
    checks for element 2.

    Xeri said:
    Also, if so, can multiples of this note tag be inserted
    As a rule, you can never have the same notetag on a database object more than once unless the instructions for the plugin explicitly say you can.

    Xeri said:
    or would the trick need to be adjusted to work on multiple elements?
    Yes. You could list them all out with OR, but something like this would be more efficient.

    Code:
    // List any affected elements here
    let elements = [2, 5, 6, 9];
    if (this.isMagical() && this.isHpEffect() && value > 0 and && elements.includes(this.item().damage.elementId))
  12. My apologies if this counts as necroposting, but I have an idea regarding the effects that would have required Passive Auras under Yanfly: make the aura effects into global passive states with the source state as their condition.
    Aura Effect for Enemies
    Code:
    <JS Passive Condition>
     condition = user.opponentsUnit().aliveMembers().some(function(member) {
      return member.isStateAffected(x); // replace 'x' with the database ID of the source state
     });
    </JS Passive Condition>
    Aura Effect for Allies
    Code:
    <JS Passive Condition>
     condition = user.friendsUnit().aliveMembers().some(function(member) {
      return member.isStateAffected(x); // replace 'x' with the database ID of the source state
     });
    </JS Passive Condition>
  13. Ultima01 said:
    My apologies if this counts as necroposting, but I have an idea regarding the effects that would have required Passive Auras under Yanfly: make the aura effects into global passive states with the source state as their condition.
    Aura Effect for Enemies
    Code:
    <JS Passive Condition>
     condition = user.opponentsUnit().aliveMembers().some(function(member) {
      return member.isStateAffected(x); // replace 'x' with the database ID of the source state
     });
    </JS Passive Condition>
    Aura Effect for Allies
    Code:
    <JS Passive Condition>
     condition = user.friendsUnit().aliveMembers().some(function(member) {
      return member.isStateAffected(x); // replace 'x' with the database ID of the source state
     });
    </JS Passive Condition>
    but... why?
  14. Is there a way to make Death skill work to all enemies? As default, this work for one enemy, but if you make skill target "to all enemies", the result will be like this:
    the very first troop member ($gameTroop.members()[0]) will be affected by skill as it should, but for the next ones result will always be "miss", no matter how much MP castor has.
  15. @SANTERSAKH Right, because as soon as the skill hits an enemy successfully, the Post-Apply sets the caster's MP to 0. Logically, that means all future checks against the percentage of MP must fail.

    You don't really say how you want it to work - does each enemy take a chunk of MP instead of all of it? Are all enemies tested using the same, original MP value?

    This change will do the second option.

    Code:
    <JS Post-Damage>
      if (!target.hasStateCategory('boss')) {
        target.result().hpAffected = false;
        const deathStateId = target.deathStateId();
        user.origMp ??= user.mpRate();
        let chance = user.origMp;
        chance *= target.stateRate(deathStateId);
        if (Math.random() < chance) {
          if (target.isImmortal()) {
            target.removeImmortal();
          }
          target.addState(deathStateId);
        } else {
          target.result().missed = true;
        }
      }
    </JS Post-Damage>
  16. ATT_Turan said:
    @SANTERSAKH Right, because as soon as the skill hits an enemy successfully, the Post-Apply sets the caster's MP to 0. Logically, that means all future checks against the percentage of MP must fail.

    You don't really say how you want it to work - does each enemy take a chunk of MP instead of all of it? Are all enemies tested using the same, original MP value?

    This change will do the second option.

    Code:
    <JS Post-Damage>
      if (!target.hasStateCategory('boss')) {
        target.result().hpAffected = false;
        const deathStateId = target.deathStateId();
        user.origMp ??= user.mpRate();
        let chance = user.origMp;
        chance *= target.stateRate(deathStateId);
        if (Math.random() < chance) {
          if (target.isImmortal()) {
            target.removeImmortal();
          }
          target.addState(deathStateId);
        } else {
          target.result().missed = true;
        }
      }
    </JS Post-Damage>
    Actually i meant this option, thanks. I didn't even think about future MP checks.
  17. @SANTERSAKH Actually, you'd need to supplement that more. I think you'd need to make the skill add a state to the user, then give that state a notetag that triggers at the end of their turn with
    Code:
    delete user.origMp;

    Otherwise it will persist between casts.
  18. ATT_Turan said:
    @SANTERSAKH Actually, you'd need to supplement that more. I think you'd need to make the skill add a state to the user, then give that state a notetag that triggers at the end of their turn with
    Code:
    delete user.origMp;

    Otherwise it will persist between casts.
    "their" mean enemies?
  19. the user. he didnt mention enemies.

    the origMp value is written once on the user and wont be overwritten unless deleted. so unless you delete it at some point, the mp the skill uses will always be the mp used the first time the user ever uses the skill
  20. @SANTERSAKH What @Robro33 said.

    So you'd put on the line after the first if statement
    Code:
    user.addState(42)
    where 42 is the ID of a new, blank state.

    Then give that state the notetag
    Code:
    <JS Pre-End Turn>
    delete user.origMp;
    user.removeState(state.id);
    </JS Pre-End Turn>