Yanfly Auto Passive States

Discussion in 'Javascript/Plugin Support' started by Dcraft, Mar 17, 2019.

  1. Dcraft

    Dcraft Veteran Veteran

    Messages:
    33
    Likes Received:
    0
    First Language:
    Spanish
    I am trying to make a state which increases the attack, but the state only triggers when the hero is affected by another specific state like poison, there is a skill in pokemon called guts which works exactly like this. Guts raises the ability-bearer's Attack by 50% when inflicted by a major status ailment (poison, burn, paralysis, freeze or sleep). I hope someone can help me with the javascript code to make it work
     
    #1
  2. Doktor_Q

    Doktor_Q I'm not a real doktor, but I am a real Q Veteran

    Messages:
    612
    Likes Received:
    344
    Location:
    Denial
    First Language:
    English
    Primarily Uses:
    RMMV
    You need to set a custom passive condition that will be true if the user is afflicted with any "ailment" type state. To define what states count as ailments, and for an easy way to check if any of them are applied, look at Yanfly's State Categories- if you define a custom "ailment" category, apply that category to poison, blind, etc., and then make your passive state condition check for "user.isStateCategoryAffected("ailment")" then it should work out.
     
    #2
    Dcraft likes this.
  3. Dcraft

    Dcraft Veteran Veteran

    Messages:
    33
    Likes Received:
    0
    First Language:
    Spanish
    Well I put this in the custom state

    <Custom Passive Condition>
    if user.isStateCategoryAffected(ailment) {
    condition = true;
    } else {
    condition = false;
    }
    </Custom Passive Condition>

    and I got this error
    SyntaxError
    Unexpected Identifier

    then I tried this

    <Custom Passive Condition>
    if (user.isStateCategoryAffected(ailment)) {
    condition = true;
    } else {
    condition = false;
    }
    </Custom Passive Condition>

    and I got this

    ReferenceError
    ailment is not defined

    PD: I installed the BuffsState core aswell
     
    #3
  4. Doktor_Q

    Doktor_Q I'm not a real doktor, but I am a real Q Veteran

    Messages:
    612
    Likes Received:
    344
    Location:
    Denial
    First Language:
    English
    Primarily Uses:
    RMMV
    It's "ailment" not just ailment. The quotation marks are important.

    Personally, I would just do
    Code:
    condition = user.isStateCategoryAffected("ailment");
    exactly like that.
     
    #4
    Dcraft likes this.
  5. Dcraft

    Dcraft Veteran Veteran

    Messages:
    33
    Likes Received:
    0
    First Language:
    Spanish
    Now it works, that was it thanks for your help
     
    #5
  6. Dcraft

    Dcraft Veteran Veteran

    Messages:
    33
    Likes Received:
    0
    First Language:
    Spanish
    Sorry for coming back to bother but I had a problem, when I try this for the first time I created 2 objects 1 that granted the buff status and the other granted the ailment status and everything works perfect with that, now the problem is that when the status ailment is given by a weapon or armor the buff status does not recognize it for some reason, if I remove the weapon that gives this state and apply the object that applies the ailment again it works. Another strange thing, if I apply the object first to add the ailment and then equips the weapon with the same status effect now appears twice in the same actor, its like the custom condition only triggers with status given by the program and not by the ones given by a plugin
     
    Last edited: Mar 19, 2019
    #6
  7. Doktor_Q

    Doktor_Q I'm not a real doktor, but I am a real Q Veteran

    Messages:
    612
    Likes Received:
    344
    Location:
    Denial
    First Language:
    English
    Primarily Uses:
    RMMV
    What are you talking about when you say "object"? A state? A skill effect? Are you doing other custom javascript that you haven't mentioned?
     
    #7
    Dcraft likes this.
  8. Dcraft

    Dcraft Veteran Veteran

    Messages:
    33
    Likes Received:
    0
    First Language:
    Spanish
    Sorry I mean a consumable item that gives that state (bad english). Also i'm applying the passive state in the armor with yanfly passive state plugin
     
    #8

Share This Page