You are getting some very strange behavior!!
I just added the Wait command at the top of the priority list and put it on Always, the enemy waited at every turn. I know it didn't skip the AI notes because the heal has a weight of 9 and Wait has a weight of 1 in the list.
Before putting it back, I gave it its MP >= 1 condition again while it's still at the top. This time, it didn't pass the check and the enemy started healing on turn 1 again. Could my conditions be the issue?
It's certainly possible that your Conditions are the issue. But looking back on the conditions that I wrote (example below), and I tested each of them thoroughly and they all worked, I feel like the Conditions are well-formed.
User Level Param >= 20 +++ User MP Param >= 120 +++ Random 25%: Skill 54, Lowest HP%
The fact that it works as intended when you use Always, but not with MP >= 1, and the fact that the enemy seems to have enough MP to use the Heal skill, is what is so confounding about this.
I believe the intended behavior for falling through to the Weighted Skill List is that it only uses the Weighted Skill List if none of your Conditions at all have been met. For the rest of your debugging process, I'd recommend creating a new skill with an obvious name/animation and no MP cost - and an Always line for this skill as the last line of your AI tag, and also make this the only skill that the enemy can use in the Weighted Skill List. That will rule out fall-throughs as the reason your enemy is using the Heal skill (or using Wait if their MP is not being read correctly for some reason).
It would be very weird if you ever do see this new dummy skill being used, since with your new notetags User MP param <= 1 and User MP param > 1 should together make a catch-all that it never falls past. If you do see the dummy skill get used, let me know!
State 16 is indeed Burning, and I have no base troop event or specific troop event that reduces the enemies' HP. To test if it works, I spend the first turn making my characters either buff themselves or heal each other. Then at the following turns, I make them hit different enemies, either of which don't always end up being the targets of the heals.
Right, it sounds like you're doing everything right here.
The note is now (without the parts after //)
Code:
<AI Priority>
State === State 16: Skill 129, Lowest HP% //Heal enemies that are on fire to put it out
HP% param < 100%: Skill 129, Lowest HP% //Heal enemies that are hurt
User MP param <= 1: Skill 2, User //End your turn if you don't have enough MP to heal
User MP param > 1: Skill 90, User //If you do have enough just wait
</AI Priority>
and the enemy still heals at the start of turn 1.
I'm flying a bit blind and making assumptions because I haven't seen your game, but seeing a line that suggests using some kind of "Wait" skill (which, in MV's default behavior, means passing your turn) only if you have enough MP to act, and having that be different than Skill 2 (traditionally Guard) which the battler could use to pass their turn, together that makes me think that you have some kind of unique battle system plugin being used (or at least something very complex that you have done yourself). Is this the case?
If so, I would definitely recommend disabling (turning OFF) this battle system, if possible, and any other non-AI plugins that directly tie into the skill system (even turn off stuff like Instant Cast for this test, even though I can confirm it can coexist fine with AI Core). Save your project, and try testing again. If it works properly now, there is almost certainly an incompatibility in your plugins.
One additional thing I could think of is a problem in the skills' Scopes. Since you specify a target (here, you are specifying "User" for the End/Wait skills), I think only the User will be checked to see whether the skill can be used on him. If your skill's Scope is something like "1 Enemy" or "None", this
might prevent the AI Core from ever selecting it, whereas targets are not specified in the standard Weighted Skill List box. Make sure that the Scope for skills 2 and 90 makes sense ("The User" or "1 Ally" should be good).
A couple other things you could try:
- Try changing "MP param" to "HP param" on both MP param lines. If that fixes it, there may be some problem with the way your battle engine understands MP.
- Try changing HP% param < 100% to something like HP% param < 70%. There's no reason that < 100% shouldn't work, but I could envision a scenario where rounding errors are causing this Condition to evaluate as true on a full health enemy.
- Check your Note box and make sure there aren't any unmatched <notetags> </notetags> anywhere. Also be sure to hit F12 (sometimes F8) when you start a playtest and see if any suspicious error messages are in the console log.
- Try changing "param" to "Param". Like I said last time, case shouldn't matter in these notetags, but if you've already tried all those other things... worth a try, right?