As I start learning RGSS, the scripting language used by RMXP and RMVX, and familiarize myself with its nuances, being able to find workarounds and tweaks is half the fun.
A simple but effective (and certainly not perfect) method for changing parallaxes is with a small script.
- Look in the Game_Map section of the scripts for Scroll Setup and Parallax Background Setup.
- Place the following between these two sections:
#---------------------------------------------- # * Parallax Presetup - Change Parallax #---------------------------------------------- def change_parallax(parallax_name) case parallax_name when 1 @parallax_name = "BlueSky" when 2 @parallax_name = "CloudySky" when 3 @parallax_name = "Mountains" when 4 @parallax_name = "Ocean" when 5 @parallax_name = "StarlitSky" when 6 @parallax_name = "Sunset" end end
Add any other imported Parallax graphics by adding more "when" commands accordingly. Note: New parallax graphics must be first imported into RMVX under Graphics/Parallaxes. - To use an event to change the parallax graphic, use the Script function and place the following:
$game_map.change_parallax(x)
where x is the number corresponding to the desired parallax.
Note: With this method, if the Loop Coordinates aren't set directly on the map (via the Map Properties), the parallax will remain static. By changing the Horizontal Loop and/or Vertical Loop settings here it will make the parallax graphic scroll in the background.