Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================
- # ** Change Parallax Scriptlet
- # Version : 2.6
- # Platforms : RMVX
- # Author : Companion Wulf
- # Release Date : 10 September 2012
- # Last Update : 22 May 2014
- # Websites
- # * RPG Maker Times - http://rpgmakertimes.blogspot.com
- # * RMT Companion Blog - http://blog.rpgmakertimes.info
- # * RPG Maker Times Facebook - http://facebook.com/RPGMakerTimes
- #
- #------------------------------------------------------------------------------
- # This simple scriptlet enables you to change the parallax on the map using a
- # Script Command call. Parallaxes can be called directly or randomized. Looping
- # and scroll speed are predetermined via the Map Properties.
- #
- #------------------------------------------------------------------------------
- # INSTALLATION
- # Place the scriptlet between Materials and Main.
- #
- #------------------------------------------------------------------------------
- # INSTRUCTIONS
- # 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, put # 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)
- #
- # will show the "Mountains" (or whatever is third in the array) parallax from
- # PARALLAX_NAMES.
- #
- #------------------------------------------------------------------------------
- # FUTURE UPDATES
- # * XY scroll coordinates
- # * Terrain specific parallaxes
- #
- #------------------------------------------------------------------------------
- # VERSION HISTORY
- # v2.6 (22-May-2014)
- # * Tweak: Set default parallax if random parallaxes turned off
- # v2.5 (19-Oct-2013)
- # * Tweak: Cleaned/compressed code
- # v2.0 (10-Oct-2013)
- # * Tweak: Condensed parallax names into a single array
- # v1.5 (25-Oct-2012)
- # * Add: Randomized parallaxes
- # v1.0 (19-Oct-2012)
- # * Began scriptlet
- #
- #==============================================================================
- $imported = {} if $imported == nil; $imported["CW-ChgPlx"] = true
- module CW_CHGPLX
- RANDOM_PARALLAX = false # Toggle random parallax on/off
- PARALLAX_NAMES = [
- # Parallax filenames (Graphics/Parallaxes)
- "BlueSky", "CloudySky", "Mountains",
- "Ocean", "StarlitSky", "Sunset"
- ]
- PARALLAX_DEFAULT = 0 # Set default parallax if random parallax is off
- end
- #==============================================================================
- # ** Game_Map
- #==============================================================================
- class Game_Map
- include CW_CHGPLX
- #----------------------------------------------------------------------------
- # * Parallax Presetup - Change Parallax
- #----------------------------------------------------------------------------
- def change_parallax(parallax = -1)
- parallax = PARALLAX_DEFAULT if RANDOM_PARALLAX == false
- parallax = rand(PARALLAX_NAMES.size) if RANDOM_PARALLAX && parallax == -1
- @parallax_name = PARALLAX_NAMES[parallax]
- end
- end
- #==============================================================================
- # COPYRIGHT NOTICE
- #==============================================================================
- # This script is copyrighted to Companion Wulf under the provisions of the
- # Digital Millennium Copyright Act (DMCA).
- #
- # However, permission is granted to use the script in non-commercial projects
- # only, provided that credit (to Companion Wulf) is given somewhere in the game.
- # Beginning or end credits are fine (or even in the game itself!).
- #
- # The script cannot be distributed without my express written permission. It is
- # only allowed for distribution (at present) on the following websites:
- #
- # RPG Maker Times - http://rpgmakertimes.blogspot.com
- # RPG Maker Times Companion - http://blog.rpgmakertimes.info
- #
- # If you would like to share the script on a website or other forum, write to me
- # for permission via RPG Maker Times Companion and the likelihood is I'll grant
- # it and add to the list of approved distribution sites.
- #
- # Not understanding the above conditions, or not understanding English, will not
- # exempt you in any way, shape or form.
- #
- # *For use in commercial projects*, I ask that a nominal fee of $3 for non-
- # exclusive rights be paid. This will then go towards domain costs and
- # additional scripts.
- #
- # Please do NOT use that email address for anything other than asking permission
- # or, of course, letting me know about your project. ~Wulf
- #==============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement