Lune Smooth Camera Slide

Raizen

Veteran
Veteran
Joined
Oct 24, 2012
Messages
381
Reaction score
660
First Language
Portuguese
Primarily Uses
RMMV
Lune Smooth Camera Slide

Introduction

This script will add a much smoother camera slide, making more professional the game, and the move.

Portuguese user? Link Here

Videos





How to Use

Put it above main and configure the script as necessary

Script

#=======================================================#         Lune Smooth Camera Sliding# Author: Raizen# Comunity: www.centrorpg.com# The scripts allow a much smoother movement, making the move much more realistic.#=======================================================module Lune_cam_slide# Constant of the slide, the greater the faster, the lower the slower..(default = 0.001)Slide = 0.001 # To set the camera focus on an event instead of a player# Script Call: set_camera_focus(id)# where id is the id of the event, to put back the focus on the player,# id = 0 end   #==============================================================================# ** Game_Player#------------------------------------------------------------------------------#  Esta classe gerencia o jogador. # A instância desta classe é referenciada por $game_player.#============================================================================== class Game_Player < Game_Characteralias :lune_camera_slide_initialize :initialize  #--------------------------------------------------------------------------  # * Inicialização do objeto  #--------------------------------------------------------------------------  def initialize(*args)    @camera_slide_focus = 0    lune_camera_slide_initialize(*args)  end  #--------------------------------------------------------------------------  # * Atualização da rolagem  #     last_real_x : ultima coordenada X real  #     last_real_y : ultima coordenada Y real  #--------------------------------------------------------------------------  def update_scroll(last_real_x, last_real_y)    return if $game_map.scrolling?    if @camera_slide_focus == 0      screen_focus_x = screen_x      screen_focus_y = screen_y    else      screen_focus_x = $game_map.events[@camera_slide_focus].screen_x      screen_focus_y = $game_map.events[@camera_slide_focus].screen_y    end    sc_x = (screen_focus_x - Graphics.width/2).abs    sc_y = (screen_focus_y - 16 - Graphics.height/2).abs    $game_map.scroll_down(Lune_cam_slide::Slide*sc_y) if screen_focus_y - 16 > Graphics.height/2    $game_map.scroll_left(Lune_cam_slide::Slide*sc_x) if screen_focus_x < Graphics.width/2    $game_map.scroll_right(Lune_cam_slide::Slide*sc_x) if screen_focus_x > Graphics.width/2    $game_map.scroll_up(Lune_cam_slide::Slide*sc_y) if screen_focus_y - 16 < Graphics.height/2  end  def set_camera_focus(event = 0)    @camera_slide_focus = event  endend  #==============================================================================# ** Spriteset_Map#------------------------------------------------------------------------------#  Esta classe reune os sprites da tela de mapa e tilesets. Esta classe é# usada internamente pela classe Scene_Map. #============================================================================== class Spriteset_Map    #--------------------------------------------------------------------------  # * Atualização do tilemap  #--------------------------------------------------------------------------  def update_tilemap    @tilemap.map_data = $game_map.data    @tilemap.ox = ($game_map.display_x * 32)    @tilemap.oy = ($game_map.display_y * 32)    @tilemap.ox += 1 if $game_map.adjust_tile_slide_x    @tilemap.oy += 1 if $game_map.adjust_tile_slide_y    @tilemap.update  endend#==============================================================================# ** Game_Map#------------------------------------------------------------------------------#  Esta classe gerencia o mapa. Inclui funções de rolagem e definição de # passagens. A instância desta classe é referenciada por $game_map.#============================================================================== class Game_Map  #--------------------------------------------------------------------------  # * Variáveis públicas  #--------------------------------------------------------------------------  def adjust_tile_slide_x    @display_x != 0 && @display_x != (@map.width - screen_tile_x) && !scrolling?  end  def adjust_tile_slide_y    @display_y != 0 && @display_y != (@map.height - screen_tile_y) && !scrolling?  endend#==============================================================================# ** Game_Interpreter#------------------------------------------------------------------------------#  Um interpretador para executar os comandos de evento. Esta classe é usada# internamente pelas classes Game_Map, Game_Troop e Game_Event.#============================================================================== class Game_Interpreter  def set_camera_focus(event = 0)    $game_player.set_camera_focus(event)  endend 





FAQ

Why my character is not showing on the screen?

Don't use values way lower then 0.001, or way higher, the lower the cam moves slower, so to catch up is really hard.

Credit and Thanks

- Raizen
 
Last edited by a moderator:

Ocedic

Dog
Veteran
Joined
Jul 13, 2012
Messages
396
Reaction score
67
Primarily Uses
Intriguing script. Just FYI you forgot to change the header in your topic from Anti-Lag to Smooth Camera Slide.

EDIT: I tried it out and it works great for moving around, but camera panning seems to be bugged (when you use move camera over x spaces.)
 
Last edited by a moderator:

Raizen

Veteran
Veteran
Joined
Oct 24, 2012
Messages
381
Reaction score
660
First Language
Portuguese
Primarily Uses
RMMV
Intriguing script. Just FYI you forgot to change the header in your topic from Anti-Lag to Smooth Camera Slide.


EDIT: I tried it out and it works great for moving around, but camera panning seems to be bugged (when you use move camera over x spaces.)
Oops u_u, I partially corrected that now, I'll try to think something better to do about the events camera latter, thanks for both notices :D
 

Rik Vargard

