you don't need any script call at all.
1) control variable to set the value of a variable to the player y position
2) control variable to set the value of a different variable to the player y position
3) control variable to change the two coordinates depending on where you want the event relative to the player position
4) set event location command with the variables above as target.
everything done by event commands without a single letter of scripts
The problem is that there is no player position. Well, there is but the camera is not following the invisible "player" who stands somewhere on the map without further use. It is following events.
Can you help me out with this type of setup? 😀
Edit, some more explanation:
I want to build an event based battle system. When the battle starts I need to reposition the character events. I want to use a script call for this because I need to use arrays for the event selection "event(enemy)".
It doesn't matter, the commands and the principles are the same - you can get any event's position in the same way as the player position.
you need to use control variables (or the script equivalent of that command, check the equivalent topic for that) to get a position on the screen before you can use the set position command.
And all events use map coordinates, NOT pixel coordinates, unless you changed the entire structure by using a pixel movement plugin.
there are ways to calculate between pixel coordinates and map coordinates, but the pixel coordintes on the screen will not work with the setposition for events because events use map coordinates.
IIRC
You can actually calculate the grid coordinate of the screen coordinate via some calculations.. But you'd need to take into account the map size and screen size to convert it correctly.
There's a part of the default code that handles screen x and y, you can try to look for it and see what can be done.