Hello!
So I'm making an enemy and using Yanfly's plugins. I want to make it so that the enemy will only use the skill when a specific state is applied to them.
I tried:
Code:
<AI Priority>
Eval user.state() === 'Stun': Skill 93
</AI Priority>
With "Stun" being the name of state 15. I know AI priority can use Eval, but i'm uncertain as to what can be checked (the example provided by Yanfly checks the user's name).
I've had success using AI priority for other things, it's mostly just Eval that i'm confused on.
I'll also accept any solutions that use a different method for making an enemy only use a skill when a certain condition is applied to them.
UPDATE: Currently i've removed it from the AI Priority and added it to Action Patterns. It's not perfect, but in this instance it should do (however, AI priority will check first, then Action Patterns; which cn potentially be a problem).
I figured that i could also do troop events to run a common event or something that would check if the enemy/user had the state and then auto use the skill (maybe forcing an end to their turn, otherwise it'd act as a bonus action. IDK i haven't fiddled with it yet, as I don't need to for now.)
Also I could use the "State" condition for the enemy to activate a skill that targets himself,
Code:
<AI Priority>
STATE === state stun: proxy, User
</AI Priority>
that will then activate the actual skill that deals dmage to an enemy. It's just a little obtuse.