Conditional State if User Evade

Discussion in 'JS Plugin Requests' started by Grumphlu, Jan 16, 2019.

?

Do you know a code that can do my request ?

  1. Yes i have

    0 vote(s)
    0.0%
  2. No i don't

    1 vote(s)
    100.0%
  1. Grumphlu

    Grumphlu Villager Member

    Messages:
    14
    Likes Received:
    4
    First Language:
    Français
    Hello,

    I'm using plugins of Yanfly (Battle Core, Buff and Sate, Skill Core etc....)

    I want to know how i can do a passive state where it react if the user do an evasion.
    For exemple, if my character evade from a skill, i want him to win a buff or a state.

    Is there a formule for my passive state to react when this happen ? I am just learning about javascript.

    I tried to put :

    <Custom React Effect>
    if user.result().evaded

    user.addBuff(6,5);

    </Custom React Effect>

    But nothing happen ^^

    Thanks in advance for answering me, and have a good day !
     
    Last edited: Jan 16, 2019
    #1
  2. caethyril

    caethyril ^_^ Veteran

    Messages:
    615
    Likes Received:
    361
    Location:
    UK
    First Language:
    English
    Primarily Uses:
    RMMV
    Two mistakes here:
    • "React effect" only applies if the action hits. =P
    • If statements require the condition to be in brackets after the "if". ^_^
    Try this instead:
    Code:
    <Custom Deselect Effect>
    if (user.result().evaded) {
      user.addBuff(6, 5);
    }
    </Custom Deselect Effect>
    (Edit: also, polls are optional when you create a thread.)
     
    #2
  3. Grumphlu

    Grumphlu Villager Member

    Messages:
    14
    Likes Received:
    4
    First Language:
    Français
    I see, well thank you for the help !
    Truely help me to understand better how it works and help me for my project.

    Have a good day :)
     
    #3
    caethyril likes this.
  4. Grumphlu

    Grumphlu Villager Member

    Messages:
    14
    Likes Received:
    4
    First Language:
    Français
    I reply again about my post after some days, i could test well the statut sorry ^^

    I change, now it seems that the game reconise that my character is evading but now the buff don't apply.
    I don't know if its a problem with " user.addBuff(6, 5); " or that it miss something to show the application of the buff.

    I shouldnt had to reply without testing sry ^^
     
    #4
  5. caethyril

    caethyril ^_^ Veteran

    Messages:
    615
    Likes Received:
    361
    Location:
    UK
    First Language:
    English
    Primarily Uses:
    RMMV
    Oops, no worries, I should have tested it too! :kaoback:

    Yes, user actually refers to the skill user, that's why it wasn't working correctly. :kaoswt: I tested this notetag and it seemed to work as expected:
    Code:
    <Custom Deselect Effect>
    if (target.result().evaded) {
      target.addBuff(6, 5);
    }
    </Custom Deselect Effect>
     
    #5
  6. Grumphlu

    Grumphlu Villager Member

    Messages:
    14
    Likes Received:
    4
    First Language:
    Français
    Weird, for me it doesn't work, the state is here in passive, i put an icon to verify it but it seems that the buff don't apply...
    I don't know what is the problem i have almost all plugins of Yanfly (Battle Core, Buff and State, Selection Control, Target Core, Passive State etc...)

    My passive state is on priority 0 but even if i put it on 99 doesn't change nothing....
     
    #6
  7. caethyril

    caethyril ^_^ Veteran

    Messages:
    615
    Likes Received:
    361
    Location:
    UK
    First Language:
    English
    Primarily Uses:
    RMMV
    That is strange, for me it works the same regardless of if it's a passive state. I put it on Harold, and whenever he evades, he gets an agility buff. :kaoswt:

    A couple of things to try:
    • Make sure your Yanfly plugins are up-to-date and in the recommended order, listed here: http://yanfly.moe/yep/
    • Replace the notetag with this (just for testing) and press F8 during play to open the console window to see what code is, or isn't, running:
      Code:
      <Custom Deselect Effect>
      console.log('Custom Deselect Effect');
      if (target.result().evaded) {
        console.log('Add buff!');
        target.addBuff(6, 5);
      }
      </Custom Deselect Effect>
      This should show "Custom Deselect Effect" in the console window when the actor is targetted, and "Add buff!" whenever they evade. :)
     
    #7
  8. Grumphlu

    Grumphlu Villager Member

    Messages:
    14
    Likes Received:
    4
    First Language:
    Français
    Ok, i did all updates and now its all work correctly ! my bad... haha

    Thanks for your help !
     
    #8
    caethyril likes this.
  9. caethyril

    caethyril ^_^ Veteran

    Messages:
    615
    Likes Received:
    361
    Location:
    UK
    First Language:
    English
    Primarily Uses:
    RMMV
    That's good! Happy RPG Making! :kaojoy:
     
    #9
    Grumphlu likes this.

Share This Page