adiktuzmiko

BattleBack EX v1.0

May 22nd, 2013
533
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.61 KB | None | 0 0
  1. #==============================================================================
  2. #
  3. # BattleBack_EX v1.0
  4. # by AdiktuzMiko
  5. # --- Date Created: 03/01/2013
  6. # --- Last Date Updated: 03/01/2013
  7. # --- Level: Easy
  8. # Requires: n/a
  9. #
  10. # Basically, this allows you to have different battlebacks in one map
  11. # via regions.
  12. #
  13. #==============================================================================
  14.  
  15. #==============================================================================
  16. # Aliased methods:
  17. #
  18. # battleback1_bitmap, battleback2_bitmap (both belongs to Spriteset_Battle)
  19. #==============================================================================
  20.  
  21. #==============================================================================
  22. # How To Install:
  23. #
  24. # Just put this anywhere before main and you're good to go.
  25. #==============================================================================
  26.  
  27. #==============================================================================
  28. # Compatibility:
  29. #
  30. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  31. # it will run with RPG Maker VX without adjusting.
  32. #
  33. # As for compatibility with other scripts, it's compatible with YEA scripts.
  34. # I don't know for other scripts though. Though I don't think it would be
  35. # incompatible with other scripts unless they overwrite the battleback creation
  36. # at the start too.
  37. #
  38. #==============================================================================
  39.  
  40. #==============================================================================
  41. # How To Use:
  42. #
  43. # Go to the module below and just insert lines for the maps that you need
  44. # different battlebacks per region. Look at the example to know how to add
  45. # new lines.
  46. #
  47. # Format:
  48. #
  49. # Map ID => {Region ID => [Battleback1,Battleback2],
  50. # Region ID => [Battleback1,Battleback2], And so on}
  51. #
  52. # If a map or region is not included in the module, it will use the battleback
  53. # specified on the map data
  54. #==============================================================================
  55.  
  56. module BattleBack_EX
  57.  
  58. BATTLEBACKEX = {
  59.  
  60. 15 => {1 => ["Dirt1","Forest1"]},
  61. 16 => {1 => ["Dirt1","Forest1"]},
  62. 28 => {1 => ["Cobblestones1",""]},
  63. } #Do not remove
  64.  
  65. end #BattleBack_EX
  66.  
  67. #==============================================================================
  68. # Do not touch anything below this line unless you know what you are doing.
  69. #==============================================================================
  70.  
  71. class Spriteset_Battle
  72.  
  73. alias battleback1_bitmap_x battleback1_bitmap
  74. def battleback1_bitmap
  75. if $BTEST #without this it bugs during battle test
  76. battleback1_bitmap_x
  77. else
  78. BattleBack_EX::BATTLEBACKEX[$game_map.map_id] != nil ? bb = BattleBack_EX::BATTLEBACKEX[$game_map.map_id][$game_map.region_id($game_player.x,$game_player.y)] : nil
  79. if bb != nil
  80. Cache.battleback1(bb[0])
  81. elsif battleback1_name
  82. Cache.battleback1(battleback1_name)
  83. else
  84. create_blurry_background_bitmap
  85. end
  86. end
  87. end
  88.  
  89. alias battleback2_bitmap_x battleback2_bitmap
  90. def battleback2_bitmap
  91. if $BTEST #without this it bugs during battle test
  92. battleback2_bitmap_x
  93. else
  94. BattleBack_EX::BATTLEBACKEX[$game_map.map_id] != nil ? bb = BattleBack_EX::BATTLEBACKEX[$game_map.map_id][$game_map.region_id($game_player.x,$game_player.y)] : nil
  95. if bb != nil
  96. Cache.battleback2(bb[1])
  97. elsif battleback2_name
  98. Cache.battleback2(battleback2_name)
  99. else
  100. create_blurry_background_bitmap
  101. end
  102. end
  103. end
  104.  
  105. end #Spriteset_Battle
Advertisement
Add Comment
Please, Sign In to add comment