YEP Battle AI: State

Discussion in 'Javascript/Plugin Support' started by Drunken Paladin, Aug 30, 2017.

  1. Drunken Paladin

    Drunken Paladin Veteran Veteran

    Messages:
    82
    Likes Received:
    55
    First Language:
    English
    Hi,

    I'm attempting to configure Yanfly's Battle AI Core such that an enemy will only use a move if the target isn't affected by a state. The instructions seem pretty straightforward with: STATE !== state x, but this doesn't seem to do anything at all for me. Enemies just ignore it and keep using the move over and over again while the state is applied.

    If anyone has any ideas, it would be appreciated.
     
    #1
  2. Poryg

    Poryg Dark Lord of the Castle of Javascreeps Veteran

    Messages:
    4,021
    Likes Received:
    10,173
    Location:
    Czech Republic
    First Language:
    Czech
    Primarily Uses:
    RMMV
    It would be better to show a print screen or something about your note field. Looks like a badly set notetag.
     
    #2
  3. AdamSakuru

    AdamSakuru [Null_Value] Veteran

    Messages:
    314
    Likes Received:
    169
    First Language:
    English
    Primarily Uses:
    N/A
    Hey buddy, I gotchya covered (I think).
    A similar problem was making me pull my hair out.

    By default, it can only check for a state (or lack thereof) in the target scope. So, if it's a skill that targets party members, it only checks allies as available targets and the same is true for skills that target enemies.

    In my game I wanted to have enemies behave differently based on which row they were in. Since the rows are states, I had to check, no matter what skill was going to be used, if they had a specific row state.

    Like so:
    Code:
    Eval user.isStateAffected(11) +++ Eval user.hpRate() < 0.9 +++ Random 30%:  (Skill name, etc.)
    
    This code checks to see if the user doesn't have a state:
    Code:
    Eval !user.isStateAffected(13)
    
    So I imagine you would just replace "!user" with "!target"?
     
    #3
    Drunken Paladin likes this.
  4. Drunken Paladin

    Drunken Paladin Veteran Veteran

    Messages:
    82
    Likes Received:
    55
    First Language:
    English
    Thanks Adam, I'll give it a shot!
     
    #4

Share This Page