MZ Visustella Battle Core SV Actor Positions

For those looking to setup sideview actor position with Visustella Battle Core.
Basic overview: Here

Custom Dynamic Example:
Spoiler: Example
1280 x 720
Up to 4 Battle Members

Single Battle Member:
1669964128241.png

2 Battle Members:
1669964221908.png

3 Battle Members:
1669964267894.png

4 Battle Members:
1669964310719.png


Spoiler: Battle Core Code Setup
VisuMZ_1_BattleCore > Actor Battler Settings > JS: Home Position >
Replace code with:
Code:
// Declare Constants
const sprite = this;
const actor = this._actor;
const index = arguments[0];
const members = $gameParty.battleMembers().length;
let x;
let y;

// Make Calculations
if (members == 1) {
    x = 832;
    y = 408;
}
if (members == 2) {
    x = 832;
    y = 360;
    y += index * 72;
}
if (members == 3) {
    x = 832;
    y = 360;
    y += index * 72;
    if (index == 2) {
        x = 880;
        y = 312;
    }
}
if (members == 4) {
    x = 832;
    y = 360;
    y += index * 72;
    if (index == 2) {
        x = 880;
        y = 312;
    }
    if (index == 3) {
        x = 880;
        y = 480;
    }
}

// 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);

Of course, this is just an example, you can modify the values to suit your needs.
Just what I was looking for. Dynamically changing the battle positions according to party size is a great feature.

Thanks!
I tried adding this code in, but it didn't seem to do anything. I don't have any experience using Python though, so I probably did something wrong. I took a screenshot of how the code currently looks on my end, so someone might be able to explain what I'm doing wrong.
Spoiler: Code Screenshot
Screenshot (11).png
Screenshot (12).png
@smearglexd - I believe that code is supposed to go in the plugin parameter:
  1. Open the Plugin Manager;
  2. Select VisuStella Battle Core;
  3. Double-click the Actor Battler Settings parameter;
  4. Double-click the JS: Home Position parameter;
  5. Copy+paste the code in the text box there.
Also, I suggest you undo any edits you've made to the plugin code, e.g. by re-downloading the plugin. 👋
@smearglexd - I believe that code is supposed to go in the plugin parameter:
  1. Open the Plugin Manager;
  2. Select VisuStella Battle Core;
  3. Double-click the Actor Battler Settings parameter;
  4. Double-click the JS: Home Position parameter;
  5. Copy+paste the code in the text box there.
Also, I suggest you undo any edits you've made to the plugin code, e.g. by re-downloading the plugin. 👋
Ah, that did the trick. Thank you very much for your help.
I don't have any experience using Python though,
You mean Javascript, I hope. If you're using Python with this, I don't know what will occur.
Hello. I'm facing a problem where I can't set specific coordinates for the second character. It relies solely on the first character. How can I make it so that the second character can have its own coordinates that are independent of the first character?I copied your code and changed the values.But i couldnt figure out the first and second characters.Pls help!!!!
I copied your code and changed the values
Please share the code you are using.

It's easier to troubleshoot if we see what you did

Original thread: https://forums.rpgmakerweb.com/threads/visustella-battle-core-sv-actor-positions.153054/