This script adds some AI targeting priority. With this script, the enemies become able to pick a target based on the action specific priority.
Download the script here. You might also want to look at the patches below.
Installation
Put this script below ▼ Materials and above ▼ Main Process.
Usage
In an enemy notebox, you can add some tags.
<target [action_id] [shortcut]>where [action_id] corresponds to the enemy's action list, and [shortcut] corresponds to one of the implemented targeting priority method.
Example:
<target 1 high_hp>This will make the enemy target the battlers with the highest HP value when using action number 1 (by default Attack).
<target 2 low_hp_rate>This will make the enemy target the battler with the lowest HP percentage when using action number 2. If the action no. 2 is set to Heal, the enemy will proceed to heal its ally with the lowest percentage of health.
Available targeting shortcut is as follows:
low_hp high_hp low_hp_rate high_hp_rate low_mp high_mp low_mp_rate high_mp_rate low_tp high_tp low_tp_rate high_tp_rate self not_self
If you want to make your own targeting condition, use
<target eval [action_id]> [eval] </target eval>where [eval] is a ruby expression that takes returns -1, 0, or 1.
In the eval, a and b denotes the battlers that would be sorted.
For example, to make the enemy prioritize Eric when doing its ultimate skill, the tag will be
<target eval 8> if a.name == "Eric" -1 elsif b.name == "Eric" 1 else a.hp <=> b.hp end </target eval>
Do note that target selection is done at the start of the turn, like actors. The enemy will not suddenly change target mid-turn, for example if its target had already healed.
Also, TGR have no effect on acquiring target.
Patches:
There is a patch for Schala Battle System here.
Is there a possibly modification of this script that would give party members on auto-battle have the same characteristics of being able to target?
ReplyDeleteThanks,
MinisterJay
It can be done, yes. The logic is the same.
DeleteIt's been a long time since I did anything with rpg maker though (don't even have one installed on my machine) so me playing with script is kind of impossible right now.
Can I use this in a commercial game? You asked to be contacted first, so I want to respect that wish.
ReplyDeleteYes, you can. I just want proper credit and to be informed of the title (So I may be able to purchase it if I want to :) )
Delete