Change Parallax Scriptlet – RMVX

Change Parallax Scriptlet (RMVX)

This small, simple scriptlet allows you to change the parallax image with a single script call in the Event Commands.

Parallaxes are pre-defined and can be manually called or randomized.

 
Change Parallax ScriptletPersonal NotesMain FunctionsScript RequirementsInstall InstructionsDownloadFuture Updates
Version: 2.6
Author: Companion Wulf
Platform: RMVX
Script Type: Scriptlet
Required: None
Fileseze: 5 Kb
File Format: TXT
Release Date: 10 September 2012
Last Update: 22 May 2014
One of many features disabled in RMVX is the ability to change the Parallaxes, which was available in RMXP (and RM2K/3 before that) directly from the Event Commands.

Parallaxes are graphics (usually of clouds or distant landscapes) that can scroll behind a map. While it is possible to set the parallax graphic in the map settings only, this "one parallax per map" rule is rather annoying.

So, as I start learning RGSS and familiarize myself with its nuances, being able to find workarounds and tweaks is half the fun.

This is a simple but effective (and certainly not perfect) method for changing parallaxes during gameplay with a small script.

This simple scriptlet enables you to change the parallax on the map using a single Script Command call.

Parallaxes can be randomized (default setting) or called directly by specifying the corresponding number.

This scriptlet has no additional requirements, but looping and scroll speed must be predetermined via the Map Properties.

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.

Place (import) all parallax graphics in the Graphics/Parallaxes folder.

If the randomized parallax (RANDOM_PARALLAX) is "true", the parallaxes will be chosen randomly from the list (PARALLAX_NAMES). If RANDOM_PARALLAX is "false", the default parallax (PARALLAX_DEFAULT) will be used instead, corresponding to its position in the array.

To call the script, place the following in a script command event:

   $game_map.change_parallax

To change the parallax to a specific one in the list, place the corresponding number (starting with 0) in brackets after the event command:

   $game_map.change_parallax(2)

This will show the "Mountains" parallax from PARALLAX_NAMES (in the default expample, the third in the array).

Copy and paste the scriptlet between Materials and Main.
Some time in the future, the following features may be made to the script:

  • XY scroll coordinates
  • Terrain specific parallaxes

Leave a Reply