Zelda Style Map Transitions

Jeremy Cannady

Coldfire
Veteran
Joined
Oct 25, 2015
Messages
449
Reaction score
262
First Language
English
It is not really a transfer but more of camera scroll. By default the camera scrolls and cents on the player, This way it will only scroll when you reach edge of screen. If you look at old zelda games you will see this a lot. I made this script because it was requested by another person. Now if you combine this with a map stitching script and Quasi(ABS) or my ABS then you will have all the mechanics to make a zelda type game.
 

Flare Gear

Veteran
Veteran
Joined
Oct 28, 2015
Messages
15
Reaction score
23
First Language
Italian
Thanks for your hard work! :) This plugin will suit my new project perfectly! ;)
 

VHStapes

Game Designer
Veteran
Joined
May 25, 2014
Messages
57
Reaction score
7
First Language
English
Works beautifully! Thank you :)
 

SteveDaCheeze

Villager
Member
Joined
Dec 1, 2015
Messages
22
Reaction score
3
First Language
English
Thanks Jeremy. I was actually looking for something like this. I was in the process of making a plugin, but I'm glad you made one instead. I'll be sure to credit you in my rpg.
 
Last edited by a moderator:

Parallax Panda

Got into VxAce ~2014 and never stopped...
Veteran
Joined
Oct 29, 2015
Messages
770
Reaction score
1,057
First Language
Swedish
Primarily Uses
RMMV
Would this plugin have a possible impact on performance on big maps? Like, depending on how MV works, if it isn't loading much of anything outside of the current screen then this might actually decrece the risk for lag a little on bigger maps? Does anyone know?
 

Tiduril

Villager
Member
Joined
May 4, 2016
Messages
9
Reaction score
2
First Language
German, Dutch
Primarily Uses
Hey! :)


Thank you so much Jeremy for this epic plug in :D


But i have i little question:


In a Link to the past for SNES, the camera switching areas are bigger and differ from map to map; not like the camera switches in Links worlds and dungeons in the GBC Games.


So: is there any possibility, to adjust the default 13*17 camera positions? Like in a notetag for each map where you can define x and y or something? I have no idea about scripting, so i have no clue, if it is easy or not :p


Greetings!
 

Rink27

Veteran
Veteran
Joined
Jul 18, 2014
Messages
222
Reaction score
12
First Language
English
Primarily Uses
RMMV
Can you enable this script to maintain the camera lock even when you "teleport/transfer player" to a spot on the same map? It throws off the grid.
 

Harken_W

Veteran
Veteran
Joined
Oct 13, 2015
Messages
80
Reaction score
22
First Language
English
Primarily Uses
N/A
Awesome plugin! 
 
Last edited by a moderator:

Nik0405

Veteran
Veteran
Joined
Dec 5, 2013
Messages
28
Reaction score
8
First Language
German
Great plugin!


But I found a gamebreaking bug that occurs when you set the map scrolltype to loop.


If you then go right "out of the map" to appear on the other side the camera will not follow the player, but scroll through the whole map and when it reaches the player it just starts going back and forward without ever stopping.
 
Last edited by a moderator:

breesk

I have absolutley no idea what I'm doing here, so
Veteran
Joined
May 28, 2016
Messages
47
Reaction score
6
First Language
a
Primarily Uses
RMMV
How the heck do you download this thing? I tried two different things, but it all ends up getting me a plugin with no information and it always results in a blank screen, or automatic crashes.
 
Last edited by a moderator:

Helstern

Villager
Member
Joined
Dec 27, 2016
Messages
10
Reaction score
1
First Language
English
Primarily Uses
How the heck do you download this thing? I tried two different things, but it all ends up getting me a plugin with no information and it always results in a blank screen, or automatic crashes.


Go here: http://pastebin.com/raw/3LuUR0uf and select File > Save As in your browser.  Make sure the filename is "MapScroll.js".  Then place that file in the plugin section of your project.
 

breesk

I have absolutley no idea what I'm doing here, so
Veteran
Joined
May 28, 2016
Messages
47
Reaction score
6
First Language
a
Primarily Uses
RMMV
Go here: http://pastebin.com/raw/3LuUR0uf and select File > Save As in your browser.  Make sure the filename is "MapScroll.js".  Then place that file in the plugin section of your project.
 WOAAAAAAHHH... Holy... Woah... I figured it out.


Ok, What I did was I ended up using Sublime Text 3 and just Copy-Pasted it into the program and saved it.


What my mistake was is that I didn't... copy this.



//=============================================================================
// MapScroll.js
//=============================================================================
/*:
 *Version 2.0
 *Change log:
 *11/5/2015:Scroll scales with window width/height.
 *   Added plugin commands to disable/enagle scrolling in game.
 *11/5/2015: v2.0 Auto grid snap more commands and notetags.
 *
 *
 * @plugindesc Scrolls the map when you get to the edge.
 * @author Jeremy Cannady
 *
 * @help Scrolls the map when you get to the edge, normal maps are 13 by 17
 *  
 *Plugin commands:
 * Map_Scroll_Disable ----> This will disable and revert to normal scrolling.
 * Map_Scroll_Enable  ----> This will enable scrolling.
 * Grid_Snap_Disable  ---> Disables grid auto snap.
 * Grid_Snap_Enable   ---> Enables grid auto snap (default)
 *
 *Note Tags:
 *<ScrollDisable> if put in the map note tags then scrolling will be back to normal instead of grid scrolling.
 *

*/


