- Joined
- Aug 1, 2016
- Messages
- 879
- Reaction score
- 566
- First Language
- English
- Primarily Uses
- RMMV
@NatePlays Yes, aiTarget formulas are just evals, the same as a damage formula or the like. There's a list of pre-calculated properties you can use, like distance, health, facing direction, what kind of terrain you'd have to end your turn on, etc, since the aiTarget formula decides not just which enemy to target, but which position to stand on to reach them. I have a formula for assassins that prioritizes people with their backs exposed, for example.
Target rate is a multiplier on the result of the aiTarget formula, so a target rate of 2.0 makes them twice as valuable, 0.5 makes them half as valuable, etc. There is no randomness in targeting unless you choose to add some yourself. If you want a specific skill to not be affected by target rate, use <aiIgnoreTgr>. I use this on healing skills in particular, so that your healers don't suddenly think the warrior is the most important target when they taunt, or ignore the injured rogue because he's hiding. The AI will only target someone with a final "score" above 0.
If you're using SRPG_PositionEffects, you can use <anyTarget> to make skills that can target enemies and allies alike, at which point, you want to use <aiFriendRate:> and <aiOpponentRate:> tags. They act as another multiplier to their "score" based on if they're on the same team as each other or not. That way, you can allow players to attack their own units if they really want to, but also tell the AI not to punch their friend in the face, or heal their enemy, by setting the rate for that team to 0, or -1, or the like.
Those rates become especially important for AoE skills, which use the total combined score of everyone affected by the AoE- so if you make a fireball that can hurt both allies and enemies, you might set <aiFriendRate:-1> to make them try to avoid hitting their friends (unless there's a lot more enemies), or <aiFriendRate:-99> so they'll functionally never, ever use the AoE if it might hit an ally, or <aiFriendRate:-0.5> if they're fine hitting one or two friends to deal with one enemy.
Check the descriptions of the plugins for more detailed information- I try to write pretty comprehensive documentation on all of them, especially ones with lots of options.
Target rate is a multiplier on the result of the aiTarget formula, so a target rate of 2.0 makes them twice as valuable, 0.5 makes them half as valuable, etc. There is no randomness in targeting unless you choose to add some yourself. If you want a specific skill to not be affected by target rate, use <aiIgnoreTgr>. I use this on healing skills in particular, so that your healers don't suddenly think the warrior is the most important target when they taunt, or ignore the injured rogue because he's hiding. The AI will only target someone with a final "score" above 0.
If you're using SRPG_PositionEffects, you can use <anyTarget> to make skills that can target enemies and allies alike, at which point, you want to use <aiFriendRate:> and <aiOpponentRate:> tags. They act as another multiplier to their "score" based on if they're on the same team as each other or not. That way, you can allow players to attack their own units if they really want to, but also tell the AI not to punch their friend in the face, or heal their enemy, by setting the rate for that team to 0, or -1, or the like.
Those rates become especially important for AoE skills, which use the total combined score of everyone affected by the AoE- so if you make a fireball that can hurt both allies and enemies, you might set <aiFriendRate:-1> to make them try to avoid hitting their friends (unless there's a lot more enemies), or <aiFriendRate:-99> so they'll functionally never, ever use the AoE if it might hit an ally, or <aiFriendRate:-0.5> if they're fine hitting one or two friends to deal with one enemy.
Check the descriptions of the plugins for more detailed information- I try to write pretty comprehensive documentation on all of them, especially ones with lots of options.