Map Loop Question (Solved)

Hello, I had a question about the looping of maps. So I know you can loop say the world map to where you get to the edge and then it loops back around, so my question is this: is it possible to make it loop on conditions, in my case I only want it to do loop while using an airship. I'm not too sure if it's possible and if it is I've not figured out how. If I need a script to do it that's fine, I just am unsure if and how to do it. ^^;
Well, I was going to say should be as easy as setting $dataMap.scrollType = 1 or 2 or 3 (Vertical, Horizontal, Both) with the script command.
But testing this in MZ I found it's a bit quirky. Ok, maybe very quirky. And MV might be slightly different somehow.

It's probably better to have the map loop by default, and set the scroll type to 0 - for no loop.
Going from Scrolling to Not-scrolling, there might be a moment where the map sorta snaps into alignment if you were too close to the edge. And depending on the size of the map, some event graphics might be cleared as they reach the edges of the screen, like the game doesn't wait till they've scrolled completely off the screen. That's got to be a bug with MZ, I'll report it...maybe.

Otherwise, going from not-scrolling to scrolling, the tile map layer and the tile collision won't be drawn. The Event graphics will loop around but the map tiles wont until a certain distance and it re-centers itself.

Also, opening and closing the menu will reset the Scroll type to it's default.

Honestly, I think you're better off just creating an event that prevents the player from moved pass a certain X or Y coordinate. Like if $gamePlayer.y == 0, bound them back a tile with a message like "That's far enough"
Well, I was going to say should be as easy as setting $dataMap.scrollType = 1 or 2 or 3 (Vertical, Horizontal, Both) with the script command.
But testing this in MZ I found it's a bit quirky. Ok, maybe very quirky. And MV might be slightly different somehow.

It's probably better to have the map loop by default, and set the scroll type to 0 - for no loop.
Going from Scrolling to Not-scrolling, there might be a moment where the map sorta snaps into alignment if you were too close to the edge. And depending on the size of the map, some event graphics might be cleared as they reach the edges of the screen, like the game doesn't wait till they've scrolled completely off the screen. That's got to be a bug with MZ, I'll report it...maybe.

Otherwise, going from not-scrolling to scrolling, the tile map layer and the tile collision won't be drawn. The Event graphics will loop around but the map tiles wont until a certain distance and it re-centers itself.

Also, opening and closing the menu will reset the Scroll type to it's default.

Honestly, I think you're better off just creating an event that prevents the player from moved pass a certain X or Y coordinate. Like if $gamePlayer.y == 0, bound them back a tile with a message like "That's far enough"

Mmm yeah this is for sure weird, I'm using MV since I don't have MZ. I tried it in there and the same thing seems to happen where it'll stop drawing, it works but when I get to the edge where it would scroll it draws nothing but a black void for a number of tiles and then draws things correctly. Was MZ doing that same thing then or was it doing something else when it was trying to scroll just 1 vehicle?
I suppose the question would be: what would you want to happen if the player lands the airship at a scroll point the player wouldn't ordinarily have been able to get to on foot?
I suppose the question would be: what would you want to happen if the player lands the airship at a scroll point the player wouldn't ordinarily have been able to get to on foot?
Well with how I designed the map you can't land where the scroll points are as there's only ocean and no land. I just want it where if the player uses the ship they don't get scrolling but do with the airship. It's only somewhat working since like coyote mentioned when he tested it in MZ it stops drawing for a bit. I did it in MV and it also does that and I'll get a black void for a number of tiles before it draws the map again. Unless there's something missing this seems to possibly be an engine limitation?
Ack not trying to double post I figured out how to avoid the void issue.

Make sure the map's default scrolling is set to loop in whatever direction/directions you want! If you have the map default to not scroll you'll get the voids when you make a vehicle that does scroll when the map's default is to not scroll! In theory this should work in MZ too but as I don't have it I'm not sure if it will. xD You just make a parallel event with the script call Coyote mentions in a conditional branch for vehicles you wish to use this for.

Original thread: https://forums.rpgmakerweb.com/threads/map-loop-question-solved.149766/