Advertisement
Rafael_Sol_Maker

RGSS2 TO RGSS3 FIXES

Jul 9th, 2012
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 3.76 KB | None | 0 0
  1. #===============================================================================
  2. #          RAFAEL_SOL_MAKER's RGSS2 TO RGSS3 FIXES(Work-in-Progress)
  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 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. #________________|______________________________________________________________
  27. #  Known Issues  | Some of the things yet not implemented in this version:
  28. #                |  * Tilemap priority bug:
  29. #                |      - Every tileset of the map stays below the characters;
  30. #                |  * More to come, it wasn't tested recursively.
  31. #________________|______________________________________________________________
  32. # Special Thanks | Migetman12
  33. #________________|______________________________________________________________
  34. #===============================================================================
  35.  
  36.  
  37. #===============================================================================
  38. #   Tilemap Fix  | Well, it's surprising that only it's needed to fix Tilemap!
  39. #________________|______________________________________________________________
  40. #===============================================================================
  41. class Tilemap
  42.   def passages=(value)
  43.     @passages = value
  44.   end  
  45. end
  46.  
  47. #===============================================================================
  48. # Autoshadow Fix | Here we will use the RGSS3 fourth Tilemap layer to do the job
  49. #________________|______________________________________________________________
  50. #===============================================================================
  51. class Game_Map
  52.   alias __setup setup
  53.   def setup(map_id)    
  54.     __setup(map_id)
  55.     __data = data    
  56.     __data.resize(__data.xsize,  __data.xsize, 4)
  57.     for x in 0...(__data.xsize - 1)
  58.       for y in 0...(__data.ysize - 1)  
  59.         if __data[x, y, 0] >= 4352 && __data[x, y + 1 ,0] >= 4352 &&
  60.         __data[x + 1, y + 1, 0] < 4352
  61.           # If you dont want to use autoshadows, change the 5 below to 0
  62.           __data[x + 1, y + 1, 3] = 5
  63.         end        
  64.       end
  65.     end
  66.   end  
  67. end
  68.  
  69. #===============================================================================
  70. # Window Padding | Only changing its default from 12 to 16
  71. #________________|______________________________________________________________
  72. #===============================================================================
  73. class Window_Base < Window
  74.   alias __initialize initialize
  75.   def initialize(x, y, width, height)
  76.     __initialize(x, y, width, height)
  77.     self.padding = 16
  78.   end
  79. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement