The RPG Maker Resource Kit

RMRK RPG Maker Creation => VX => VX Scripts Database => Topic started by: ahref on March 04, 2008, 06:24:40 PM

Title: [RMVX] Earthbound Backgrounds (Modified from Battle Backgrounds)
Post by: ahref on March 04, 2008, 06:24:40 PM
EarthBound Backgrounds
Version: 2
Author: ahref,modified from battle backgrounds by Synthesize
Date: 19/2/10

Version History


Planned Future Versions
Support for animations

Description


This script takes the core from Battle Backgrounds and modifies a few things. The picture is determined by the group/troop id and the abstract wavey pattern can be controlled. This is intended to recreate the backgrounds found in earthbound.
NEW: You can now Specify unlimited layers of backgrounds

Features


Screenshots

(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi25.photobucket.com%2Falbums%2Fc69%2Fiframe%2Ftest1.png&hash=2d42641c871aa62e33a22537a985e726bb73deca)
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi25.photobucket.com%2Falbums%2Fc69%2Fiframe%2F2layerstransparency.png&hash=c75c260114b12b5bf28082b1284e9650eae45e27)

Instructions

Place your battle backgrounds in the 'Pictures' folder (Graphics/Pictures) and see the script for details about using it.

Script


Code: [Select]
#===============================================================================
# Earthbound Backgrounds - RMVX
#===============================================================================
# Written by Synthesize
# February 19, 2010
# Version 2
# Modified by ahref
#===============================================================================
module SynBattleB
  #-----------------------------------------------------------------------------
  # Place your battle backgrounds in the 'Pictures' folder (Graphics/Pictures)
  # Format = <group id> => Array of Backgrounds, See Below For examples
  #
  # Items in the array: [ImageName,Wave Amp, Wave Length, Wave Speed, x pos, y pos
  # Note: 0 in the wave varibles means the background wont move :D.
  #
  # BIGGER NOTE: the previous array you set up for your backgrounds will
  # no longer work please retype it :(
  #-----------------------------------------------------------------------------
  Battle_background =
  {
  #Examples
  # 1 => [["bg1",60,240,120,-80,0]] 1 Background
  # 2 => [["bg1",60,240,120,-80,0],["bg2", 0, 0, 0,-80,0]] 2 Backgrounds
  # 3 => [["bg1",60,240,120,-80,0],["bg2", 0, 0, 0,-80,0],["bg3", 0, 0, 0,-80,0],["bg4", 0, 0, 0,-80,0]] 4 Backgrounds
  # n => [["bg1",60,240,120,-80,0],...,["bgn",60,240,120,-80,0] ]
  1 => [["bg1",60,240,120,-80,0],["bg2", 0, 0, 0,-80,0]]
  }
#-------------------------------------------------------------------------------
# Create the battlefloor?
#-------------------------------------------------------------------------------
  Create_battlefloor = false
end
#-------------------------------------------------------------------------------
# Spriteset_Battle
#-------------------------------------------------------------------------------
class Spriteset_Battle
  alias syn_create_battlefloor create_battlefloor
#-------------------------------------------------------------------------------
# Create Battleback
#-------------------------------------------------------------------------------
  def create_battleback
    @battlebacks = Array.new
    background = SynBattleB::Battle_background[$game_troop.troop.id]
    background.each do |b|
      @battlebacks << Sprite.new(@viewport1)    
      @battlebacks.last.bitmap = Cache.picture(b[0])
      @battlebacks.last.wave_amp = b[1]
      @battlebacks.last.wave_length = b[2]
      @battlebacks.last.wave_speed = b[3]
      @battlebacks.last.x = b[4]
      @battlebacks.last.y = b[5]
    end
  end
  def create_battlefloor
    @battlefloor_sprite = Sprite.new(@viewport1)
    syn_create_battlefloor if SynBattleB::Create_battlefloor == true
  end
  #-----------------------------------------------------------------------------
  # * Dispose of Battleback Bitmap
  #-----------------------------------------------------------------------------
  def dispose_battleback_bitmap
    @battlebacks.each do |b|
      b.bitmap.dispose
    end
  end
  #-----------------------------------------------------------------------------
  # * Dispose of Battleback Sprite
  #-----------------------------------------------------------------------------
  def dispose_battleback  
    @battlebacks.each do |b|
      b.dispose
    end
  end
  #-----------------------------------------------------------------------------
  # * Update Battleback
  #-----------------------------------------------------------------------------
  def update_battleback
    @battlebacks.each do |b|
      b.update
    end
  end
end
#===============================================================================  
# Written by Synthesize
# February 19, 2010
# Version 2
# Modified by ahref
#===============================================================================
# Earthbound Backgrounds - RMVX
#===============================================================================

Credit


Support


IM ME!

Author's Notes


Made for arrow during GIAWVX :D
Synthesize for whatever reason if you dont want this to be here PM me :D

EPIC NECROPOST UPDATE OF AWESOME

