Map Scroll Advanced
#1
Map Scroll Advanced

by Jay Ray

This scriptlet will quickly jump to specified coordinates from where the player is, in any direction, without having to scroll a map up, down, left, and right. It may have been done in a different form before, but I thought I'd share this one.

Code:
#----------------------------------------------------------------
#
# JayRay Map Scroll Advanced
#
# This tiny scriptlet allows you to set up a script call in event
# commands to go to a specific distance from a point, even at angles.
# Great for World Maps, Comic Book cutscenes, and more.
#
# To call, simply enter a script in event, replacing xdistpan and ydistpan
# with either positive numbers or negative numbers - this is for pixels
#  $game_map.scroll_dispan(xdistpan, ydistpan)
#
# If you'd rather scroll quickly to a location that's a certain number of
# tiles away, instead you'd call ...
# $game_map.scroll_distilepan(xdistpan, ydistpan)
#
# Use smaller distances for a scrolling illusion, and good luck!
#
#

class Game_Map
  #--------------------------------------------------------------------------
  # * Scroll to specific distances on map
  #     xdistpan = How much - or + horizontally (x) you will need to scroll
  #      ydistpan = How much - or + vertically (y) you will need to scroll
  #--------------------------------------------------------------------------
  def scroll_dispan(xdistpan,ydistpan)
    @display_y = [@display_y + xdistpan, (self.height - 15) * 128].min
    @display_x = [@display_x + ydistpan, 0].max
  end
  def scroll_distilepan(xdistpan,ydistpan)
    @display_y = [@display_y + (xdistpan * 32), (self.height - 15) * 128].min
    @display_x = [@display_x + (ydistpan * 32), 0].max
  end
end

Demo


License: Use it freely for any project, no credit necessary, but always appreciated.


If you're wanting to scroll long distances, like for instance 240x, -360y, you can always break it up into pieces, seperated by a wait 4 frames.
This should allow you to say go 24x, -36y over and over again until reaching your destination, and then to jump back, you can just reverse everything with a -240x, 360y to come back to the player. Pretty cool idea eh?
[Image: AVvXsEga1vIr5Rx3FkoFbGo1OoMJAqgq6TeqcbpF...L3AWg=s752]

BLOG: JayVinci.blogspot.com
FORUM COMING SOON
Currently working on:
Ambitions: RPG Developer Bakin
Heart of Vox: RPG Developer Bakin
Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   Text Scroll Script - Enhanced DerVVulfman 23 34,290 02-18-2021, 04:16 AM
Last Post: DerVVulfman
   ACBS FIX SCRIPT #2: Advanced Cry Correction DerVVulfman 1 4,771 08-09-2019, 03:42 PM
Last Post: aeliath
   Advanced Shop Status Window RPG Advocate 4 12,483 08-21-2011, 05:12 AM
Last Post: DerVVulfman
   Advanced Individual Battle Commands Trickster 6 15,917 01-29-2011, 04:30 AM
Last Post: DerVVulfman
   MultiSlots! Store Patch - Advanced Shop DerVVulfman 0 6,110 10-24-2010, 03:39 AM
Last Post: DerVVulfman
   MAWS - Modified Advanced Weather Script Agckuu_Coceg 26 40,640 05-27-2010, 04:43 PM
Last Post: sakhawat21
   Moghunter's Advanced Movement System Helel 1 8,285 12-08-2009, 11:52 PM
Last Post: explocion200
   AMS - Advanced Message Script - R4 (LegacyX Edit) Legacy 2 9,184 09-18-2009, 09:43 AM
Last Post: Legacy
   Dubealex's Advanced Message System R4 Dubealex 0 8,273 12-07-2008, 04:19 PM
Last Post: Dubealex
   Advanced Equip Window RPG Advocate 0 5,221 03-02-2008, 08:13 AM
Last Post: RPG Advocate



Users browsing this thread: 1 Guest(s)