Enemies not following A.I. Priority

Can't seem to figure out what's wrong with this AI Script:

<AI Level: 100>
<AI Consider Taunt>
<AI Priority>
State === State 4: Skill 15, User
State === State 12: Skill 15, User
HP% param <= 40% +++ State !== State 13: Skill 8, User
Party Alive Members > 2 +++ State !== State 13 +++ Random 35%: Skill 11
State !== State 13: Skill 1
</AI Priority>


Walking down the list:

It checks if the enemy has (poison - state 4) or a DoT poison (State 12) - had to break them apart because the OR (||) doesn't work either - If the enemy (in this case THE ONLY enemy on the screen) is: cast anti-poison (Skill 15) to cure it, targeting itself (The User of the Skill). :: Doesn't work - he randomly plops the cure on the party members. Unless there's a Taunt-then he just targets that one.

If the enemy's health drops below 40% and he's not using the ability (State 13) that requires a charge up **don't even get me started with that mess** - cast Skill 8 (Heal) targeting himself (the User of the Skill). This Code Works.

If the Party is Alive with >2 members and the enemy isn't charging up, on a random 35% use skill 11 (Hit all the party members) << This Code Works

Lastly: If the enemy Is NOT Charging up (And no qualifying abilities above are true, Simply use Skill 1 (Attack) << Seems to work.



I've tried so many different kinds of combinations to get this enemy to not act stupidly: Blank, User as a target, Lowest HP%, Highest HP%, Evals, Etc. he always targets someone in the PARTY.

These Codes are nearly straight from the examples of AI Priority. Even more so from watching the videos.

Why some work, when others don't just confounds me. Those that work, just target the wrong people.

Does any other eagle eyes out there see the problem. It maybe I am too close to the picture to see the whole, always love it when another person can scan something.

Thank you for any help.

- One Burnt Out Old Man
What plugin are you using for this? There's no AI priority notetags in the base engine, and I'm pretty sure there's at least two standalone AI overhaul plugins, not to mention battle systems with their own setups.
It’s the Yanfly AI Priority plugin.

I’ve ironed out the poison: seems you can’t check for more than just one. Which sucks because that means there can’t be any harder hitting ones later, except to base it off the stats. Which might not be too bad, I’ll have to do the math later.

It seems I’m slowly ironing it out.... I’ll report back once I know more. Heading out for foods....
It’s the Yanfly AI Priority plugin.

I’ve ironed out the poison: seems you can’t check for more than just one. Which sucks because that means there can’t be any harder hitting ones later, except to base it off the stats. Which might not be too bad, I’ll have to do the math later.

It seems I’m slowly ironing it out.... I’ll report back once I know more. Heading out for foods....

A common solution for poisons specifically is to make a single poison status that does flat damage instead of a % of max, and control the damage dealt based on either the user's stats, or by setting a state counter or something (using Yanfly's Buff & States Core, obviously). This means you can have bosses get poisoned without trivializing them, and have much more precise control over how strong poisons are.
Yeah - I agree. Just gotta wrap my head around some math when I get home.
<AI Level: 100>
<AI Consider Taunt>
<AI Priority>
State === State 4 +++ Random 45%: Skill 15, User
HP% param <= 40% +++ State !== State 13: Skill 8, User
State !== State 14 +++ State !== State 13: Skill 16, User
Party Alive Members > 2 +++ State !== State 13 +++ Random 35%: Skill 11
State !== State 13: Skill 1
State !== State 14 +++ State !== State 13: Skill 16, User
</AI Priority>

Well, I moved a few skillsets around (deleted some older ones) and this is the final code that works. It's not different enough from the original to make me wonder if it was just bad code - just reorganized and with a few random commands sprinkled in to make the critter not use every power every time it could.

I combined these with Custom Status Parameters to really give this guy some flair. Worked out in the end rather nicely.

Thanks Again To All Those Who Dropped In And Gave Advice.

Original thread: https://forums.rpgmakerweb.com/threads/enemies-not-following-a-i-priority.114828/