Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 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: yy7iKKb.png]

ITCH: jayray.itch.io
Currently working on Goblin Gulch (MV)
Currently working on JayVinci Resurrection
Currently working on Bakin ABS (BAKIN)
Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   Text Scroll Script - Enhanced DerVVulfman 23 29,459 02-18-2021, 04:16 AM
Last Post: DerVVulfman
   ACBS FIX SCRIPT #2: Advanced Cry Correction DerVVulfman 1 3,859 08-09-2019, 03:42 PM
Last Post: aeliath
   Advanced Movement 1.2 Helladen 1 5,035 01-25-2014, 02:25 AM
Last Post: Helladen
   Advanced Shop Status Window RPG Advocate 4 11,070 08-21-2011, 05:12 AM
Last Post: DerVVulfman
   Advanced Individual Battle Commands Trickster 6 14,294 01-29-2011, 04:30 AM
Last Post: DerVVulfman
   MultiSlots! Store Patch - Advanced Shop DerVVulfman 0 5,482 10-24-2010, 03:39 AM
Last Post: DerVVulfman
   MAWS - Modified Advanced Weather Script Agckuu_Coceg 27 35,621 05-27-2010, 04:43 PM
Last Post: sakhawat21
   MAWS VX - Modified Advanced Weather Script (an Edit) Ramiro 6 12,455 03-11-2010, 09:01 AM
Last Post: Agckuu_Coceg
   Advanced Files Dargor 1 6,618 02-05-2010, 10:35 PM
Last Post: Villain
   Moghunter's Advanced Movement System Helel 1 7,463 12-08-2009, 11:52 PM
Last Post: explocion200



Users browsing this thread: