I'm back at it with another Row Formation situation, but this time? FOR ENEMIES!
Has anyone had any luck altering enemy Position in battle beyond the troop database?
What I'm looking to do is run a <Once Parallel When Start Battle> via Battle Core
to change enemy position based on note tag.
<melee> in row 0
<range> in row 1
<boss> in row 2
no note tag in row 0
I've tried modifying my existing Actor Row Formation to work but its not catching.
Has anyone had any luck altering enemy Position in battle beyond the troop database?
What I'm looking to do is run a <Once Parallel When Start Battle> via Battle Core
to change enemy position based on note tag.
<melee> in row 0
<range> in row 1
<boss> in row 2
no note tag in row 0
I've tried modifying my existing Actor Row Formation to work but its not catching.
// Declare Constants
const sprite = this;
const enemy = this._battler;
const index = arguments[0];
// Declare Variables
const target = arguments[0];
let goalX = 0;
let goalY = 0;
// Check for note tags
let row;
if (enemy.enemy().meta.melee) {
row = 0; // Melee tag found, place in the front row
} else if (enemy.enemy().meta.ranged) {
row = 1; // Ranged tag found, place in the back row
} else {
// If no specific tag is found, you can set a default row here
row = 0; // Default to front row
}
// Calculate X Position / Row Formation
let x;
if (row === 0) { // Front Row - Melee Enemies
x = Math.round((Graphics.width / 2) + 275);
} else { // Back Row - Ranged Enemies
x = Math.round((Graphics.width / 2) + 430);
}
x += index * 15;
// Calculate Y Position
let y = (Graphics.height - 220) - ($gameTroop.members().length * 48) - Math.floor((Graphics.height - Graphics.boxHeight) / 2);
y += $gameTroop.rows[row] * 70;
$gameTroop.rows[row]++;
// Set Home Position
this.setHome(x, y);
// Set goalX and goalY
goalX = x;
goalY = y;