There are some ways to manipulate targets. I'm sure there are some good scripts for this out there, but of course I can't recall one out of my head, so I'd leave it to you to search for one if you need it.
🙂
Apart from that, you could use this to manipulate the target of an enemies next action, similar to what Heirukichi already suggested. This code can be executed before the enemy makes their turn
(e.g. during a troop event at the start of the turn):
Code:
enemy = $game_troop.enemies[ INDEX ]
if enemy && enemy.current_action
enemy.current_action.target_index = INDEX
end
Replace the INDEX in line 1 with the index of the respective enemy
(starting with 0), and in line 3 with the index of your preferred target
(also starting with 0). Note that these represent the positions of the battlers within their units, not their database IDs. You can use variables here as well of course.
The downside of this one is that it will behave like the actor target selection. If the original target is dead once the enemy makes their turn, they will target the first party member instead of a random one. Also if you use the "Action Times+" feature for your enemy, this will only affect their first action in a turn.
To make the second enemy use their actions on either actor #2 or #3 for example, you could also use this code, which already filters out dead and out-of-party actors:
Spoiler
Code:
enemy = $game_troop.enemies[1] #<- Second enemy (Index = 1)
if enemy && enemy.current_action
# Find all preferred actors (out of actor 2 and 3) that are in the party and alive:
targets = [2, 3].map { |i| $game_actors[i] }.select { |a| a.index && a.alive? }
# Select the party position of a random preferred actor if there is any:
enemy.current_action.target_index = targets.sample.index unless targets.empty?
end