RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Animated Parallax

0 Members and 1 Guest are viewing this topic.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
Animated Parallax
Version: 2.1
Author: modern algebra
Date: September 9, 2011

Version History


  • <Version 2.1> 2011.09.09 - Fixed an oversight where parallax bitmaps were disposed all the time and added an option to preload all the parallax panels, as well as an option to individually set for how long each panel is shown before switching to the next
  • <Version 2.0> 2011.09.06 - Rewrote the script so that it wasn't as embarrassingly terrible. Also no longer incompatible with Woratana's "File Missing Error" Preventer
  • <Version 1.0> 2008.09.27 - Original Release

Description


This script allows you to set an animated parallax background by having multiple frames and switching between them at a user-defined speed. By default this script only supports .png, .jpg, and .bmp file formats for the animated parallax panels (as they are the only ones I know RMVX supports).

Features

  • Allows you to animate your parallax background
  • Unlimited number of frames
  • Set the speed of animation for each individual map

Instructions

See inside the header of the script.

Script


If you are having trouble copying from SMF codeboxes, either switch to a different browser or else you can retrieve the script from Pastebin.

Code: [Select]
#==============================================================================
#    Animated Parallax
#    Version 2.1
#    Author: modern algebra (rmrk.net)
#    Date: September 9, 2011
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Description:
#
#    This script allows you to set an animated parallax background by having
#   multiple frames and switching between them at a user-defined speed. By
#   default, this script only supports .png, .jpg, and .bmp file formats for
#   the animated parallax panels (as they are the only ones I know RMVX
#   supports).
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Instructions:
#   
#    The script operates by having multiple parallax backgrounds and switching
#   between them at a speed set by you, unique for each map
#
#    Thus, if you want to use an animated parallax, you need to do a few things:
#      (a) Make or find the parallax backgrounds you want to use and import
#        them into your game. Then, label them all the same with the one
#        distinction that at the end of each should have a _1, _2, etc...
#          Example Naming:
#            BlueSky_1, BlueSky_2, BlueSky_3, etc...
#      (b) Set the parallax background to any given map that you want the
#        animated parallaxes for. Be sure to set it to the first one you want
#        in succession, so BlueSky_1, not BlueSky_2 or _3. If you do set it to
#        BlueSky_2, then it will only animate between images _2 and _3.
#      (c) Scroll down to the EDITABLE REGION at line 48 and follow the
#        instructions for setting the animation speed
#==============================================================================

$imported = {} unless $imported
$imported["MAAnimatedParallax"] = true
$imported["MAAnimatedParallax2.1"] = true

#==============================================================================
# ** Game_Map
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    aliased methods - update_parallax; setup_parallax
#    new method - maap_check_extensions; setup_parallax_frames
#==============================================================================

class Game_Map
  MAAP_PARALLAX_ANIMATION_FRAMES = { # <- Don't touch
  #\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
  #    EDITABLE REGION
  #|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  #  MAAP_PARALLAX_ANIMATION_FRAMES - this constant allows you to set the
  # speed at which the parallax switches to the next graphic in the animation
  # series by individual maps. So if you want it to be every 20 frames in one
  # map but every 35 in another map, this is where you do it. All you need to
  # do is type in the following code:
  #
  #      map_id => frames,
  # where map_id is the ID of the Map you want to set it for and frames is
  # either (a) an integer for how many frames you want to show each panel
  # before switching to the next; or (b) an array of integers where each entry
  # of the array is the number of frames to keep the corresponding frame up
  # before switching to the next. This allows you to vary the time each of the
  # frames is left on before switching. There are 60 frames in a second.
  #
  #    EXAMPLES:
  #      1 => 35,    Map 1 will cycle through parallax panels every 35 frames
  #      2 => 40,    Map 2 will cycle through parallax panels every 40 frames
  #      8 => [20, 5, 15],    Map 8 will keep the first panel of the animated
  #                  parralax on for 20 frames before switching to the second
  #                  panel which will be on for 5 frames before switching to
  #                  the third panel which is on 15 frames before switching
  #                  back to the first panel.
  #
  #  Note that the comma is necessary! For any maps where you use animated
  # parallaxes but do not include the map ID in this hash, then it will default
  # to the value at line 83.
    2 => 40,
    8 => 20,
  } # <- Don't touch
  #  Changing the below value allows you to change the default speed of frame
  # animation. Ie. the speed of frame animation in a map in which you have not
  # directly set the speed via the above hash configuration.
  MAAP_PARALLAX_ANIMATION_FRAMES.default = 30
  #  Depending on the size of the parallaxes and how many panels you use in a
  # map, there can be some lag when you load new panels. The following option
  # allows you to decide whether all the parallax frames are loaded at once
  # when the map is first entered or individually the first time each panel
  # shows up. Generally, if your panels are very large (1MB+) then you should
  # set it to true; if smaller files, then you should set it to false.
  MAAP_PRELOAD_PARALLAXES = true
  #|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  #    END EDITABLE REGION
  #///////////////////////////////////////////////////////////////////////////
  MAAP_SUPPORTED_EXTENSIONS = ["png", "jpg", "bmp"]
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Setup Parallax
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias ma_ap_stuppara_5tc1 setup_parallax
  def setup_parallax (*args, &block)
    ma_ap_stuppara_5tc1 (*args, &block) # Run Original Method
    setup_parallax_frames
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Update Parallax
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias mlg_ap_updparal_4fg2 update_parallax
  def update_parallax (*args, &block)
    mlg_ap_updparal_4fg2 (*args, &block) # Run Original Method
    # Use the timer if the parallax has more than one frame
    if @maap_parallax_frames && @maap_parallax_frames.size > 1
      @maap_parallax_frame_timer += 1
      if @maap_parallax_frame_timer % @maap_parallax_frame_limit == 0
        @maap_parallax_index = (@maap_parallax_index + 1) % @maap_parallax_frames.size
        @parallax_name = @maap_parallax_frames[@maap_parallax_index]
        if MAAP_PARALLAX_ANIMATION_FRAMES[@map_id].is_a? (Array) && MAAP_PARALLAX_ANIMATION_FRAMES[@map_id].size > @maap_parallax_index
          @maap_parallax_frame_limit = MAAP_PARALLAX_ANIMATION_FRAMES[@map_id][@maap_parallax_index]
        end
      end
    end
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Setup Parallax Frames
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def setup_parallax_frames
    # Dispose the cached bitmaps from the previous map
    last_map_bmps = @maap_parallax_frames.nil? ? [] : @maap_parallax_frames
    @maap_parallax_index = 0
    @maap_parallax_frames = [@parallax_name]
    @maap_parallax_frame_timer = 0
    if MAAP_PARALLAX_ANIMATION_FRAMES[@map_id].is_a? (Array) && MAAP_PARALLAX_ANIMATION_FRAMES[@map_id].size > 0
      @maap_parallax_frame_limit = MAAP_PARALLAX_ANIMATION_FRAMES[@map_id][0]
    else
      @maap_parallax_frame_limit = MAAP_PARALLAX_ANIMATION_FRAMES[@map_id]
    end
    if @parallax_name[/_(\d+)$/] != nil
      frame_id = $1.to_i + 1
      base_name = @parallax_name.sub (/_\d+$/) { "" }
      while maap_check_extensions ("Graphics/Parallaxes/#{base_name}_#{frame_id}")
        @maap_parallax_frames.push ("#{base_name}_#{frame_id}")
        frame_id += 1
      end
    end
    (last_map_bmps - @maap_parallax_frames).each { |bmp| (Cache.parallax (bmp)).dispose }
    # Preload all the parallax bitmaps so no lag is experienced on first load
    if MAAP_PRELOAD_PARALLAXES
      (@maap_parallax_frames - last_map_bmps).each { |bmp| Cache.parallax (bmp) }
      Graphics.frame_reset
    end
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Check Extensions
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def maap_check_extensions (filepath)
    MAAP_SUPPORTED_EXTENSIONS.each { |ext|
      return true if FileTest.exist? ("#{filepath}.#{ext}") }
    return false
  end
end

#==============================================================================
# ** Spriteset Map
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    aliased method - update_parallax
#==============================================================================

