11-17-2015, 11:57 PM
Dealing with priorities is partly why I created a script to decide skills based on scripting alone. I mean, on top of combination conditions.
The enemy I've been testing with this system has an AI like this for example:
No that's not my original code, I just wrote it as more human-readable to explain it. :B After each use skill line is a "return if item" line, this checks if the skill can be used and if there are targets. (If not these have already been cleared.) Since the alternative is to skip "return", the script continues to the next line/skill.
This lets me say basically "if x, use this skill, if not, try this skill, if not..." instead of the more ambiguous "Ratings" the editor gives me.
Giving an enemy its own allies (or even several turns) allows you more leeway with regards to AI/strategy. Bosses are often only on their own, so they can be a bit dumb brute force. This enemy for example will cure ailments, and thanks to my previous mentioned code it will only make sure to do this if anyone actually needs curing.
The enemy I've been testing with this system has an AI like this for example:
Code:
if your turn is equal to troop size and you have full HP
berserk yourself
if you're not berserk
use Devile (cures basic ailments)
if (mp is low and rand(3) is 1) or mp is *really low*
rest
use attack
if you *are* berserk
if flag is off
use special A
turn on flag
if flag is on
use special B
turn off flag
if all else fails, return nil
No that's not my original code, I just wrote it as more human-readable to explain it. :B After each use skill line is a "return if item" line, this checks if the skill can be used and if there are targets. (If not these have already been cleared.) Since the alternative is to skip "return", the script continues to the next line/skill.
This lets me say basically "if x, use this skill, if not, try this skill, if not..." instead of the more ambiguous "Ratings" the editor gives me.
Giving an enemy its own allies (or even several turns) allows you more leeway with regards to AI/strategy. Bosses are often only on their own, so they can be a bit dumb brute force. This enemy for example will cure ailments, and thanks to my previous mentioned code it will only make sure to do this if anyone actually needs curing.