[MV] Precisely positioning enemy battlers

I'm using MV to make a pixel art game, with each asset scaled to 2x, but I'm having a lot of trouble with enemy battlers. They aren't lining up with the pixel grid I use for the background, and it ends up looking a little jarring. Is there a way to manually set enemy positions with X and Y values?
1709747410900.png
The spots where you can most easily see the misalignment are circled.
Thanks for the help! The "enemy placement" plugin is probably closest to what I need.

Unfortunately the explanation given within the plugin is very confusing. I can't tell how to use it.
Use the following notetags in the enemy notebox:



<XPosEval: [expression]> and <YPosEval: [expression]>

to place the enemy graphic at the X/Y position to which the Javascript line

[expression] evaluates. You can also use pure numbers.



<UseDefaultXPos> and <UseDefaultYPos>

to place the enemy graphic at the default position specified

in this plugin's parameters.



The plugin parameters allow you to set default formulas for the X and Y

positions. Set the parameter "Use Default Placement" to true if all

enemies without their own <X/YPosEval> notetags should use these default

values. You can also keep "Use Default Placement" set to false and use

the <UseDefaultX/YPos> notetags for each enemy that should be placed

at the default position.



You can use the following variables as part of [expression]:

screenWidth - the width of the game window in pixels

screenHeight - the height of the game window in pixels

troopSize - the number of enemies in the troop

index - the index of the enemy within the troop

statusHeight - the height of the status window

(If you know what you are doing, you can also use:

this - the Game_Troop object

e - the Game_Enemy object)

For reference, the default X/Y positions in the parameters are:

X: 16 + (troopSize + 2) * 32 - index * 32

Y: screenHeight - statusHeight - troopSize * 48 + (index+1) * 48 - 32
It seems to be intended to place in an enemy's notetags, not troop notetags? But I need to be able to place different copies of the same enemy in different places within the same troop. Something like "Set enemy #1's position to X32/Y64, set enemy #2's position to X64/Y64", etc.
It seems to be intended to place in an enemy's notetags, not troop notetags?
...that's all you can use - if you look at the troop screen, there are no troop notes, thus there can't be troop notetags 😛

But I need to be able to place different copies of the same enemy in different places within the same troop. Something like "Set enemy #1's position to X32/Y64, set enemy #2's position to X64/Y64", etc.
You can use what's provided by the plugin instructions to do that.

1709750120370.png


The index is the order they were added in when you added them to the troop, starting with 0.

Presuming you're not familiar with JavaScript math functions, it's impossible to give you anything more specific without you providing the information - choose one of your enemies and list the coordinates they would appear at.
if you look at the troop screen, there are no troop notes, thus there can't be troop notetags 😛
...oh, huh, you're right. That makes this way harder.

I don't think I can use any sort of formula in a given enemy's notes to arrange them since I was hoping to be able to place enemies in specific squares on the grid in the screenshot (as I'm using yanfly's AOE script). I was hoping for a way to set every enemy's position for each troop manually.

Failing that, are there any scripts that just round up every enemy's X and Y values to the nearest even number so their pixels are aligned with the background? Thanks for your help.
I accomplished this by editing the Troops.json file directly, for each member there will be an enemyId, x, y, and hidden flag. You can manually set the x and y coordinates for pixel perfect positioning.

Word of warning though, back up the file before attempting to do this as you don't want to misformat it and cause it to become unreadable by RMMV.
Oh I think this'll work great, thanks!

Original thread: https://forums.rpgmakerweb.com/threads/mv-precisely-positioning-enemy-battlers.166537/