[XP] Camera Controls Script

Samno911

GMD
Member
Joined
Nov 14, 2018
Messages
7
Reaction score
2
First Language
English
Primarily Uses
RM2k3
I've been having some issues with the camera centering on the player on larger maps. So long as I am near the top left corner everything works great, but if I try and move the player to somewhere else on the map (especially when choosing a starting position) the camera kind of moves, but always stops to the top left of my player, so you start the game off screen and have to walk into the camera in order for it to sense the player. It acts like there is a wall stopping the camera from moving, but even when starting in the dead center of a 100 x 100 map it still stops to the top left of the player. If there's a script that would let me set the camera starting position, or center it onto an event that would be great. Currently I have an intro sequence to my game and just tell the camera to scroll to roughly the players position, but this still means I can't transfer the player anywhere reliably and puts wait times in every time I start a map.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
Scripts is where people who have written a script they want to share with the community can post them.
[move]RGSS Scrupt Requests[/move]
 

DerVVulfman

Resident Werewolf
Veteran
Joined
Jun 26, 2012
Messages
315
Reaction score
155
First Language
English
Primarily Uses
RMXP
Unless you have some other scripts that alter the camera position, ie the Invariables and the 'center' method in Game_Player, this kinda sounds more like an 'event-system' problem.

You're making a cutscene, right? You have an event to perform as the lead hero for your cutscene while replacing the graphics of your lead with a (NONE) graphic and moving him around as your camera.... but found that the event is still solid? Temorarily set your Camera dude to THROUGH with the Move Route system so it can walk through all the events and obstacles like trees n stuff. Then you should properly center.

If this isn't the case, more info is needed.
 

Samno911

GMD
Member
Joined
Nov 14, 2018
Messages
7
Reaction score
2
First Language
English
Primarily Uses
RM2k3
Apologies for the setting this in the wrong thread, I just recently god RPGXP and this is my first thread
*****
I am not trying to make a cut scene, but the way I "solved" my problem temporarily was to have a cut scene fill the screen while I used the camera move tools to pan the camera to the right spot. It happens any time I transfer the player, even between maps. I have the player starting at the end of a corridor of trees so you walk left, but the camera never starts on the right. However if I leave the area and return to it (entering from the left side) the camera is centered on the player.
It seems the camera will only start in the leftmost corner of each map, or just a little bit left of the player but never dead on. I can work around this issue, but I know as my maps get bigger and have multiple points of entering and exiting, the code will quickly become unruly. Is there a way I can edit the camera centering code so that it moves itself to the right a bit every time I move the player? I think this would technically solve the issue. (oh, I'm doing the stupid thing of all original art,
 

Samno911

GMD
Member
Joined
Nov 14, 2018
Messages
7
Reaction score
2
First Language
English
Primarily Uses
RM2k3
Apologies for the setting this in the wrong thread, I just recently god RPGXP and this is my first thread
*****
I am not trying to make a cut scene, but the way I "solved" my problem temporarily was to have a cut scene fill the screen while I used the camera move tools to pan the camera to the right spot. It happens any time I transfer the player, even between maps. I have the player starting at the end of a corridor of trees so you walk left, but the camera never starts on the right. However if I leave the area and return to it (entering from the left side) the camera is centered on the player.
It seems the camera will only start in the leftmost corner of each map, or just a little bit left of the player but never dead on. I can work around this issue, but I know as my maps get bigger and have multiple points of entering and exiting, the code will quickly become unruly. Is there a way I can edit the camera centering code so that it moves itself to the right a bit every time I move the player? I think this would technically solve the issue. (oh, I'm doing the stupid thing of all original art,
I used the snipping tool to get a picture, it doesn't give much info on its own, but I transferred the player to an empty map that's 60 wide by 15 tall, the first photo shows a blank part of the map, but after holding down the left arrow key for a few seconds the player pops out on the right side of the screen
camera error pt 1.PNG
camera error pt 2.PNG
 

DerVVulfman

Resident Werewolf
Veteran
Joined
Jun 26, 2012
Messages
315
Reaction score
155
First Language
English
Primarily Uses
RMXP
Camera centering can only go but so far depending upon the dimensions of the map as well as the placement of the player character. If he pops out of the right side of the screen, the camera will certainly not be centered over the player. The Player must be at least seven tiles away from the top and/or bottom map edges and 10 tiles away from the left or right edges. If he is too close to the edge, the camera doesn't have enough space to maneuver.

From the second image you present, your hero is only three tiles away from the right edge of the screen. With that, the camera won't be centered until he moves another 7+ tiles to the left. And again, that would assume that there is enough leeway on the left side and so forth. This is an automated system.

Now there is a map event command called 'Scroll Map' which lets you change camera position by adjusting it X tiles in the 4 cardinal directions, and with the standard speed settings (1-6).

The only other thing I can think of is you want large looping maps with no discernable map edge, something where the left edge of a map blends into the right edge of same said map in an endless loop... with a camera system that is compliant.
 

Samno911

GMD
Member
Joined
Nov 14, 2018
Messages
7
Reaction score
2
First Language
English
Primarily Uses
RM2k3
Thank you for the speedy response, I have been using the camera scroll command to center manually, but I’ve has the camera centering issue on larger maps with lots of space for the camera to move. The player is seen only 3 blocks from the edge because I moved him after the transfer had completed. The transfer event did put him very close to the edge of the screen, but in many tutorials I have seen lots of people put the transfer coordinates very close to the edge of the map. I’ll have to play around with making the map boundaries larger in hopes of giving the camera more room to maneuver, worst case is that each time the player is transferred to a new area I’ll just make the camera pan look more cinematic. Once I experiment more I’ll get back to the thread, I’m guessing other people have had similar camera issues, especially on oddly thin or tall maps
 

DerVVulfman

Resident Werewolf
Veteran
Joined
Jun 26, 2012
Messages
315
Reaction score
155
First Language
English
Primarily Uses
RMXP
You could make the maps larger with larger margins of at least 10 tiles from any edge. When your hero goes into said map, it would be so far from the actual map edge, you shouldn't have centering issues ;)

On the same note, you could make ONE map that houses several different stores or such just as long as you have plenty of map space between the two so you can't see one store from another. ONE map that does the work of two, three or ... twenty! Yeah, who has twenty stores in a single town?
 

Samno911

GMD
Member
Joined
Nov 14, 2018
Messages
7
Reaction score
2
First Language
English
Primarily Uses
RM2k3
Thank you for your responses, but I found out something unfortunate. I booted up a fresh blank project to test a hunch, and I found that ONLY in my game does this error occur. Which is very concerning because it means somewhere the code is off, confusing because I haven't messed with any of it, and the only script I added has been a messaging script. More obnoxious than anything, but if I can't find where in the code I have this issue, I'll have to migrate my current project to a blank project, testing as I go to find where the code possibly corrupted. If there are any sure fire areas I can check to make sure they match source code, that would be much appreciated
*****
AHA! thank god for comments, I found a spot I had forgotten I had messed with when I was just beginning to play with the program. I could have sworn I made a new project, but I guess not. I will reference back with source numbers to make sure everything matches, but this might be the solution
 

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

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,981
Members
137,563
Latest member
cexojow
Top