Advertisement
Rafael_Sol_Maker

RAFAEL_SOL_MAKER's RGSS2 TO RGSS3 FIXES v0.2

Jul 21st, 2012
398
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 4.19 KB | None | 0 0
  1. #===============================================================================
  2. #        RAFAEL_SOL_MAKER's RGSS2 TO RGSS3 FIXES(Work-in-Progress) v0.2
  3. #_______________________________________________________________________________
  4. #   Description  | Some fixes if you plan to put your Ace game to run on RGSS3.
  5. #                | It was proven it's not hard at all, and there are some
  6. #                | advantages, like a faster and better Ruby, improved Audio
  7. #                | classes, creation of bitmaps with more than 2048x2048 pixels,
  8. #                | using a exclusive (and coding flexible) layer to autoshadows,
  9. #                | and some other cool features.
  10. #________________|______________________________________________________________
  11. #     Usage      | Plug it above any custom scripts, below default engine ones.
  12. #________________|______________________________________________________________
  13. # Specifications | Difficulty to Use:
  14. #                |  * (almost none at all)
  15. #                | Scripting Difficulty:
  16. #                |  * * ½ (I particularly don't recommend to edit it)
  17. #                | Compatibility:
  18. #                |  ??? (it's already made to create compatibility!)
  19. #                | New Methods:
  20. #                |  - Tilemap.passages
  21. #                | Overwritten Methods:
  22. #                |  - (none)
  23. #                | Aliased Methods:
  24. #                |  - Game_Map.setup
  25. #                |  - Window_Base.initialize
  26. #                |  - Spriteset_Map.create_tilemap
  27. #________________|______________________________________________________________
  28. #  Known Issues  | This is a W.I.P. version, so, it's expected to be incomplete.
  29. #                | Probably with more tests some problems and bugs can appear...
  30. #________________|______________________________________________________________
  31. # Special Thanks | Migetman12
  32. #________________|______________________________________________________________
  33. #===============================================================================
  34.  
  35.  
  36. #===============================================================================
  37. #   Tilemap Fix  | Well, it's surprising that only it's needed to fix Tilemap!
  38. #________________|______________________________________________________________
  39. #===============================================================================
  40. class Tilemap
  41.   def passages=(value)
  42.     @passages = value
  43.   end  
  44. end
  45.  
  46. #===============================================================================
  47. # Autoshadow Fix | Here let's use the RGSS3 fourth Tilemap layer to do it
  48. #________________|______________________________________________________________
  49. #===============================================================================
  50. class Game_Map
  51.   alias __setup setup
  52.   def setup(map_id)    
  53.     __setup(map_id)
  54.     __data = data    
  55.     __data.resize(__data.xsize,  __data.xsize, 4)
  56.     for x in 0...(__data.xsize - 1)
  57.       for y in 0...(__data.ysize - 1)  
  58.         if __data[x, y, 0] >= 4352 && __data[x, y + 1 ,0] >= 4352 &&
  59.         __data[x + 1, y + 1, 0] < 4352
  60.           # If you dont want to use autoshadows, change the 5 below to 0
  61.           __data[x + 1, y + 1, 3] = 5
  62.         end        
  63.       end
  64.     end
  65.   end  
  66. end
  67.  
  68. #===============================================================================
  69. # Window Padding | Only changing its default from 12 to 16
  70. #________________|______________________________________________________________
  71. #===============================================================================
  72. class Window_Base < Window
  73.   alias __initialize initialize
  74.   def initialize(x, y, width, height)
  75.     __initialize(x, y, width, height)
  76.     self.padding = 16
  77.   end
  78. end
  79.  
  80. #===============================================================================
  81. #  Tile Priority | To show some tiles above the hero correctly
  82. #________________|______________________________________________________________
  83. #===============================================================================
  84. class Spriteset_Map  
  85.   alias __create_tilemap create_tilemap
  86.   def create_tilemap
  87.     __create_tilemap
  88.     @tilemap.flags = $game_map.passages # $data_system.passages
  89.   end
  90. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement