Scrolling Camera script

Status
Not open for further replies.

Linaru

Warper
Member
Joined
Apr 27, 2015
Messages
3
Reaction score
0
Primarily Uses
Hello all,

I am Trying to recreate a Scrolling camera Effect similar to legend of zelda. where the camera centres on a room in a map and when the player walks off the edge of the screen it scrolls off to the next room.
 
I have been using Lemony's script which seems to be the only script I can find that is similar:
 

#==============================================================================# ** Lemony's Zelda Camera (LZC), (March 2013), v.1.0#==============================================================================# This scripts allows to move the camera when the player reaches the screen# borders.#==============================================================================# (*) How to Use.-#==============================================================================# * You can actiave and deactivate the system at will by setting ON or OFF# the switch with the ID dessigned at LZC_SWITCH variable below.# The system will be ON when the switch is OFF, and OFF when the switch is ON.#------------------------------------------------------------------------------# * You can define the scroll speed for the camera movement by editing# LZC_SSPEED variable below. Default speed is 6.#==============================================================================# (**) Terms of Use.-#==============================================================================# This script is free to use in any commercial or non commercial game or# project created with any RPG Maker with a valid license as long as explicit# credits are given to the author (Lemony).#==============================================================================class Game_Player < Game_Character #-------------------------------------------------------------------------- # * Switch ID. [OPT] #-------------------------------------------------------------------------- LZC_SWITCH = 10 #-------------------------------------------------------------------------- # * Scroll Speed. [OPT] #-------------------------------------------------------------------------- LZC_SSPEED = 6 #-------------------------------------------------------------------------- # * Scroll Processing. [MOD] #-------------------------------------------------------------------------- alias lzc_update_scroll update_scroll def update_scroll(*args) if !$game_switches[LZC_SWITCH] stx, sty = $game_map.screen_tile_x, $game_map.screen_tile_y border_x = screen_x % (stx * 32) == 0 border_y = screen_y % (sty * 32) == 0 $game_map.start_scroll(6, stx, LZC_SSPEED) if border_x && @direction == 6 $game_map.start_scroll(4, stx, LZC_SSPEED) if border_x && @direction == 4 $game_map.start_scroll(2, sty, LZC_SSPEED) if border_y && @direction == 2 $game_map.start_scroll(8, sty, LZC_SSPEED) if border_y && @direction == 8 else lzc_update_scroll(args) end endend
[/MOD]
[MOD]
However this script has a few problems that I can not seem to find a work around for.

Firstly rather than the camera being centred on the room it seems to be centred on the player when he enters a map. This means when I use a transfer player event the camera will be slightly off set from the room. 

The second issue is with the scroll loop map effect. when the player tries to walk off the edge (and come back from the opposite side of the map) the camera starts to scroll but then never stops.

My window displays 20x15 tiles, so i have been using maps that are multiples of this and building all my rooms within that size border.

I would really appreciate it if someone could help me out  by making a script that is better aligned to rooms.

Linaru Greyfall[/mod]
 
Last edited by a moderator:

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
Lemony (now source) has made a new camera script which you can find here.  I haven't compared the 2 scripts but from your description it sounds like the new one includes functions from the old but, presumably, in a better way.  You might find your problem is solved with this verions.
 

Linaru

Warper
Member
Joined
Apr 27, 2015
Messages
3
Reaction score
0
Primarily Uses
Lemony (now source) has made a new camera script which you can find here.  I haven't compared the 2 scripts but from your description it sounds like the new one includes functions from the old but, presumably, in a better way.  You might find your problem is solved with this verions.
thanks very much... it took some tweaking and i will have to add tons of events to the map but so far this script seems to be creating the required effect.  I haven't yet tested it on my looping maps yet but i will play around with it and see.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,355
Reaction score
7,668
First Language
German
Primarily Uses
RMMV
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
 
Status
Not open for further replies.

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,977
Members
137,563
Latest member
cexojow
Top