Huh... Anyway, Thanks for the help.
 
Last edited by a moderator:

breesk

I have absolutley no idea what I'm doing here, so
Veteran
Joined
May 28, 2016
Messages
47
Reaction score
6
First Language
a
Primarily Uses
RMMV
OK, NEW PROBLEM.


I got the script to work but it keeps going back and forth whenever I get to the edge and I have NO idea why. Here's the thing I got, No idea what's going on.


Come up with a fix if you want. I dunno...


//=============================================================================
// MapScroll.js
//=============================================================================
/*:
 *Version 2.0
 *Change log:
 *11/5/2015:Scroll scales with window width/height.
 *   Added plugin commands to disable/enagle scrolling in game.
 *11/5/2015: v2.0 Auto grid snap more commands and notetags.
 *
 *
 * @plugindesc Scrolls the map when you get to the edge.
 * @author Jeremy Cannady
 *
 * @help Scrolls the map when you get to the edge, normal maps are 13 by 17
 *  
 *Plugin commands:
 * Map_Scroll_Disable ----> This will disable and revert to normal scrolling.
 * Map_Scroll_Enable  ----> This will enable scrolling.
 * Grid_Snap_Disable  ---> Disables grid auto snap.
 * Grid_Snap_Enable   ---> Enables grid auto snap (default)
 *
 *Note Tags:
 *<ScrollDisable> if put in the map note tags then scrolling will be back to normal instead of grid scrolling.
 *
*/


(function(){
//Define a variable to enable/disable the scrolling
Game_Player.prototype._Map_Scroll_Enabled = true;
//Default grid snap
Game_Player.prototype.gridSnap = true;
 
//Superseding the updateScroll function. Don't scroll until we are on the edge.
Game_Player.prototype.updateScroll = function(lastScrolledX, lastScrolledY) {
        //If we have scroll diabled for this map then set scroll to false.
        if($dataMap.meta.ScrollDisable){
                Game_Player.prototype.Map_Scroll_for_this_Map = false;
        }else{
                Game_Player.prototype.Map_Scroll_for_this_Map = true;
        };
       
        var x1 = lastScrolledX;
    var y1 = lastScrolledY;
    var x2 = this.scrolledX();
    var y2 = this.scrolledY();
        var xScroll = Math.round(SceneManager._boxWidth/48);
        var yScroll = Math.round(SceneManager._boxHeight/48);
 
        if(Game_Player.prototype._Map_Scroll_Enabled && Game_Player.prototype.Map_Scroll_for_this_Map){
                //Checks to see if we move beyond the screen if we do then it scrolls it for us.
                if (x2 > xScroll-1) {$gameMap.startScroll(6,xScroll,6);};//Left
                if (x2 < -0.5) {$gameMap.startScroll(4,xScroll,6);};//Right
                if (y2 > yScroll-1) {$gameMap.startScroll(2,yScroll,6);};//Down
                if (y2 < -0.5) {$gameMap.startScroll(8,yScroll,6);};//Up       
        }else{//If we have it disabled then run the original code
                if (y2 > y1 && y2 > this.centerY()) {$gameMap.scrollDown(y2 - y1);};
                if (x2 < x1 && x2 < this.centerX()) {$gameMap.scrollLeft(x1 - x2);};
                if (x2 > x1 && x2 > this.centerX()) {$gameMap.scrollRight(x2 - x1);};
                if (y2 < y1 && y2 < this.centerY()) {$gameMap.scrollUp(y1 - y2);};     
        };
};//End of update scroll.
 
//Superseding the canMove function. Check if we are scrolling the screen.
Game_Player.prototype.canMove = function() {
    if ($gameMap.isEventRunning() || $gameMessage.isBusy()) {return false;}
    if (this.isMoveRouteForcing() || this.areFollowersGathering()) {return false;}
    if (this._vehicleGettingOn || this._vehicleGettingOff) {return false;}
    if (this.isInVehicle() && !this.vehicle().canMove()) {return false;}
        if (Game_Player.prototype._Map_Scroll_Enabled && $gameMap.isScrolling()){return false;};       
        return true;
};//End of canMove.
 
var alias_Game_Map_setDisplayPos = Game_Map.prototype.setDisplayPos;
Game_Map.prototype.setDisplayPos = function(x, y) {
        //If the grid snap is disabled then run the original code;
        if(Game_Player.prototype.gridSnap === false){
                alias_Game_Map_setDisplayPos.call(this,x,y);   
        }else{//If grid snap is enabled then snap the camera to the correct position.
                var xScroll = Math.floor(SceneManager._boxWidth / 48);
                var yScroll = Math.floor(SceneManager._boxHeight / 48);
                var newX = $gamePlayer._newX;
                var newY = $gamePlayer._newY;
                var gridX = Math.floor(newX / xScroll)
                var gridY = Math.floor(newY / yScroll)
                this._displayX = gridX * xScroll;
                this._displayY = gridY * yScroll;
                this._parallaxX = this._displayX;
                this._parallaxY = this._displayY;
        };
};//End of set display position.
 
//Define the pugin command for disable.
var Map_Scroll_Disable_pluginCommand = Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function(command, args) {
        Map_Scroll_Disable_pluginCommand.call(this, command, args);
        if (command === "Map_Scroll_Disable") {
                //If we type in Map_Scroll_Disable then disable scrolling.
                Game_Player.prototype._Map_Scroll_Enabled = false;
        };
};
 
//Define the pugin command for enable.
var Map_Scroll_Enable_pluginCommand = Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function(command, args) {
        Map_Scroll_Enable_pluginCommand.call(this, command, args);
        if (command === "Map_Scroll_Enable") {
                //If we type in Map_Scroll_Enable then enable scrolling.
                Game_Player.prototype._Map_Scroll_Enabled = true;
        };
};
 
var Grid_Snap_Disable_pluginCommand = Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function(command, args) {
        Grid_Snap_Disable_pluginCommand.call(this, command, args);
        if (command === "Grid_Snap_Disable") {
                //If we type in Grid_Snap_Disable then disable grid snap.
                Game_Player.prototype.gridSnap = false;
        };
};
 
var Grid_Snap_Enable_pluginCommand = Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function(command, args) {
        Grid_Snap_Enable_pluginCommand.call(this, command, args);
        if (command === "Grid_Snap_Enable") {
                //If we type in Grid_Snap_Enable then enable grip snap.
                Game_Player.prototype.gridSnap = true;
        };
};
 
})();


 


 
 

