Hello, I want to make an enemy tank that can protect their allies on the same row as them. I want the enemy tank to specifically target 1 enemy (not itself) on the same row as them that has the least amount of health.
--------------Concept for better understanding (I know this doesn't work but this is what I mean)--------------
Condition: If alive in troop row 1 is greater than 1 AND If SkillUser row = 1, then use skill "Protect" on a Troop Member on the same row as SkillUser with the lowest HP excluding the SkillUser
Then I would repeat that for each of the 4 rows, but I don't know how to do it. I run into the issue of the conditions I set in the AI battler notes of an enemy checking the target when I want it to check if the user of the skill and the target are in the same row.
-----------------------------------------------------------------------------------------------------------------
Action order of tank enemy (example of what I want to happen)
Turn 1
-Starts in row 4, decides to use a skill to move forward to row 3 because it's melee only (note: I set melee attacks to only be used when in row 1 and 2 'aka the front rows')
Turn 2
-Realizes it's in a row where there is another enemy, so instead of moving forward again to row 2, there is a chance that it instead uses a skill to protect the weakest enemy on it's row by applying a buffing state to it, named "protected" or something similar
Turn 3
-Instead of protecting the enemy again, it instead via chance uses the skill to move forward to row 2 which has another enemy already in that row.
Turn 4
-Realizes it's in a row where there is another enemy, but instead of moving forward to row 1 or protecting the enemy on the same row 2, via a slim chance, it decides to attack using it's melee ability
Turn 5
-Realizes it's in a row where there is another enemy, so it decides to use the protect skill instead of moving forward or attacking, but there are two other enemies other than itself, so it picks the enemy with the lowest amount of health to keep it alive
Extra
Every time I say by chance, I mean the Random % condition in Yanfly's AI Battler which I like
Example of random condition from another enemy I have, So even though it can meet the conditions, that enemy might just not wanna do that skill:
Troop Alive Members > 2 +++ State !== State 53 +++ Random 20%: Skill 111
--------------Concept for better understanding (I know this doesn't work but this is what I mean)--------------
Condition: If alive in troop row 1 is greater than 1 AND If SkillUser row = 1, then use skill "Protect" on a Troop Member on the same row as SkillUser with the lowest HP excluding the SkillUser
Then I would repeat that for each of the 4 rows, but I don't know how to do it. I run into the issue of the conditions I set in the AI battler notes of an enemy checking the target when I want it to check if the user of the skill and the target are in the same row.
-----------------------------------------------------------------------------------------------------------------
Action order of tank enemy (example of what I want to happen)
Turn 1
-Starts in row 4, decides to use a skill to move forward to row 3 because it's melee only (note: I set melee attacks to only be used when in row 1 and 2 'aka the front rows')
Turn 2
-Realizes it's in a row where there is another enemy, so instead of moving forward again to row 2, there is a chance that it instead uses a skill to protect the weakest enemy on it's row by applying a buffing state to it, named "protected" or something similar
Turn 3
-Instead of protecting the enemy again, it instead via chance uses the skill to move forward to row 2 which has another enemy already in that row.
Turn 4
-Realizes it's in a row where there is another enemy, but instead of moving forward to row 1 or protecting the enemy on the same row 2, via a slim chance, it decides to attack using it's melee ability
Turn 5
-Realizes it's in a row where there is another enemy, so it decides to use the protect skill instead of moving forward or attacking, but there are two other enemies other than itself, so it picks the enemy with the lowest amount of health to keep it alive
Extra
Every time I say by chance, I mean the Random % condition in Yanfly's AI Battler which I like
Example of random condition from another enemy I have, So even though it can meet the conditions, that enemy might just not wanna do that skill:
Troop Alive Members > 2 +++ State !== State 53 +++ Random 20%: Skill 111