class Spriteset_Map
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Update Parallax
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias malg_animparlx_upd_4rg1 update_parallax
  def update_parallax (*args, &block)
    # Don't ever dispose the cached parallax pictures.
    @parallax.bitmap = nil if @parallax_name != $game_map.parallax_name 
    malg_animparlx_upd_4rg1 (*args, &block) # Run Original Method
  end
end

Credit


  • modern algebra

Support


Please post in this topic at rmrk.net for the swiftest support.

Known Compatibility Issues

This script will likely have problems with other scripts which allow a user to change the parallax of a particular map in-game. If you find such a script then post in this topic and I will create a patch for it quite easily.
« Last Edit: September 10, 2011, 12:12:45 AM by modern algebra »

**
Rep: +0/-0Level 84
 :)
when I opened the menu and went back to the map, an error appeared at line 126

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
Thanks for the headsup. it's fixed now.

**
Rep: +0/-0Level 84
OK! thanks!

********
Shadow Knight
Rep:
Level 91
Ruin that brick wall!
Project of the Month winner for October 2008
Whoa, this script would have a powerful graphical capability in-game. ;8

I've been looking for something quite like it for some time.
Thanks modern!
Be kind, everyone you meet is fighting a hard battle.

********
Shadow Knight
Rep:
Level 91
Ruin that brick wall!
Project of the Month winner for October 2008
Okay, here's a question : Would it be possible to have two "layers" of parallaxes active at the same time?
I'm trying to duplicate a starfield/space effect like in Star Control.
Be kind, everyone you meet is fighting a hard battle.

**
Rep: +0/-0Level 83
Y <3 ?
Silver - GIAW 11 (Normal)
Thank you very much, MA. I'm trying out Parallax mapping for the first time, so this will more then likely come in handy. :)
"If you see it, it is not truly there. If you dream it, it will never appear when you waken. If you love it, it will never leave you. Love him... Though he is not real and though you may never see him when you awaken tomorrow." ~ Sorceress of Gaida, Quote from: Eriscadia - The Fall of Nations
http://rpgmaker.net/games/1352/

**
Rep:
Level 67
Eternal Newbie
Just wanted to post to let you know that because of the way this script works, when used with Wora's "'FILE MISSING ERROR' PREVENTER" it produces an infinite "Missing File: Graphics/Parallax/Name_n" error, where "n" is infinity.

A simple fix I imagine would be having a way to specify the number of frames so that it will only go up to that file name instead of checking the number at the end of the file name and going up infinitely. I'm far too inexperienced to be able to script this myself though.

for reference, here is Wora's script
Code: [Select]
#===============================================================
# ? [XP/VX] ? 'FILE MISSING ERROR' PREVENTER ? ?
# * Game won't quit because file missing error anymore~ *
#--------------------------------------------------------------
# ? by Woratana [woratana@hotmail.com]
# ? Thaiware RPG Maker Community
# ? Released on: 05/10/2008
# ? Version: 1.0
#--------------------------------------------------------------
# * Put this script over everything in your game!
# (Default scripts in Script Editor are not an exception!)
#------------------------------------------------------------------

module Wora_FMEP
  #========================================================
  # * [START] 'FILE MISSING ERROR' PREVENTER SETUP PART *
  #--------------------------------------------------------
  Print_Missing_File = true
  # Print Missing File when error occured
 
  Record_Missing_File = true
  # Record missing file to missing file log?
  Missing_Log_File_Name = 'missing_log.txt'
  # Name of file to store missing file names list
 
  Use_Audio_Replacement = false
  # Use replacement audio file for missing audio?
  Audio_Replacement_File = 'Audio/SE/015-Jump01'
  # Audio file that will play for missing audio
 
  Use_Bitmap_Replacement = false
  # Use replacement image file for missing image?
  Bitmap_Replacement_File = 'Graphics/Fogs/001-Fog01'
  # Image file that will use for missing image
  #--------------------------------------------------------
  # * [END] 'FILE MISSING ERROR' PREVENTER SETUP PART *
  #========================================================
 
  def self.print(type, name)
    if Print_Missing_File
      p 'Missed File: ' + name.to_s
    end
    if Record_Missing_File
      file = File.open(Missing_Log_File_Name, "a+")
      type = type == 0 ? 'Bitmap' : 'Audio'
      text = '*' + type.to_s + '* :' + name.to_s + "\n"
      file.write(text) unless file.readlines.include?(text)
      file.close
    end
  end