Title: Re: [RMVX] Earthbound Backgrounds (Modified from Battle Backgrounds)
Post by: modern algebra on March 04, 2008, 06:58:05 PM
looks nice ahref  ;D
Title: Re: [RMVX] Earthbound Backgrounds (Modified from Battle Backgrounds)
Post by: ahref on April 07, 2008, 03:42:49 PM
Updated
Title: Re: [RMVX] Earthbound Backgrounds (Modified from Battle Backgrounds)
Post by: Arrow on April 07, 2008, 08:14:38 PM
Additional praise is required!

YOU ARE AWESOME.
Title: Re: [RMVX] Earthbound Backgrounds (Modified from Battle Backgrounds)
Post by: ahref on April 07, 2008, 11:16:12 PM
fix for arrows problem(i hope):
replace lines 62-88 with
Code: [Select]
#-----------------------------------------------------------------------------
  # * Dispose of Battleback Bitmap
  #-----------------------------------------------------------------------------
  def dispose_battleback_bitmap
    @battleback_sprite.bitmap.dispose
    if @battleback_sprite2
      @battleback_sprite2.bitmap.dispose
    end
  end
  #-----------------------------------------------------------------------------
  # * Dispose of Battleback Sprite
  #-----------------------------------------------------------------------------
  def dispose_battleback 
    @battleback_sprite.dispose
    if @battleback_sprite2
      @battleback_sprite2.dispose
    end
  end
  #-----------------------------------------------------------------------------
  # * Update Battleback
  #-----------------------------------------------------------------------------
  def update_battleback
    @battleback_sprite.update
    if @battleback_sprite2
      @battleback_sprite2.update
    end
  end
[/s]


above fix was not the fix :D
Title: Re: [RMVX] Earthbound Backgrounds (Modified from Battle Backgrounds)
Post by: Arrow on April 11, 2008, 08:31:55 PM
ahref your fix now works perfectly. I owe you hugely.
Title: Re: [RMVX] Earthbound Backgrounds (Modified from Battle Backgrounds)
Post by: Zero2008 on March 22, 2009, 06:42:47 AM
Hey dude, i like our Script and i finally figured out how to use it, but i'd like to know how do you set multiple backgrounds for multiple enemy troops?
Do you copy and paste the line under the original and edit the info? or do u copy and paste the whole thing again?...
Im confused...
Title: Re: [RMVX] Earthbound Backgrounds (Modified from Battle Backgrounds)
Post by: ahref on February 19, 2010, 01:30:15 PM
EPIC NECROPOST,

Script MAJORLY updated.
Title: Re: [RMVX] Earthbound Backgrounds (Modified from Battle Backgrounds)
Post by: Zero2008 on February 19, 2010, 01:37:21 PM
AWESOME!
Can't wait for the Animation update!
Title: Re: [RMVX] Earthbound Backgrounds (Modified from Battle Backgrounds)
Post by: Wiimeiser on June 20, 2010, 06:55:50 AM
I'm having SERIOUS problems with this script. With it installed, the game crashes with a "nil class" error if I encounter a troop other than troop 1. If I add a new line to the script, like you said to, the game won't even start due to a syntax error on that one line! What am I doing wrong? What can I do? The script is far from informative...
Title: Re: [RMVX] Earthbound Backgrounds (Modified from Battle Backgrounds)
Post by: modern algebra on June 20, 2010, 11:30:05 AM
You probably have to set a background for that troop. See here:

Code: [Select]

  1 => [["bg1",60,240,120,-80,0],["bg2", 0, 0, 0,-80,0]]

That sets it for troop 1. You'll need to set ones for Troop 2, 3, etc..., like:

Code: [Select]
  1 => [["bg1",60,240,120,-80,0],["bg2", 0, 0, 0,-80,0]],
  2 => [["bg1",60,240,120,-80,0],["bg2", 0, 0, 0,-80,0]],
  3 => [["bg1",60,240,120,-80,0],["bg2", 0, 0, 0,-80,0]],
  ...
  n => [["bg1",60,240,120,-80,0],["bg2", 0, 0, 0,-80,0]]

If I had to guess, the reason you are getting a syntax error when you try to add lines is because you aren't putting commas.
Title: Re: [RMVX] Earthbound Backgrounds (Modified from Battle Backgrounds)
Post by: Wiimeiser on June 20, 2010, 09:53:45 PM
Thanks! I can't believe I missed something so simple! I knew I was missing something blindingly obvious, but I just had no idea!
Title: Re: [RMVX] Earthbound Backgrounds (Modified from Battle Backgrounds)
Post by: EdwinX7 on October 06, 2011, 01:46:19 PM
can make this just going up or down without Wave

here vid what a abort
go to 0:22
http://www.youtube.com/watch?v=VOLpsM5RC4w

go to 3:10:
http://www.youtube.com/watch?v=d8LjfTtW2qQ

just a Bonus
http://www.youtube.com/watch?v=ycUJzkyhuIU
http://www.youtube.com/watch?v=COBSIhmxwJ8