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 Posts

Latest Profile Posts

Finished that egg-sitting mini-game I mentioned here a couple weeks back. Now to fix the weather system so it doesn't rain indoors while you're playing it. >.> A simple fix in itself; leave it to me to take it as an excuse to completely revamp the time/weather/lighting system from scratch.
I'm really tempting to pre order cyberpunk 2077... should I do it or not :/ I really want to play the game but don't want to take a big hit to my saving because of it
So I need to come up with quite a few action sequences.
Was stressing about this plugin earlier, but pretty happy with how its looking now! Purple makes it pop more too!! :)

Forum statistics

Threads
105,485
Messages
1,014,082
Members
137,133
Latest member
Stuart18
Top