AI not obeying

Discussion in 'Javascript/Plugin Support' started by SnowyRain, Nov 7, 2015.

  1. SnowyRain

    SnowyRain Veteran Veteran

    Messages:
    51
    Likes Received:
    3
    First Language:
    English
    Hello, i've created a skill that an enemy is using, but he ends up never using it.

    I made so an tutorial battle he would use it to finish off the main character for example at 30%HP or below that.

    He never uses it, The battle event where they talk at 30%HP or less happens, where he says for the player to guard, but he then uses attack instead of Skill 6...

    https://i.gyazo.com/32c45732943f6554c8b39b863b340f23.png
     
    Last edited by a moderator: Nov 7, 2015
    #1
  2. Andar

    Andar Veteran Veteran

    Messages:
    28,332
    Likes Received:
    6,444
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    I've moved this thread to Plugin support. Please be sure to post your threads in the correct forum next time. Thank you.


    Please provide a link to the plugin you're using
     
    #2
  3. kiriseo

    kiriseo Veteran Veteran

    Messages:
    229
    Likes Received:
    74
    First Language:
    German
    Just to get it right.

    Your enemy should use "Dagger's Light" when the main character's HP is 30% or lower?
     
    #3
  4. SnowyRain

    SnowyRain Veteran Veteran

    Messages:
    51
    Likes Received:
    3
    First Language:
    English
    #4
  5. Andar

    Andar Veteran Veteran

    Messages:
    28,332
    Likes Received:
    6,444
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    I didn't ask for a picture of your plugin manager - I asked you to provide a link to yanfly's website with the instruction for the plugin and it's latest updates - especially to check if that plugin had been updated since it was included in the launch package, and to check if you used the correct notetags and so on.
     
    #5
  6. SnowyRain

    SnowyRain Veteran Veteran

    Messages:
    51
    Likes Received:
    3
    First Language:
    English
    Last edited by a moderator: Nov 7, 2015
    #6
  7. SnowyRain

    SnowyRain Veteran Veteran

    Messages:
    51
    Likes Received:
    3
    First Language:
    English
    I found it! But i still need help!

    The HP% Param is checking for himself only!(The enemy that is, so this means only when the enemy is bellow 35% is when he will do the attack!)

    How do i make him check the user for the hp!?
     

    HP% param is for himself only :s

    <AI Priority>

    HP% Param <= 35%: Skill 6, Highest HP%

    Always: Attack , Lowest HP%

    </AI Priority>
     
    #7
  8. kiriseo

    kiriseo Veteran Veteran

    Messages:
    229
    Likes Received:
    74
    First Language:
    German
    If I read the conditions on Yanfly's site correctly, it checks the parameter from the scope of the skill.

    If you're using an attack skill, it should use the parameters of the target (i.e. your party).

    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

    stat PARAM eval

    – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –

    Replace ‘stat’ with either ‘atk’, ‘def’, ‘mat’, ‘mdf’, ‘agi’, ‘luk’, ‘maxhp’, ‘maxmp’, ‘hp’, ‘mp’, ‘hp%’, ‘mp%’, or ‘level’ to run it in a condition check again to see if the action gets passed.

    The group that it checks will be based on the skill’s scope. If the skill targets foes, then all foes will take a check to see if they fulfill the conditions. Likewise for party members if the skill is for allies. The valid targets will be those who pass the condition check.

    – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –

    Example: HP% param <= 50%: Heal, Lowest HP%

    MP param > 90: Mana Drain, Highest MP

    ATK param > user.atk: Power Break, Highest ATK

    LEVEL param > 10 && target.notState(5): Blind, Random

    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
     
    #8
  9. Andar

    Andar Veteran Veteran

    Messages:
    28,332
    Likes Received:
    6,444
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    SnowyRain, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.


    If you want to add something and the last post is your own, simply edit it.

    That is what I imagined from the very beginning that it would happen.
    However, if you read the description of the plugin, you'll see that it is NOT automatically the enemy that gets checked, it's the scope target that gets checked.


    Which means we need a screenshot of your skill to continue searching for the solution.
     
    #9
  10. SnowyRain

    SnowyRain Veteran Veteran

    Messages:
    51
    Likes Received:
    3
    First Language:
    English
    Im sorry andar :s Didn't knew! Thanks :)

    This is how one of the skills is set up, ignore the formula,as its just for testing purposes xD

    https://gyazo.com/6621eff3ae15b9e304d0e420e12c729e

    I tried playing with the scope already, ally , 1 enemy all enemies :s 

    I saw that at yanfly's website but i ignored it since he scope was already set to enemies 
     
    Last edited by a moderator: Nov 8, 2015
    #10
  11. kiriseo

    kiriseo Veteran Veteran

    Messages:
    229
    Likes Received:
    74
    First Language:
    German
    Is this the skill with the id 6 that you used in your first screenshot?
     
    #11
  12. SnowyRain

    SnowyRain Veteran Veteran

    Messages:
    51
    Likes Received:
    3
    First Language:
    English
    Yes :) i changed names tried with names with Skill 6 etc, was just for testing purposes

    Why is something wrong with it?
     
    Last edited by a moderator: Nov 8, 2015
    #12
  13. Andar

    Andar Veteran Veteran

    Messages:
    28,332
    Likes Received:
    6,444
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    What is your default AI level in the plugin?


    And please, do not cut off parts of the window when making screenshots - that only causes us to ask additional questions (like if that is skill 6 or not)
     
    #13
  14. SnowyRain

    SnowyRain Veteran Veteran

    Messages:
    51
    Likes Received:
    3
    First Language:
    English
    Im so sorry ;_;

    It is the default i never changed it, in this case 80.

    PS: Changed it too 100 and it didnt work either.

    Is it impossible to make :( ?
     
    Last edited by a moderator: Nov 8, 2015
    #14
  15. kiriseo

    kiriseo Veteran Veteran

    Messages:
    229
    Likes Received:
    74
    First Language:
    German
    I may know what's wrong.

    Does your enemy have enough resources ( TP in this case ) for the skill?

    Because skill costs apply to enemies as well.
     
    Last edited by a moderator: Nov 8, 2015
    #15
  16. Andar

    Andar Veteran Veteran

    Messages:
    28,332
    Likes Received:
    6,444
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    That's most probably it - maxTP is 100 and usually TP starts with a random number between 1-25 at the beginning.


    And your skill requires the enemy to pay 45TP, so it can only be used after several turns of gaining TP unless you're using a TP-Plugin to change the values.
     
    #16
  17. SnowyRain

    SnowyRain Veteran Veteran

    Messages:
    51
    Likes Received:
    3
    First Language:
    English
    Well, it now works but he just uses it when he wants, he's not following any notetag :S

    Most of the times right away :/

    He just doesn't follow any of the notetags he just does what he wants.... Starting to annoy me been hours around this problem....

    A battle event, where he teaches the player where is attack, then those fill up TP, so he can use more powerfull skills. [Teacher is unbeatable btw], Teacher will only use attacks, when the player goes bellow 100HP(35% out of 285HP) he tells player about guard, then he uses that attack TEST. Either guarding or not it will defeat the player. That's all i want. This isn't really hard on paper so its kind of pissing me off.
     
    Last edited by a moderator: Nov 8, 2015
    #17
  18. kiriseo

    kiriseo Veteran Veteran

    Messages:
    229
    Likes Received:
    74
    First Language:
    German
    I've testet the plugin this morning, and it works as it should.

    Post a complete screenshot of the enemy page and your event.
     
    #18
  19. SnowyRain

    SnowyRain Veteran Veteran

    Messages:
    51
    Likes Received:
    3
    First Language:
    English
    #19
  20. kiriseo

    kiriseo Veteran Veteran

    Messages:
    229
    Likes Received:
    74
    First Language:
    German
    I know what the problem is.

    It lies within the order of the commands in the AI Property tag

    The plugin starts from top and only if that condition is not met it will check the next.

    The first one is "Always" so he does that one everytime and the second will never be used.

    Switch those two and he should use the skill.
     
    Last edited by a moderator: Nov 9, 2015
    #20

Share This Page