Advertisement
diamondandplatinum3

Map does not scroll with Player ~ RGSS3

Dec 10th, 2012
773
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 3.16 KB | None | 0 0
  1. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  2. #             Map does not scroll with Player
  3. #             Author: DiamondandPlatinum3
  4. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  5. #  Description:
  6. #
  7. #    This script stops the map from scrolling with the player. Its only use
  8. #    is to mimic old Zelda style games where the map would scroll when you
  9. #    would change rooms, otherwise staying still.
  10. #
  11. #    Using the Map's NoteTag box, insert the following comment:
  12. #           ~<DO_NOT_SCROLL>
  13. #
  14. #    The Map will still scroll if this notetage does not exist in the Map's
  15. #    NoteBox.
  16. #
  17. #    To scroll a map in this case, you will have to use the Scroll Map event.
  18. #
  19. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  20.  
  21.  
  22.  
  23.  
  24. #==============================================================================
  25. # ** Game_Player
  26. #------------------------------------------------------------------------------
  27. #  This class handles the player. It includes event starting determinants and
  28. # map scrolling functions. The instance of this class is referenced by
  29. # $game_player.
  30. #==============================================================================
  31.  
  32. class Game_Player < Game_Character
  33.   #--------------------------------------------------------------------------
  34.   # * Aliased Method: Scroll Processing
  35.   #--------------------------------------------------------------------------
  36.   alias dp3_mdnswp_gameplayer_updatescroll_038r0   update_scroll
  37.   def update_scroll(*args)
  38.     dp3_mdnswp_gameplayer_updatescroll_038r0(*args) if $game_map.scroll_map
  39.   end
  40. end
  41.  
  42.  
  43.  
  44. #==============================================================================
  45. # ** Game_Map
  46. #------------------------------------------------------------------------------
  47. #  This class handles maps. It includes scrolling and passage determination
  48. # functions. The instance of this class is referenced by $game_map.
  49. #==============================================================================
  50.  
  51. class Game_Map
  52.   #--------------------------------------------------------------------------
  53.   # * New Public Instance Variables
  54.   #--------------------------------------------------------------------------
  55.   attr_reader :scroll_map             # Scroll Map Boolean
  56.   #--------------------------------------------------------------------------
  57.   # * Aliased Method: Object Initialization
  58.   #--------------------------------------------------------------------------
  59.   alias dp3_mdnswp_gamemap_initialize_84fh0j   initialize
  60.   def initialize(*args)
  61.     # Call Original Method
  62.     dp3_mdnswp_gamemap_initialize_84fh0j(*args)
  63.    
  64.     @scroll_map = true
  65.   end
  66.   #--------------------------------------------------------------------------
  67.   # * Aliased Method: Setup
  68.   #--------------------------------------------------------------------------
  69.   alias dp3_mdnswp_gamemap_setup_84fh0j    setup
  70.   def setup( *args )
  71.     # Call Original Method
  72.     dp3_mdnswp_gamemap_setup_84fh0j( *args )
  73.    
  74.     # Set Scroll Map
  75.     @scroll_map = @map.note.upcase.include?( "~<DO_NOT_SCROLL>" ) ? false : true
  76.   end
  77. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement