Yanfly's Battle AI Core: Randomly skipping turns

Papillon

Veteran
Veteran
Joined
Feb 22, 2017
Messages
60
Reaction score
8
First Language
English
Primarily Uses
RMMV
I'm having an issue in Yanfly's AI Core where, for some reason, listing skills in the "AI Priority" tag causes the enemy to just sometimes not use skills even if they meet the condition.

For example, I have two skills I want an enemy to use. Both will only trigger if a variable is equal to or greater than 3 and equal to or less than 5, and only one will trigger if a second variable is above or below 50.

Code:
Variable 206 >= 3  +++ Variable 206 <= 5 +++ Variable 208 < 50: SKILL 701
Variable 206 >= 3  +++ Variable 206 <= 5 +++ Variable 208 >= 51: SKILL 702
Even if the enemy has met these conditions, it will sometimes ignore them and spend a turn doing nothing or even use the wrong skill entirely. Even forcing the enemy to use a skill on turn 1 causes it to do nothing sometimes. It seems entirely random as to if a skill will work or not and I can't work out a cause.

All my plugins are organized correctly and I'm not using any other plugins that change battle systems outside of Yanfly's own, so I'm not sure what the issue is.
 

MagicPizzaGuy

Mother of All Omelettes
Veteran
Joined
Jul 16, 2014
Messages
50
Reaction score
45
First Language
Portuguese
Primarily Uses
RMMV
I had some problems also with AI core and all of them until now were my fault. I don't know exactly what's going on, but it would be good for you to press F8 and check if your variables are all acting correctly.

I don't know how much you already know about this, so I will act as if I was problem solving my own game.

Inside the battle I would press F8, F8 is my best friend and I love him.
There I would write $gameVariables.value(206) and enter. Check value.
Then I would write $gameVariables.value(208). Check value.
I would look at the mana cost for the skill and how much mana the monster has. $gameTemp._actionBattlers (IDK if this is a thing from RPG MV or Yanfly, but I think it should work). I would search in the arrow for the enemy I want to look.
Then I would look into the notetags and see if I made the monster with AI of 100 (I think this is what it must be done so the AI follows the command strictly instead of acting on its own)
Then I would check if the plugin in the plugin list is set at 100 and not the deafult 80

If nothing works I would be frustrated, but would search somewhere else, I can't remember what else I would look now, I hope I could help
 

Lay

Veteran
Veteran
Joined
Jul 18, 2019
Messages
124
Reaction score
47
First Language
French
Primarily Uses
RMMV
This is how I understand your conditions :

condition for skill 701 : Variable 206 must be between 3 and 5 included and variable 208 must be strictly lower than 50.
condition for skill 702 : variable 206 must be between 3 and 5 included and variable 208 must be greater or equal to 51.

condition are not met
- if variable 206 is strictly lower than 3
- if variable 206 is strictly greater than 5
- if variable 208 is equal to 50.

try to insert more condition in order to cover all possibilities :

Code:
Variable 206 >= 3  +++ Variable 206 <= 5 +++ Variable 208 < 50: SKILL 701
Variable 206 >= 3  +++ Variable 206 <= 5 +++ Variable 208 >= 51: SKILL 702
Variable 206 < 3 : SKILL 801
Variable 206 > 5 : SKILL 802
Variable 208 === 50 : SKILL 803
use skill 801, 802 and 803 as reporter skill for checking purpose.

You will see if sometimes your condition are not met.
Also, add a skill to the enemy using the default setting. Thus, if no condition are met, you will see it.
 

Papillon

Veteran
Veteran
Joined
Feb 22, 2017
Messages
60
Reaction score
8
First Language
English
Primarily Uses
RMMV
try to insert more condition in order to cover all possibilities :
I've attempted to make individual conditions for each possible combination, but for some reason it still misses turns even when conditions are met.
Even more confusing is that if I just apply a basic "Always: Skill 1" command it still likes to skip turns.

I'm using the latest version of AI core and this happens even on a new project, so I'm really not sure what's happening.
 

Lay

Veteran
Veteran
Joined
Jul 18, 2019
Messages
124
Reaction score
47
First Language
French
Primarily Uses
RMMV
Have you set <AI Level: 100> as @MagicPizzaGuy recommended ?
If you didn't, you have a 20% chance that a condition will be false regardless of its code. The default value of 80 can be change in the plugin parameters. you can also use the notetag to fixe a value for each enemy.

Since I can't reproduce your problem I'm just guessing.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

being able to transition music seamlessly is amazing. my main character's theme has lyrics and it goes from vocal version to istrumental when he leaves his room. and vice versa. and thanks to a plugin, the transition is seamless. I love it.
All of the auditions for our game are so good, I'm so glad I'm not in charge of choosing completely. lol I just can't with some of them. I listen to them on repeat. XD
Working on a Patch to integrate AlphaABS into random generated Dungeons. Was a bit tricky, but the outcome is a real Life Changer!!

Will release it the next days!
Been pretty busy... but I got a better headset for recording and listening today. Dad says that he'll consider taking me to Great Wolf Lodge for the first time once I finish summer classes (my final semester!) I'll be taking my plushie friends with me: Bendy, Lolbit, and Helen Henny. (I WUV PLUSHIES!)
SF_Monster3,4 added!

Forum statistics

Threads
105,651
Messages
1,015,301
Members
137,327
Latest member
Mezzy
Top