end

class << Audio
  AUDME = [:bgm_play, :bgs_play, :me_play, :se_play]
  AUDME.each do |method|
    new_method = 'wora_fmep_aud_' + method.to_s
    alias_method(new_method, method) unless $@
new_def = <<_ALIAS_
def #{method}(*args)
  begin
    #{new_method}(*args)
  rescue
    Wora_FMEP.print(1, args[0])
    #{new_method}(Wora_FMEP::Audio_Replacement_File, args[1], args[2]) if
  Wora_FMEP::Use_Audio_Replacement
  end
end
_ALIAS_
eval(new_def)
  end
end

class Bitmap
  unless $@
    alias wora_fmep_bmp_ini initialize
    def initialize(*args)
      begin
        wora_fmep_bmp_ini(*args)
      rescue
        Wora_FMEP.print(0, args[0])
        if Wora_FMEP::Use_Bitmap_Replacement
          wora_fmep_bmp_ini(Wora_FMEP::Bitmap_Replacement_File)
        else
          wora_fmep_bmp_ini(32, 32)
        end
      end
    end
  end
end

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
Well, my script technically doesn't check up to infinity; it was designed to stop the first time creating the bitmap didn't work (which, by default, would be when the picture doesn't exist) but Wora's script effectively makes it so that creating the bitmap always works. Anyway, it wasn't a good design choice on my part; the whole script is pretty sloppy.

Anyway, here is a really ugly fix. Just paste it below both scripts:

Code: [Select]
class Game_Temp
  attr_accessor :wora_fmep_switch
end

class Bitmap
  def initialize(*args)
    if $game_temp && $game_temp.wora_fmep_switch
      wora_fmep_bmp_ini(*args)
    else
      begin
        wora_fmep_bmp_ini(*args)
      rescue
        Wora_FMEP.print(0, args[0])
        if Wora_FMEP::Use_Bitmap_Replacement
          wora_fmep_bmp_ini(Wora_FMEP::Bitmap_Replacement_File)
        else
          wora_fmep_bmp_ini(32, 32)
        end
      end
    end
  end
end

class Spriteset_Map
  alias maap_worafmep_comp_uparlx_6yh2 update_parallax
  def update_parallax (*args)
    $game_temp.wora_fmep_switch = true
    maap_worafmep_comp_uparlx_6yh2 (*args)
    $game_temp.wora_fmep_switch = false
  end
end

If I had any time at all I would make a fix that isn't so sloppy.
« Last Edit: September 06, 2011, 10:12:36 PM by modern algebra »

**
Rep:
Level 67
Eternal Newbie
No worries. Glad that got sorted out. Would you mind explaining how that particular fix works? It's hard to understand purely just by reading the script, unlike the other scripts I've worked with. I would really like to be able to understand it better.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
Well, basically, it creates an instance variable in Game_Temp and redefines the initialize method of Bitmap from Wora's script so that if the value of that variable is true (really, nonnil and not false), then it will just run the method as if wora's script wasn't interfering. Then I aliased the update_parallax method from the Animated Parallax script (which was the one causing the error) and turned that boolean to true, effectively telling Wora's script to not operate for any missing graphic errors that occur within that method. It then turns the boolean to false so that Wora's script will operate everywhere else.

But it's a lazy fix for my sloppy script. It should have just been a file check from the beginning and then no errors would have occurred. I can't imagine it would be a useful script to learn from since it's pretty terrible. If I had the time, I'd rewrite the whole script.

EDIT::

Rewrote the script into v. 2.0
« Last Edit: September 07, 2011, 12:58:22 AM by modern algebra »

**
Rep:
Level 67
Eternal Newbie
Just tried the new version. It seems to cause lag when it cycles. I thought it might have been an argument with another script I was running, but when I put it in a new project, the same lag was happening. This only occurred with large parallaxes. I reduced the size of the parallax and it seemed to help. I didn't experience this when using the 1.0 script. I plan on using large parallaxes and I do not wish to sacrifice the quality of the images.

EDIT: I was comparing the two scripts to see if I can come up with a fix for myself. I noticed that you don't have a dispose method in your 2.0 script. Could this be what is causing the problem? I'm experimenting for myself, and I'll post if I find any results.

EDIT2: I basically copied the dispose method from the original version of the script, but that didn't seem to help. I know it's a problem with the draw method. I experimented with the number of times the parallax is switch on the map, and the more often it switches, the more lag is caused. In the frames between parallax switches, I can move, but while it is switching, I'm completely frozen. This even effects the map fading in when first entering it.
« Last Edit: September 07, 2011, 03:09:49 AM by JonFawkes »

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
Well, no. I suppose it would cause more lag as, in the original version, the planes were all created at once and all that happened was it would make one visible and the rest invisible, then switch frames like that. This way relies on the original update_parallax method for better compatibility, which disposes each parallax bitmap when it is switched and creates a new one. The latter way is definitely more time-consuming but I didn't think the difference would be large, but I suppose it must be if the lag is that bad. I will fix it tonight, but if I do so it will likely make the script less compatible with other parallax-related scripts (though it would still be compatible with Wora's script).

