I have been working on a way to show a battler image in CGMV Encyclopedia when using Yanfly's Sideview Animated Enemies.
So I have come up with a script that, so far seems to work.
What I am trying to do now is turn this into a loop that will check every enemy in the database and not just one enemy at a time.
I tried to make a for loop but I feel like I am getting errors.
I have not yet come to fully understand loops. I have looked at a few examples and I just don't understand how to check the battler name of each enemy while using a loop as opposed to running this script individually for each enemy.
So I have come up with a script that, so far seems to work.
JavaScript:
if ($dataEnemies[6].battlerName === '' && $dataEnemies.sideviewBattler != '') {
$dataEnemies[6].battlerName = $dataEnemies[6].name;
}
What I am trying to do now is turn this into a loop that will check every enemy in the database and not just one enemy at a time.
I tried to make a for loop but I feel like I am getting errors.
Code:
for (let i = 0; i < $dataEnemies.length; i++) {
if($dataEnemies[i].battlerName === '' && $dataEnemies[i].sideviewBattler != '') {
$dataEnemies[i].battlerName = $dataEnemies.name;
}
}
I have not yet come to fully understand loops. I have looked at a few examples and I just don't understand how to check the battler name of each enemy while using a loop as opposed to running this script individually for each enemy.