dexni

Villager
Member
Joined
Mar 13, 2016
Messages
11
Reaction score
2
First Language
english
Primarily Uses
Note tag or plugin command is not working for me. I have rooms I don't want to scroll, but they will just start at the top rather than were I transfer into even if I set the notetag or put in the commands. Am I not getting something?


Nevermind that it is working the problem is that the camra start at the top left of the map and not were than character is help???
 
Last edited:

Nilaul

Warper
Member
Joined
Sep 14, 2017
Messages
2
Reaction score
0
First Language
English
Primarily Uses
RMMV
I'm not quite sure whats happening either. The camera is stuck in the upper right corner on a 21 x 12 map after I switch maps. I'm trying to make the camera automatically align itself to the dead centre of the map, but I'm not sure what I'm doing with code.
 
Last edited:

Rule665

Villager
Member
Joined
Apr 25, 2013
Messages
15
Reaction score
1
First Language
English
Primarily Uses
Is there a way to have it scroll before reaching the edge?
I'm using a HUD at the bottom of the screen but I don't want to walk into/under the HUD.
 

jyor0385

Warper
Member
Joined
Oct 23, 2017
Messages
1
Reaction score
0
First Language
English
Primarily Uses
RMMV
Great plugin! Thanks!
 
Joined
Oct 10, 2017
Messages
36
Reaction score
7
First Language
English
Primarily Uses
RMMV
I'm not quite sure whats happening either. The camera is stuck in the upper right corner on a 21 x 12 map after I switch maps. I'm trying to make the camera automatically align itself to the dead centre of the map, but I'm not sure what I'm doing with code.
Having this same kind of issue. Oddly enough once I get my character centered on the screen it scrolls just fine and the problem won't happen again if I exit the map and come back.
 

N-Amata

Villager
Member
Joined
Nov 10, 2017
Messages
26
Reaction score
9
First Language
Filipino
Primarily Uses
RMMV
So, I found a bug, of sorts? So when I go up, the camera goes up as intended, but then it goes back down again, resulting in an eternal loop of back and forth.
 

cedr777

Lead developer of "Charao Life"
Veteran
Joined
Feb 22, 2018
Messages
238
Reaction score
52
First Language
Not English
Primarily Uses
RMMV
Don't mind me. just necroposting.
or is it allowed in this type of thread?
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

So a guy enters in a bar and walks up to the counter. He looks the bartender with a mysterious look and asks him...
I've wondered for a while now... what is it about the YED SV plugin that just doesn't do transformations... I feel it's how it looks up the battlers honestly.
To actually work on my game, or browse these forums about creating my game? Hmmm....
Tanning beds are actually vampire traps. Coffin shaped but the minute they're inside... BAM UV Rays. Dead Vampire.
https://forums.rpgmakerweb.com/index.php?threads/restrictions-limited-move-sets.117489/ A new blog discussion thread draws near! Command?

What do you think of Limited Move Sets?

Forum statistics

Threads
93,490
Messages
912,914
Members
123,026
Latest member
eveelynn
Top