Less clear is why the default script disposes the bitmap anyway; it kind of defeats the purpose of the Cache. I suppose they just figure it is not that helpful to cache it since it is a large file and, as far as they were concerned, it would only ever be created a maximum of once every map. You could try going into Spriteset_Map at line 198 and replacing:

Code: [Select]
      if @parallax.bitmap != nil
        @parallax.bitmap.dispose
        @parallax.bitmap = nil
      end

with:

Code: [Select]
      @parallax.bitmap = nil

See if that fixes the lag issue.
« Last Edit: September 07, 2011, 11:03:12 AM by modern algebra »

**
Rep:
Level 67
Eternal Newbie
That seemed to help a bit. I noticed it caused a bit of lag when first loading the different parallaxes, but after that it didn't lag at all. It might be troublesome on a map that uses a lot of frames though.

Also, I'd like to suggest a feature: the ability to add a delay for specified frames when animating the parallax. For example, have frame_1 play for 20 frames, frame_2 play for 300 frames, and then the rest play for 20 frames. It would be much more efficient resource-wise than copying frame_2 a dozen times to get it to delay

***
Rep:
Level 74
I'm baaack!
This script is awesome so I added it to my favourites list just in case I need any paralaxes in my game ^_^

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
How big are the parallax files you're loading Jon? Are they bmps or something?

**
Rep:
Level 67
Eternal Newbie
They're all high quality jpgs. My test-map dimensions are 50x70 squares, and the parallax is over 3mb each frame

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
3mb eh? That must be why you're experiencing lag the first time each frame is loaded. On the other hand, it explains why the default scripts are designed to dispose parallax bitmaps (I am dumb). There's not really a lot I can do about that, unfortunately. The only thing I can change is whether they are loaded all at once when the map first loads or whether it is done individually the first time they are loaded (how it currently is).

Anyway, I'll go ahead and update this script to v. 2.1. This change incorporates the fix to not dispose the bitmap every time as well as adds: (a) an option to specify the number of frames to keep each panel of the animation up (by using an array for that map instead of an integer); and (b) an option to preload all the panels of the parallax when you first enter the map. That will make it so that the only lag will be experienced once when the map is first loaded. If you only have smaller parallax files, the option should be turned off since it makes it take longer to load the map and it won't cause noticable lag if they are only loaded once when they first appear.

**
Rep:
Level 67
Eternal Newbie
Just tested it out. The small lag when loading is not a problem, a small thing that can be easily overlooked. The script works great. I have yet to try the delaying frames thing, but I don't doubt that it works. Great work as always MA

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
Thanks for your patience with me; your contributions have definitely improved the script :)

