Questions about MV's Zoom feature:

jjbones123

Veteran
Veteran
Joined
Aug 2, 2016
Messages
54
Reaction score
31
First Language
English
Primarily Uses
N/A
Hello! I have some questions about the script that can be used to zoom in the camera in RPG maker MV:

My first question is: can you make the zoomed in camera follow the player?
Here is the script I am currently using:

var xPos = $gamePlayer.screenX();

var YPos = $gamePlayer.screenY();



$gameScreen.setZoom(xPos, YPos, 2)

I've given this script to an event and set it to auto run so that the camera is zoomed in immediately when the player starts the game. I can get this script to zoom in on the player's starting position...But it doesn't follow the player around and instead the player just walks off screen. How can I make it so that the newly zoomed in camera will follow the player around?

My next question is: can you keep the camera zoomed in when the player is transferred to another room/map? And if so how??
I have found a work around to this; I can just set an event to auto run the same script each time the player enters a new room. But I was wondering if there was another way to do it so that the camera automatically stays the same?

Finally, I am having an issue where if the player presses X to bring up the menu and again to close it, the camera zooms out and defaults to normal size. The same happens after the player has a battle against a random encounter. I want the camera to remain zoomed in at all times. Is there a work around for this?
 

DragonVine

May or May Not be Batman
Veteran
Joined
Jun 17, 2014
Messages
344
Reaction score
385
First Language
English
Primarily Uses
I could be wrong, but I think you need a plugin to do that.
 

jjbones123

Veteran
Veteran
Joined
Aug 2, 2016
Messages
54
Reaction score
31
First Language
English
Primarily Uses
N/A
What do I need a plugin to do?

Sorry, not trying to be rude, but are you referring to all 3 questions or just one? You can zoom in without a plugin using the script I mentioned, but are you saying I would need a plugin to do the more advanced stuff i'm asking about?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
Please take one step back and explain to us what you want to achieve instead of how.
Completely ignore the word "zoom" and explain to us without that what you want to change for the player.

Then we can tell you how to achieve this, because at the moment your partial description confuses more than it helps.
 
Last edited:

DragonVine

May or May Not be Batman
Veteran
Joined
Jun 17, 2014
Messages
344
Reaction score
385
First Language
English
Primarily Uses
To answer your question, I think you need a plugin to do all three of the advanced things you are looking for. There are camera control plugins out there. However, Andar is correct. If you take a step back and explain exactly what you want to do, people will be able to help more.
 

jjbones123

Veteran
Veteran
Joined
Aug 2, 2016
Messages
54
Reaction score
31
First Language
English
Primarily Uses
N/A
I refer to it as zoom because that is what the script I am using refers to it as Though I did have to have it explained to me by a Youtube video and i'm not entirely sure whether it's a custom script or a common command I wasn't aware of until now because most of what I know about RPG maker is self taught. I'm sorry for any confusion and i'll try to take a step back and explain what I mean better.

Above is the script I learnt from the Youtube video (if its a custom script, then I will go look back for the user's name so I can credit them. But it was a awhile ago) this script essentially zooms the displayed picture in and in this instance, the zoomed in "camera" (that's what I call it) will focus on the player character.
MV Double Normal sized.png
Here is a test room I made as an example. Above is without using the "setZoom" script and is the default size of a game made in RPG Maker MV. And below is the same room/game but using the "setZoom" script. The script doubles the size of the displayed picture and makes the players spawning point (where the player enters the room from) the focus of the picture:
MV Double sized.png
As you can see, there is a considerable difference between the two. From what I understand, there is no limit to the zoom script; you can zoom in and out as much as you want. (For example: (XPos, YPos, 5) would enlarge the image by 5 times. You can use decimals such as 1.5, but the picture becomes distorted as it's trying to half single pixels.
 

jjbones123

Veteran
Veteran
Joined
Aug 2, 2016
Messages
54
Reaction score
31
First Language
English
Primarily Uses
N/A
(Having to make multiple posts because I maxed out the amount of files I could upload with the last one)

My first question was about the camera. The setZoom script zooms onto the players SPAWNING point, not the actual player character. This is a problem because the player can actually walk off screen. I think the best example of what i'm talking about would be the Gameboy advance Pokemon games:
Pok_mon_FireRed_Part_2 (2).gif
Sorry for the quality of the GIF, but it was the best example I could find. Notice that the player is always in the center of the picture/camera; you can only see what's around the player. This is what I want the setZoom script in my game to do. But at the moment, the player isn't the focus of the zoomed in camera instead can walk off camera because the script doesn't follow the player character.

@DragonVine You say I will probably need a plugin to do all the things i've asked about. Do you know the plugin I would need please?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
Sowhat you want is to basically have larger visible elements?
on what game screen size (that is different from your monitor screen size) and why don't you simply go fullscreen with the game?
 

jjbones123

Veteran
Veteran
Joined
Aug 2, 2016
Messages
54
Reaction score
31
First Language
English
Primarily Uses
N/A
Going full screen isn't the same as using the SetZoom script. But it's ok because I have found a solution.

I did some experimenting and discovered that if I gave the script to an event and then set it to parallel process not only does the camera follow the player now, but the zoomed in effect doesn't go away when the menu is opened or after a battle. Solving two of my problems.

Just to clarify, i'll explain what I did step by step:

1). I gave the below script to an event and set its trigger to Parallel.
var xPos = $gamePlayer.screenX();

var YPos = $gamePlayer.screenY();



$gameScreen.setZoom(xPos, YPos, 2)

2). I personally like to hide the event somewhere where the player can't interact with said event. For me that would be the top left corner and I set the event to: transparent on, through on and to have no overworld sprite.

3). There! Problem solved!! :)

But I found that I didn't like the camera moving around with the player when the player is in a room which is small enough to displayed all at once. So I made another work around. Similar to the previous work around, but I changed the script slightly to:

var xPos = $gameMap.event(1).screenX();

var YPos = $gameMap.event(1).screenY();



$gameScreen.setZoom(xPos, YPos, 2)

This makes the camera focus on the event instead of the player. I keep the event stationary and also set it to parallel, so it's pretty much the same as the other work around. And as I don't want the player to interact with this event, I set the event to: through on and above the player's layer with no overworld sprite.

As for the question of how to keep the camera zoomed in when the player is transferred to a different room/map. I couldn't find another way to do it other than to have the previously mentioned events in every map/room.

While I figured it out, I would like to thank both of you for the help (and for putting up with my ramblings) I hope this can help others who want to upscale/zoom in their games.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,050
Members
137,571
Latest member
grr
Top