Hi everyone, I'm trying to reposition my own sideview battlers. I know how to reposition the enemies, but I can't seem to reposition my own, and they end up standing too high, and on the background. How can I fix this? Here's my battler view, and plug ins
MZ Sideview battler positioning
Javascript/Plugin SupportDid you change it in VS Battle Core plugin settings? Actor Battler Settings -> JS: Home Position
this is something i have troubles with too! my side view battlers cover each other so some of them can't be seen
No I didn't actually, good catch as I wasn't sure where to find that. I'm still a bit new, so I didn't want to mess with the code, but the code is:
// Declare Constants
const sprite = this;
const actor = this._actor;
const index = arguments[0];
// Make Calculations
let x = Math.round((Graphics.width / 2) + 192)
x -= Math.floor((Graphics.width - Graphics.boxWidth) / 2);
x += index * 32;
let y = (Graphics.height - 200) - ($gameParty.maxBattleMembers() * 48);
y -= Math.floor((Graphics.height - Graphics.boxHeight) / 2);
y += index * 48;
// Home Position Offsets
const offsetNote = /<SIDEVIEW HOME OFFSET:[ ]([\+\-]\d+),[ ]([\+\-]\d+)>/i;
const xOffsets = actor.traitObjects().map((obj) => (obj && obj.note.match(offsetNote) ? Number(RegExp.$1) : 0));
const yOffsets = actor.traitObjects().map((obj) => (obj && obj.note.match(offsetNote) ? Number(RegExp.$2) : 0));
x = xOffsets.reduce((r, offset) => r + offset, x);
y = yOffsets.reduce((r, offset) => r + offset, y);
// Set Home Position
this.setHome(x, y);
Looking at this what numbers would you tweak on the Y axis to make this work a bit better?
I'm glad you found this then, hopefully we can both learn something today 🙂
The y value in 'Make Calculations'
You can add a line there at the end like
y -= 100;
EDIT: actually y += 100;
You can add a line there at the end like
y -= 100;
EDIT: actually y += 100;
ahh haha I got there eventually. I did the original but made it -125 and it worked perfectly thank you!
how did you do this?
Are you asking how my math looked different or where did I put the code?
Of the former, or seems that y-= - 125 is the same as y+= 125, so it worked out.
As for the latter:
I took this section of the code
"// Make Calculations
let x = Math.round((Graphics.width / 2) + 192)
x -= Math.floor((Graphics.width - Graphics.boxWidth) / 2);
x += index * 32;
let y = (Graphics.height - 200) - ($gameParty.maxBattleMembers() * 48);
y -= Math.floor((Graphics.height - Graphics.boxHeight) / 2);
y += index * 48"
And just added y-=-125 right above the last line of the original code, on its own line, separated by being its own line and ending in semi colon.
i want my sv battlers to be more spaced out so they all can be seen
Seems like they'll be the same distance from each other, but you can determine if they move up or down. If they can be individually separated I'm not good enough for that yet, sorry.
Original thread: https://forums.rpgmakerweb.com/threads/sideview-battler-positioning.182558/