Map Scroll script to coordinate


Hello everyone, is there a way to execute a script to scroll the map to coordinates?

e.g. I want the player to stay visible and shift the screen through map scroll command to center the screen at coordinate 30, 50.

Any ideas for MV?
If the player is to stay visible, then this is not map scrolling but going to that coordinate.

if you want that without delay, use the transfer command but stay on the same map.
if you want to see the map shifting, use a move route command targeted on the player, just turn off stepping and walking first and turn on through, then move to the target and then turn everything back.

If you don't know the current player position you'll have to use control variable to calculate the move in a loop.

can be done completely without scripts
I don't think I've explained what i need: I want the player to stay immobile where it is during an autorun event and the screen should slowly/fast pan to another point of the map, where things are happening. This means no moveroute is implied, because player must stay where it is. At same time, it won't work to replace the player with an event resembling the player graphic, because it's not the player indeed.
in that case you can simply use the scroll map command - I only suggested the move route because you specified that the player stays visible, and he won't remain visible if the screen scrolls too far away.

From what you're describing in the last post you're making a cutscene and that is exactly where you use the scroll map command.
If you have multiple points where that custscene can be triggered (thereby not knowing where to scroll to and unable to make different trigger events) then you use the script equivalent of the event command - there is a pinned topic to a list of such for every maker in that makers support area.
yeah the script command for map scroll would be ideal but I can't find it from the list of scripts. Do you know where I can find it?

so i can just fix the amount of tiles to pan by using variables instead of fixed integer numbers.

Thank you.
Then you must have looked wrong - the link to archaiea's table is pinned in MV, and the script calls are ordered the same way as the event commands, so you'll find it under page 2 movement commands.
interesting, never saw that excel had more pages lol... now everything makes sense. Feel stuoid now.
in case you want a zelda like transition, and the maps stays on the same size,
you can look into this plugin [here] which has a mapScroll when the camera scrolls
and let the play still in view.

it might not work correctly with pixel movement, but there are other mapscroll plugins
that could work, but I didn't try them.
so the script I need is:

$gameMap.startScroll(direction, distance, speed);

that said, if I want the map to move always to coordinates 10, 15, whatever the player position is, what is the easiest way to achieve this? I've tried to set player coordinates to a variable but I find bugs on that logic


in case you want a zelda like transition, and the maps stays on the same size,
you can look into this plugin [here] which has a mapScroll when the camera scrolls
and let the play still in view.

it might not work correctly with pixel movement, but there are other mapscroll plugins
that could work, but I didn't try them.
Thank you, but I just need that script for map scroll!
I've tried to set player coordinates to a variable but I find bugs on that logic
That is exactly what you need to do, and if there are bugs then they are in the way you're doing it, not in the principle.

Please show us the code you're using and we can help in the bughunt - basically you need to calculate the difference between current position and target position and use that difference in one or two scroll commands.
that said, if I want the map to move always to coordinates 10, 15, whatever the player position is, what is the easiest way to achieve this?

$gamePlayer.center(10, 15) will center the game screen on these coordinates
$gamePlayer.center(10, 15) will center the game screen on these coordinates
thank you! the answer I was looking for

Original thread: https://forums.rpgmakerweb.com/threads/map-scroll-script-to-coordinate.155784/