MV [SOLVED] Row Formation - How to set the actor home coordinates?

I've previously used a plugin called SVActorPosition to reposition the party, and I only now replaced it with Yanfly's Row Formation in order to add a bit of depth to the targeting system in MV.

The former coordinates I've used are like so:
Spoiler
1638446945302.jpeg

1638446896374.png

I don't have a very good understanding of the variables used in these formulas, or of Javascript in general...but which of these parameters should I change to get the result I did above? Everything shown below is the default settings.
Spoiler
1638447042696.png

I have it set up so far to where you have just two rows to work with; I just need to move their home positions.

Suggestions of any sort are welcome. Please.😅
Well, I could spend a bit of time doing it. But I'll just tell you that your example doesn't seem to support row formations? It seems like it's just two rows, would they always swap places or do you want to add more rows?

Or do you want them to move based on the amount of actors in a certain column? Like if there's 2x2 and suddenly it's 3x1 would you want the lonely character at the back to position themselves behind the center character in the front row?
1638463857166.png


Correct if I am completely misunderstanding the concept. Perhaps YEP row formations does that automatically?
Correct if I am completely misunderstanding the concept. Perhaps YEP row formations does that automatically?
Yes, it has plugin parameters to automatically adjust battler positions based on which row state they have on.

@A-kun it would be helpful to see what your battlers look like now so we see what you want to change. But since you were using exact coordinates before, the math should be extremely simple.

For example, your highest value X position before was 752, so you make the Maximum Row X parameter be 752. Then your row 1 actors were positioned at 640 and 608, so you'd make Row 1 Home X something like
Code:
maxRowX - 80 - (rowIndex * 32)

I'm thinking that rowIndex number represents the index of the actor within their row, but without poking into the code I'm not certain. So it may need some tweaking, but that's the idea...then you just repeat the process for row 2, and for your Y values.
Yes, it has plugin parameters to automatically adjust battler positions based on which row state they have on.

@A-kun it would be helpful to see what your battlers look like now so we see what you want to change. But since you were using exact coordinates before, the math should be extremely simple.

For example, your highest value X position before was 752, so you make the Maximum Row X parameter be 752. Then your row 1 actors were positioned at 640 and 608, so you'd make Row 1 Home X something like
Code:
maxRowX - 80 - (rowIndex * 32)

I'm thinking that rowIndex number represents the index of the actor within their row, but without poking into the code I'm not certain. So it may need some tweaking, but that's the idea...then you just repeat the process for row 2, and for your Y values.
I have no idea if I got my math wrong or not, but it didn't work. ;w;

Weirdly enough, it almost looks like the opposite of my setup?
Spoiler
1638482156254.png

1638482104559.png
So swap your X values for rows 1 and 2. (to be slightly fair to you, I did mistype in my prior post when I was saying "your highest X values...so make row 1". Obviously, the highest X values should be for row 2)
So swap your X values for rows 1 and 2. (to be slightly fair to you, I did mistype in my prior post when I was saying "your highest X values...so make row 1". Obviously, the highest X values should be for row 2)
I swapped the formulas and it still looks off. I now wonder if the default formulas do something else...

Here they are, if it helps anything. I notice the row x and y formulas are the same across each row setting:
Code:
 * @param Maximum Row X
 * @parent ---Position Settings---
 * @desc The maximum X position value for the row X value.
 * @default screenWidth - partySize * 32 - 16
 *
 * @param Maximum Row Y
 * @parent ---Position Settings---
 * @desc The maximum Y position value for the row Y value.
 * @default screenHeight - statusHeight - 16
 *
 * @param Minimum Row Y
 * @parent ---Position Settings---
 * @desc The maximum Y position value for the row Y value.
 * @default screenHeight - statusHeight - 16 - (maxSize * 64)
 *
 * @param Center Row Y
 * @parent ---Position Settings---
 * @desc The center Y position value for the row Y value.
 * @default (maxRowY + minRowY) / 2 + 16
 *
 * @param Row 1 Home X
 * @parent ---Row 1 Settings---
 * @desc This is the formula used to determine the Home X location
 * for this row.
 * @default maxRowX - (maxRows - rowId) * 112 + rowIndex * 32
 *
 * @param Row 1 Home Y
 * @parent ---Row 1 Settings---
 * @desc This is the formula used to determine the Home Y location
 * for this row.
 * @default centerY + ((rowSize / -2 + 0.5) + rowIndex) * 32

Oh, and the screen size I am currently using is 864 [width] by 624 [height]
--
EDIT: I'm so close!! Here are my current settings, and the screenshot when I battletest


Spoiler
1638632668378.png

1638632711435.png

I've got them roughly in the right positions! I just need to move them to the right, somehow. Something about the current formula makes it do this...but removing the numbers in front makes them move to the upper left corner. Changing the minuses to pluses or vice versa doesn't work. 😅

But what I have figured out is, "rowId" dictates the space between rows, and "rowIndex" dictates the offset of the members in their row. [Ex, "rowIndex * 0" means they'd be perfectly lined up. I learned it here!]
--

EDIT 2: I DID IT
AAAAAAAAAAAAAAAAAAAAAAA


Spoiler
a.jpg

Using the values you recommended for the min/max values and the default equation for the X coordinates did it
I actually got the Y coordinates correct with some fiddling, heh 😊
Thanks so much for pointing me in the right direction!

Original thread: https://forums.rpgmakerweb.com/threads/solved-row-formation-how-to-set-the-actor-home-coordinates.142656/