YEP Buff & States Core JS Help

Discussion in 'Javascript/Plugin Support' started by Backwardskey, Oct 19, 2017.

  1. Backwardskey

    Backwardskey Phones Veteran

    Messages:
    39
    Likes Received:
    11
    First Language:
    English
    Primarily Uses:
    RMMV
    Hello.

    I'm attempting to make a passive state that forces the user to counter-attack every time they dodge a physical attack with normal calculations. Nothing seems to happen in testing, however. If anyone knows where I went wrong, I'd appreciate you telling me.

    Code:
    Code:
    <Custom React Effect>
      var attacker = user.index();
      if (this.isHpEffect() && this.isPhysical() && target.result().evaded) {
        if (!target.isStateAffected(7)) {
          BattleManager.queueForceAction(target, 1, attacker);
        }
      }
    </Custom React Effect>
    
    Thanks! :mrsatan:
     
    #1
  2. Pots Talos

    Pots Talos Veteran Veteran

    Messages:
    90
    Likes Received:
    62
    Location:
    Long Island
    First Language:
    English
    Primarily Uses:
    RMMV
    All you have to do is put the passive in the skill like:

    <Passive State: 26>
    <Evade Counter>
    <Hide in Battle>

    And in the State just put
    <Evade Counter>

    That's how I do it anyway.
     
    #2
  3. Backwardskey

    Backwardskey Phones Veteran

    Messages:
    39
    Likes Received:
    11
    First Language:
    English
    Primarily Uses:
    RMMV
    Not quite. Yanfly's Counter Control allows me to evade when I counter. I want to counter when I evade.

    For example - imagine a character with several evasion-boosting abilities or abilities that guarantee evasion of X number of physical attacks.

    The passive capitalizes on this by forcing the character to counter the attacker every time they evade.

    Effectively, I'm using the character's Evasion to decide when to counter, and not the Counter Attack parameter itself.
     
    #3
  4. Pots Talos

    Pots Talos Veteran Veteran

    Messages:
    90
    Likes Received:
    62
    Location:
    Long Island
    First Language:
    English
    Primarily Uses:
    RMMV
    Maybe I'm not following completely but my character is setup exactly how you are describing. Anytime he evades an attack he counter attacks the enemy, buffing evasion with items or skills lets him evade more attacks which in turn lets him counter attack more.
     
    #4
  5. shockra

    shockra Slightly Crazy Programmer Veteran

    Messages:
    407
    Likes Received:
    178
    Location:
    US
    First Language:
    English
    Primarily Uses:
    RMMV
    I think the problem is that you're using Custom React Effect. If the attack is evaded, that part is skipped over, so it can't possibly work that way. Try using Custom Deselect Effect instead. That will occur when evading.
     
    #5
  6. Backwardskey

    Backwardskey Phones Veteran

    Messages:
    39
    Likes Received:
    11
    First Language:
    English
    Primarily Uses:
    RMMV
    What exactly IS your setup? All that <Evade Counter> seems to do for me is cause the battler to dodge when a counter is triggered. Nothing happens when he evades an attack normally. I'd like to trigger a counter WHEN my battler dodges - not dodge when a counter is triggered.
     
    #6
  7. shockra

    shockra Slightly Crazy Programmer Veteran

    Messages:
    407
    Likes Received:
    178
    Location:
    US
    First Language:
    English
    Primarily Uses:
    RMMV
    <Custom Deselect Effect>
    var attacker = user.index();
    if (this.isHpEffect() && this.isPhysical() && target.result().evaded) {
    if (!target.isStateAffected(7)) {
    BattleManager.queueForceAction(target, 1, attacker);
    }
    }
    </Custom Deselect Effect>

    I think Pots Talos is mistaken. <Evade Counter> makes the user dodge only when countering, not counter when dodging. Try the above code with the Deselect Effect. It has to be Deselect, since React and Respond require the attack to hit, and Select occurs before we know if the attack hit, miss, or was dodged.
     
    #7
  8. Backwardskey

    Backwardskey Phones Veteran

    Messages:
    39
    Likes Received:
    11
    First Language:
    English
    Primarily Uses:
    RMMV
    I did a while ago after I read your first reply - the counter occurs as intended, but with a rather critical flaw; my attacks use action sequences that displace the battler. If an enemy physically attacks me during an action sequence, the counter occurs before the sequence is done playing. Worse still, if the battler dies, they'll die where they stand and won't return to their home position. This isn't a huge issue until you start using SV Battlers, which I have set to the 'No Disappear' flag. My solution would be to use Action End instead of Deselect, but I don't think you can access the skill nor the target of the skill during that phase.
     
    #8
  9. shockra

    shockra Slightly Crazy Programmer Veteran

    Messages:
    407
    Likes Received:
    178
    Location:
    US
    First Language:
    English
    Primarily Uses:
    RMMV
    Hmm...I hadn't considered the action sequence side of it. I don't know enough about action sequences to give a definite answer, but I think there's a way to ensure that the user doesn't die until the attack is complete. What does the sequence for the triggering attack look like?
     
    #9
  10. Backwardskey

    Backwardskey Phones Veteran

    Messages:
    39
    Likes Received:
    11
    First Language:
    English
    Primarily Uses:
    RMMV
    <target action>

    camera focus: target

    zoom: 120%, 10

    animation 10: user

    move user: target, base, 16

    motion swing: user

    face user: forward

    wait for movement

    action animation

    action effect

    collapse: target

    wait: 15

    </target action>



    <finish action>

    clear battle log

    zoom: 100%, 15

    move user: home, 25

    jump user: 15, 25

    wait for movement

    face user: forward

    wait for animation

    immortal: target, false

    reset zoom: 10

    reset camera: 10

    wait for camera

    </finish action>

     
    #10
  11. shockra

    shockra Slightly Crazy Programmer Veteran

    Messages:
    407
    Likes Received:
    178
    Location:
    US
    First Language:
    English
    Primarily Uses:
    RMMV
    What I'm seeing is that currently, I don't think there's any way to ensure that the user is immortal. Maybe try adding the line:

    immortal: user, true

    Place that in the setup action (along with anything else needed to ensure continuity, including immortal: target, true), then remove user immortality in the finish action after the user returns to home position. See if that works.
     
    #11
  12. Backwardskey

    Backwardskey Phones Veteran

    Messages:
    39
    Likes Received:
    11
    First Language:
    English
    Primarily Uses:
    RMMV
    Didn't seem to work, I'm afraid.
    Maybe Action End is the way to go.
     
    #12
  13. kranasAngel

    kranasAngel Wanderer Veteran

    Messages:
    122
    Likes Received:
    41
    First Language:
    English
    Primarily Uses:
    RMMV
    If they aren't counterattacking for any other reason couldn't you do the following?

    Setup Evade Counter
    Then use EX Param Formula's to set their Counter change equal to their evasion rate.
    HTML:
    if(user.isStateAffected(x) ? (user.eva + plus) * rate + flat + (user.luk / 1000) : (base + plus) * rate + flat + (user.luk / 1000)
    The above state checks if State X is applied, and if so uses evasion instead of the default counter attack chance

    That should work fine I think.
     
    #13

Share This Page