Villager
Member
Joined
Mar 9, 2013
Messages
86
Reaction score
3
First Language
French
Primarily Uses
Awesome! Thank you for that!

:)  Rik
 

BILL_NYE_THO

The Science Guy
Veteran
Joined
Feb 17, 2013
Messages
361
Reaction score
21
First Language
English
Primarily Uses
I looked at the script and it wasn't immediately clear to me if this is possible, so I figured I would ask: Can you adjust the speed that the "camera" follows the player?
 

Raizen

Veteran
Veteran
Joined
Oct 24, 2012
Messages
381
Reaction score
660
First Language
Portuguese
Primarily Uses
RMMV
I looked at the script and it wasn't immediately clear to me if this is possible, so I figured I would ask: Can you adjust the speed that the "camera" follows the player?
# Constant of the slide, the greater the faster, the lower the slower..(default = 0.001) Slide = 0.001 end
On the script xD, so, 0.002 would make the cam move 2x faster then in the vídeo, 0.0005 would make the cam move 2x slower, its a decimal number so basically you can try a lot of numbers until you find one that satisfies you :)
 

Maky-chan

Stoner Rock fan, Doom Metal listener.
Member
Joined
Aug 14, 2012
Messages
19
Reaction score
0
First Language
Spanish
Primarily Uses
When you use Show Animation in a map, the animation goes down a little, like It's moving.

Anyways, nice script. Somehow better tha Wora's ^_^
 

Raizen

Veteran
Veteran
Joined
Oct 24, 2012
Messages
381
Reaction score
660
First Language
Portuguese
Primarily Uses
RMMV
When you use Show Animation in a map, the animation goes down a little, like It's moving.

Anyways, nice script. Somehow better tha Wora's ^_^
Probably because of the "animation bug", which really isn't a bug xD, but if you use a script that makes the animation fixed on the map, I haven't test it, but I'm almost sure it will correct that problem, and also would make the animations way better, since its much more logical that the animations follow the map and not the screen, as you can see here.

Woratana has that fix I think, but I didn't find it here, but if you look well, you surely will find ^^

http://forums.rpgmakerweb.com/index.php?/topic/2863-ace-animation-moving-with-player-how-do-i-prevent-that/
 
Last edited by a moderator:

Maky-chan

Stoner Rock fan, Doom Metal listener.
Member
Joined
Aug 14, 2012
Messages
19
Reaction score
0
First Language
Spanish
Primarily Uses
No, I mean, It moves alone, like a single event, doesn't matter if you move or not. The animation goes down on its own. :<
 

Nosleinad

Storyteller
Veteran
Joined
Dec 12, 2012
Messages
351
Reaction score
29
First Language
Portuguese
Primarily Uses
I am getting the same small issue here, but in my case one of my animations (feet centered) is going a bit to the left. I also used some looped and screen animations, and they worked fine in the same map. 

Raizen, please let me know if a video would help.
 

Raizen

Veteran
Veteran
Joined
Oct 24, 2012
Messages
381
Reaction score
660
First Language
Portuguese
Primarily Uses
RMMV
That is all strange as I just changed 1 simple thing, I'm going to redo the script from 0, sorry for all the trouble to everyone =X, when I redo the script I post it here.
 

seita

Donn_M
Veteran
Joined
Feb 6, 2013
Messages
2,254
Reaction score
611
First Language
English
Primarily Uses
Thanks for your hard work Raizen!
 

Rik Vargard

Villager
Member
Joined
Mar 9, 2013
Messages
86
Reaction score
3
First Language
French
Primarily Uses
Cheers to you for taking your time for this, really!

:) Rik
 

seita

Donn_M
Veteran
Joined
Feb 6, 2013
Messages
2,254
Reaction score
611
First Language
English
Primarily Uses
Was wondering if there has been any progress on the rewrite?
 

Raizen

Veteran
Veteran
Joined
Oct 24, 2012
Messages
381
Reaction score
660
First Language
Portuguese
Primarily Uses
RMMV
Oh I'm really sorry .-., I actually had forgotten this script x_x, and no PC at the moment, I'll rewrite it as soon as I can, sorry for the time :X
 

seita

Donn_M
Veteran
Joined
Feb 6, 2013
Messages
2,254
Reaction score
611
First Language
English
Primarily Uses
Hey Raizen, hope you're still around! I'd love to see this script completed~
 

ken713

Warper
Member
Joined
May 10, 2013
Messages
1
Reaction score
0
First Language
English
Primarily Uses
This script is awesome! However you think you could make it possible to enable/disable this when entering a airship?
 

RadiantCadenza

Veteran
Veteran
Joined
Nov 6, 2012
Messages
99
Reaction score
62
First Language
English
Primarily Uses
Sorry if this is a bit of a necro, but for future reference, I was wondering if it's okay to use this script in a commercial project?

I can't seem to find a terms of use that says anything one way or another about commercial use. 

I think this script makes things look a fair bit more professional than the default scrolling, so I'd like to be able to include it in pretty much all of my projects if I can, but if it's non-commercial than I'll just only stick it in the free ones. 
 

Raizen

Veteran
Veteran
Joined
Oct 24, 2012
Messages
381
Reaction score
660
First Language
Portuguese
Primarily Uses
RMMV
yeah, you can, it has a small bug though if you use events for mapping, if not it probably should work ok >_>

I need time and will to correct everything xD, but yeah you can.
 

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