****
Bitch
Rep:
Level 87
Bits'n'Pixels
I'm getting a syntax error on line 100 (unexpected tSTAR) and have absolutely no idea what any of those words mean.  I didn't change anything, even within the edtable region (as I wanted to see what the animation speed would look like first before reducing/increasing it) but can't even load up to the title screen.  Was there something essential I was supposed to change but didn't?

Cheers~

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
This is an RMVX script. My guess is that you tried to put it in an RMVXA project.

Use the VXA version of the script instead: http://rmrk.net/index.php/topic,44635.0.html

****
Bitch
Rep:
Level 87
Bits'n'Pixels
Ah, dunno how I managed to switch boards into VX.  Cheers :)

**
Rep: +0/-0Level 57
RMRK Junior

Very nice script, ModernAlgebra, you are a genius.
I have a request for you. Can you make the sequence of images begins with a call script and stop with another call script? Is that possible? If that were possible, would be more than great.

**
Rep: +0/-0Level 57
RMRK Junior
Can't just said "yes" or "no, I would not, I can not do now"
thanks :)

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
It would be possible. I am not planning to do it though. Sorry.

**
Rep: +0/-0Level 57
RMRK Junior
Thanks for your answer, modern. Anyway, if ever you decide to do, it would be great.
Greetings!

*
Rep: +0/-0Level 45
RMRK Junior
Hi, looks like nice script (when you can get it to work : p)

This question may seem silly, but is this script exclusive for Rpg Maker XV and or XV ace, Right?

I'm trying to test it on a new project with RMXP and I get this message:

Script 'Animated_Parallax_Bk' line 98: Name Error ocurred. undefined method 'setup_parallax' for class 'Game_Map'

I asked if it worked only for the XV because I 'googled' if someone else got the same message so I wouldn't bother you. I just found some post of other people that tried the script and had some good results, I think. Also, rereading some of the post here it says the Script was made for VX and not VXa.

Anyway, I could eventually also use an parallel event changing manually the "panoramas" for each of the maps with that kind of animated backgrounds and perhaps use the "MogHunter Panorama Scroll" when I need that other script so it doesn't conflict with yours.

¿Any suggestion?

*
Rep:
Level 82
Hi, looks like nice script (when you can get it to work : p)

This question may seem silly, but is this script exclusive for Rpg Maker XV and or XV ace, Right?

I'm trying to test it on a new project with RMXP and I get this message:

Script 'Animated_Parallax_Bk' line 98: Name Error ocurred. undefined method 'setup_parallax' for class 'Game_Map'

I asked if it worked only for the XV because I 'googled' if someone else got the same message so I wouldn't bother you. I just found some post of other people that tried the script and had some good results, I think. Also, rereading some of the post here it says the Script was made for VX and not VXa.

Anyway, I could eventually also use an parallel event changing manually the "panoramas" for each of the maps with that kind of animated backgrounds and perhaps use the "MogHunter Panorama Scroll" when I need that other script so it doesn't conflict with yours.

¿Any suggestion?

Unfortunately, this script will only (likely) work with VX.

Because the differences between the three RGSS platforms are very different, a script made for a specific platform is unlikely to work on that platform. Not many scripts are capable of being multi-platform usable.

For a script, you will have to try to find a similar one already made for XP or try to find someone who is willing to translate this script over to XP. Alternatively, you can try to recreate the effect with events as you pointed out.
(Why do I always feel like it's the end of the world and I'm the last man standing?)

*
Rep: +0/-0Level 45
RMRK Junior
Quote
Because the differences between the three RGSS platforms are very different, a script made for a specific platform is unlikely to work on that platform. Not many scripts are capable of being multi-platform usable.

For a script, you will have to try to find a similar one already made for XP or try to find someone who is willing to translate this script over to XP. Alternatively, you can try to recreate the effect with events as you pointed out.

Just what I thought.

Thanks for the quick answer LoganF.

PD: If I don't find any XP Scripts to do the job and I achieve it using events or somehow a common event I may upload it or something (On the XP section somewhere of course).

***
Rep:
Level 69
RMRK Junior
I was just wondering if there was a way to set this up so that the an overhead parallax layer would also be animated, that would be boss, has anyone been able to accomplish this?