Battle AI Core Problems.

Discussion in 'Javascript/Plugin Support' started by Backwardskey, Jul 15, 2018.

  1. Backwardskey

    Backwardskey Phones Veteran

    Messages:
    39
    Likes Received:
    11
    First Language:
    English
    Primarily Uses:
    RMMV
    Greetings.
    I'm using the most up-to-date version of Yanfly's Battle AI Core, and I'm having some unusual trouble getting enemies to correctly use skills that have a high 'Speed' parameter - as in, the skill should always come first in the turn. Instead, the plugin seems to use the enemy's AGI to determine when to use the skill under circumstances that are described nowhere in the plugin's help text.

    Code:
    <AI Priority>
    State === LockOn: Wide Laser
    User HP% Param <= 20%: Camera Laser II, Lowest HP
    Random 30%: Slice Thrice
    Random 30%: Reconstruct, User
    Random 40%: Venom Bash
    Always: Counter-Lock
    <AI Priority>
    The above (coupled with maximum AI level) is the priority list for a particular mini-boss that attacks the player party with a powerful laser attack if they're inflicted with the Lock-On state. The Counter-Lock skill is exactly what it sounds like - the boss applies a state to itself that increases its Counter Rate to 100% for the remainder of the turn, and uses Yanfly's Counter Control to set its default counter skill to a skill not listed here simply named Lock-On - which, as the name implies, merely applies the Lock-On state to the attacker.

    The issue that arises is that the Counter-Lock skill has a speed of 2000 and thus should always activate before anything else in the turn; however, the boss uses its own AGI stat to determine when to use the skill, as if the Speed modifier was never applied at all. Stranger still, if I remove the three skills ABOVE the Counter-Lock entry in that list, it works just fine! The Speed modifier only seems to work so long as the priority list has 3 or less entries in it, including the Counter-Lock entry.

    What is responsible for this incredibly odd behavior? Why is it happening, and is there anything I can do to correct it?

    Thanks. :mrsatan:
     
    #1
  2. shockra

    shockra Slightly Crazy Programmer Veteran

    Messages:
    409
    Likes Received:
    179
    Location:
    US
    First Language:
    English
    Primarily Uses:
    RMMV
    <AI Priority> on the bottom is missing the slash. It should be </AI Priority>. That may just be a typo in this post, but if it's not, fix it.

    As for the primary issue, is the AI plugin set with Dynamic Actions active? If so, it suggests that the enemy doesn't decide to use the move until its turn arrives with its normal speed. If Dynamic Actions is off, the move the enemy uses is determined at the start of the round. I'm thinking that's the issue.
     
    #2
  3. Backwardskey

    Backwardskey Phones Veteran

    Messages:
    39
    Likes Received:
    11
    First Language:
    English
    Primarily Uses:
    RMMV
    Yeah, I noticed that and immediately fixed it in the program, with no noticeable change.
    I've also tried experimenting with both Dynamic Actions and Dynamic Turn Count both on, both off, etc. etc. and the result is the same across all tests.

    I'm honestly not sure what's going on.
     
    #3
  4. shockra

    shockra Slightly Crazy Programmer Veteran

    Messages:
    409
    Likes Received:
    179
    Location:
    US
    First Language:
    English
    Primarily Uses:
    RMMV
    Did you start a new game after changing the plugin or reload a saved one? Because changes to a plugin aren't accepted when loading a saved game.
     
    #4
  5. Backwardskey

    Backwardskey Phones Veteran

    Messages:
    39
    Likes Received:
    11
    First Language:
    English
    Primarily Uses:
    RMMV
    I saved the project after the plugin change and then initiated a Battle Test.
     
    #5
  6. shockra

    shockra Slightly Crazy Programmer Veteran

    Messages:
    409
    Likes Received:
    179
    Location:
    US
    First Language:
    English
    Primarily Uses:
    RMMV
    Battle tests don't always run plugins correctly. What I would try is creating an event near the start of your game that starts the fight and going from there. When modifying a plugin, the best thing to do is to start a new game to test the difference; otherwise it may not accept the change.
     
    #6
  7. Backwardskey

    Backwardskey Phones Veteran

    Messages:
    39
    Likes Received:
    11
    First Language:
    English
    Primarily Uses:
    RMMV
    Update - the issue seems to be caused by using the Turn condition on any particular entry, no matter what the order of the entries are. If I use the Turn condition on any entry within the list at all, Counter-Lock doesn't receive the 2000 Speed bonus.
     
    #7

Share This Page