IPB

Look

Make sure you read the pinned topic on how to submit scripts.

There is 2 page(s) Previous Page Page : 1 2 
 
 Battle Backgrounds
 
 Cain La Croix
post Mar 6 2008, 07:02 PM
Post #21


Newbie
*

Group: Unknown
Posts: 6
Joined: 6-March 08
Member No.: 954



FINALLY I made it work. It was because I had to put the map Id for every map until the map I wanted to use for example:

CODE
    1 => "Grassland01",
    2 => "Grassland02",
    3 => "Grassland03",
    4 => "Grassland04",
    5 => "Grassland05",
    6 => "Grassland06"


like that I couldn't just put

6 => "plains"

I had to put them in order.

Wow that was easy lol
Go to the top of the page
 
 
 Elemental Crisis
post Mar 7 2008, 12:46 AM
Post #22


Administrator
***

Group: Owner
Posts: 266
Joined: 27-November 07
Member No.: 1



Interesting, good to know.

Glad to see you were able to fix the problem.
Go to the top of the page
 
 
 luciddose
post Mar 25 2008, 08:22 PM
Post #23


Newbie
*

Group: Unknown
Posts: 4
Joined: 25-March 08
Member No.: 1,060



Getting a Script 'Cache' line 75: TypeError occured cannot convert nil into String

Cache
Spoiler
CODE
#==============================================================================
# ** Cache
#------------------------------------------------------------------------------
#  This module loads each of graphics, creates a Bitmap object, and retains it.
# To speed up load times and conserve memory, this module holds the created
# Bitmap object in the internal hash, allowing the program to return
# preexisting objects when the same bitmap is requested again.
#==============================================================================

module Cache
  #--------------------------------------------------------------------------
  # * Get Animation Graphic
  #     filename : Filename
  #     hue      : Hue change value
  #--------------------------------------------------------------------------
  def self.animation(filename, hue)
    load_bitmap("Graphics/Animations/", filename, hue)
  end
  #--------------------------------------------------------------------------
  # * Get Battler Graphic
  #     filename : Filename
  #     hue      : Hue change value
  #--------------------------------------------------------------------------
  def self.battler(filename, hue)
    load_bitmap("Graphics/Battlers/", filename, hue)
  end
  #--------------------------------------------------------------------------
  # * Get Character Graphic
  #     filename : Filename
  #--------------------------------------------------------------------------
  def self.character(filename)
    load_bitmap("Graphics/Characters/", filename)
  end
  #--------------------------------------------------------------------------
  # * Get Face Graphic
  #     filename : Filename
  #--------------------------------------------------------------------------
  def self.face(filename)
    load_bitmap("Graphics/Faces/", filename)
  end
  #--------------------------------------------------------------------------
  # * Get Parallax Background Graphic
  #     filename : Filename
  #--------------------------------------------------------------------------
  def self.parallax(filename)
    load_bitmap("Graphics/Parallaxes/", filename)
  end
  #--------------------------------------------------------------------------
  # * Get Picture Graphic
  #     filename : Filename
  #--------------------------------------------------------------------------
  def self.picture(filename)
    load_bitmap("Graphics/Pictures/", filename)
  end
  #--------------------------------------------------------------------------
  # * Get System Graphic
  #     filename : Filename
  #--------------------------------------------------------------------------
  def self.system(filename)
    load_bitmap("Graphics/System/", filename)
  end
  #--------------------------------------------------------------------------
  # * Clear Cache
  #--------------------------------------------------------------------------
  def self.clear
    @cache = {} if @cache == nil
    @cache.clear
    GC.start
  end
  #--------------------------------------------------------------------------
  # * Load Bitmap
  #--------------------------------------------------------------------------
  def self.load_bitmap(folder_name, filename, hue = 0)
    @cache = {} if @cache == nil
    path = folder_name + filename
    if not @cache.include?(path) or @cache[path].disposed?
      if filename.empty?
        @cache[path] = Bitmap.new(32, 32)
      else
        @cache[path] = Bitmap.new(path)
      end
    end
    if hue == 0
      return @cache[path]
    else
      key = [path, hue]
      if not @cache.include?(key) or @cache[key].disposed?
        @cache[key] = @cache[path].clone
        @cache[key].hue_change(hue)
      end
      return @cache[key]
    end
  end
end


& Battle_Backgrounds

Spoiler
CODE
#==============================================================================
# ? VX-RGSS2-7 Change Battle Background [Ver.1.0.0]     by Claimh
#------------------------------------------------------------------------------
# English Translation By: Elemental Crisis [http://rpgcrisis.net]
#------------------------------------------------------------------------------
# Changes the battle background.
#==============================================================================


module BattleBack
  #   Select Battle Background Type
  #   0:Current map with wave effect for battle background (Default VX Style).
  #   1:Current map used as battle background.
  #   2:Uses a picture for battle background.
  BB_TYPE = 2
  
  # Display Battle Floor
  BT_FLOOR = false

  # Picture (Only required if BB_TYPE = 2)
  M_B_BACK = {
    # All picture files must be in the Graphics/System folder.
    # Map ID => "Picture File Name"
    1 => "plains"
  }
end


#==============================================================================
# ? Spriteset_Battle
#==============================================================================
class Spriteset_Battle
  #--------------------------------------------------------------------------
  # ? Creating Battle Back Sprite
  #--------------------------------------------------------------------------
  def create_battleback
    case BattleBack::BB_TYPE
    when 0
      source = $game_temp.background_bitmap
      bitmap = Bitmap.new(640, 480)
      bitmap.stretch_blt(bitmap.rect, source, source.rect)
      bitmap.radial_blur(90, 12)
      @battleback_sprite = Sprite.new(@viewport1)
      @battleback_sprite.bitmap = bitmap
      @battleback_sprite.ox = 320
      @battleback_sprite.oy = 240
      @battleback_sprite.x = 272
      @battleback_sprite.y = 176
      @battleback_sprite.wave_amp = 8
      @battleback_sprite.wave_length = 240
      @battleback_sprite.wave_speed = 120
    when 1
      source = $game_temp.background_bitmap
      bitmap = Bitmap.new(640, 480)
      bitmap.stretch_blt(bitmap.rect, source, source.rect)
      @battleback_sprite = Sprite.new(@viewport1)
      @battleback_sprite.bitmap = bitmap
      @battleback_sprite.ox = 320
      @battleback_sprite.oy = 240
      @battleback_sprite.x = 272
      @battleback_sprite.y = 176
    when 2
      @battleback_sprite = BattleBackSprite.new(@viewport1)
    end
  end
  #--------------------------------------------------------------------------
  # ? Creating Battle Floor Sprite
  #--------------------------------------------------------------------------
  alias create_battlefloor_mbb create_battlefloor
  def create_battlefloor
    create_battlefloor_mbb if BattleBack::BT_FLOOR
  end
  #--------------------------------------------------------------------------
  # ? Delete Battle Floor Sprite
  #--------------------------------------------------------------------------
  alias dispose_battlefloor_mbb dispose_battlefloor
  def dispose_battlefloor
    dispose_battlefloor_mbb if BattleBack::BT_FLOOR
  end
  #--------------------------------------------------------------------------
  # ? Update Battle Floor Sprite
  #--------------------------------------------------------------------------
  alias update_battlefloor_mbb update_battlefloor
  def update_battlefloor
    update_battlefloor_mbb if BattleBack::BT_FLOOR
  end
end


#==============================================================================
# ? BattleBackSprite
#==============================================================================
class BattleBackSprite   # Background Screen Size
  WIDTH  = 544.00
  HEIGHT = 288.00
  #--------------------------------------------------------------------------
  # ? Object Initialization
  #     viewport : viewport
  #--------------------------------------------------------------------------
  def initialize(viewport = nil)
    super(viewport)
    self.bitmap = Cache.system(BattleBack::M_B_BACK[$game_map.map_id])
    # Zoom is carried out according to picture size.
    @x_zoom = WIDTH / self.bitmap.width
    @y_zoom = HEIGHT / self.bitmap.height
    @zoom = @x_zoom > @y_zoom ? @x_zoom : @y_zoom
    # Zoom is carried out.
    self.zoom_x = @zoom
    self.zoom_y = @zoom
    # Made into central display.
    self.ox = self.bitmap.width / 2
    self.oy = self.bitmap.height / 2
    self.x = (self.bitmap.width / 2)  * @zoom
    self.y = (self.bitmap.height / 2) * @zoom
  end
end
Go to the top of the page
 
 
 Elemental Crisis
post Mar 25 2008, 11:53 PM
Post #24


Administrator
***

Group: Owner
Posts: 266
Joined: 27-November 07
Member No.: 1



@luciddose

Check to see if there is an "Map001.rvdata" in the data folder of your project folder.
Go to the top of the page
 
 
 luciddose
post Mar 26 2008, 08:03 AM
Post #25


Newbie
*

Group: Unknown
Posts: 4
Joined: 25-March 08
Member No.: 1,060



QUOTE (Elemental Crisis @ Mar 26 2008, 02:53 AM)
@luciddose

Check to see if there is an "Map001.rvdata" in the data folder of your project folder.


yes sir, It is there in the data folder.
Go to the top of the page
 
 
 Elemental Crisis
post Mar 26 2008, 10:40 PM
Post #26


Administrator
***

Group: Owner
Posts: 266
Joined: 27-November 07
Member No.: 1



Weird, the script worked for me, did you put it above "MAIN"?
Go to the top of the page
 
 
 luciddose
post Mar 27 2008, 09:47 AM
Post #27


Newbie
*

Group: Unknown
Posts: 4
Joined: 25-March 08
Member No.: 1,060



QUOTE (Elemental Crisis @ Mar 27 2008, 02:40 AM)
Weird, the scripted worked for me, did you put it above "MAIN"?


ROFL I finally got it to work by checking out the above posts and trial and error. it was like 9th down the list of maps i am using and i had to get to it by listing them all. Anyways I suppose my only question now is if it is possible to have multiple background images on the same map?
Go to the top of the page
 
 
 Shinso-Shikai
post May 4 2008, 02:45 PM
Post #28


Newbie
*

Group: Unknown
Posts: 3
Joined: 4-May 08
Member No.: 1,240



How exactly do you change the background??

Is it a change within the code, or something else?? Sorry, I'm fairly new to this whole thing
Go to the top of the page
 
 
 Devilraider
post May 4 2008, 04:14 PM
Post #29


Newbie
*

Group: Unknown
Posts: 3
Joined: 1-May 08
From: La Durantaye, Québec , Canada
Member No.: 1,221



I would like to know if it is possible to have multiple backgrounds in the same map, like in the World Map where there are many regions. And by the way, great script, works wonderfully !
Go to the top of the page
 
 
 Devilraider
post May 7 2008, 01:12 PM
Post #30


Newbie
*

Group: Unknown
Posts: 3
Joined: 1-May 08
From: La Durantaye, Québec , Canada
Member No.: 1,221



Would it be possible to set the Battle Backgrounds to Areas too with some sort of edited script ? I'm really no scripter so I don't know the possibilities, that's why I'm asking. If yes, it would relieve a big pain in my *** cause how I'm doing now is that I need to make maps transitting between the regions in which background changes, like, my character pass from a desert to a grassland, i make a passage (stage like) between em and make a copy of the world map with a different background. It works somehow but i c'ant do it for forests and beach and such. A reply would greatly help me even if its negative, I'll know that i need to continue this way at least.
Go to the top of the page
 
 
 Iilakar
post May 8 2008, 03:42 AM
Post #31


Newbie
*

Group: Unknown
Posts: 4
Joined: 8-May 08
Member No.: 1,255



Hey there, i did all what you said, also my pic is in graphic/system folder, nothing happens when in a battle ..
here is the script:

Spoiler
#======================================================================
========
# ? VX-RGSS2-7 Change Battle Background [Ver.1.0.0] by Claimh
#------------------------------------------------------------------------------
# English Translation By: Elemental Crisis [https://rpgcrisis.net]
#------------------------------------------------------------------------------
# Changes the battle background.
#==============================================================================


module BattleBack
# Select Battle Background Type
# 0:Current map with wave effect for battle background (Default VX Style).
# 1:Current map used as battle background.
# 2:Uses a picture for battle background.
BB_TYPE = 0

# Display Battle Floor
BT_FLOOR = false

# Picture (Only required if BB_TYPE = 2)
M_B_BACK = {
# All picture files must be in the Graphics/System folder.
# Map ID => "Picture File Name"
1 => "Beach01"
}
end


#==============================================================================
# ? Spriteset_Battle
#==============================================================================
class Spriteset_Battle
#--------------------------------------------------------------------------
# ? Creating Battle Back Sprite
#--------------------------------------------------------------------------
def create_battleback
case BattleBack::BB_TYPE
when 0
source = $game_temp.background_bitmap
bitmap = Bitmap.new(640, 480)
bitmap.stretch_blt(bitmap.rect, source, source.rect)
bitmap.radial_blur(90, 12)
@battleback_sprite = Sprite.new(@viewport1)
@battleback_sprite.bitmap = bitmap
@battleback_sprite.ox = 320
@battleback_sprite.oy = 240
@battleback_sprite.x = 272
@battleback_sprite.y = 176
@battleback_sprite.wave_amp = 8
@battleback_sprite.wave_length = 240
@battleback_sprite.wave_speed = 120
when 1
source = $game_temp.background_bitmap
bitmap = Bitmap.new(640, 480)
bitmap.stretch_blt(bitmap.rect, source, source.rect)
@battleback_sprite = Sprite.new(@viewport1)
@battleback_sprite.bitmap = bitmap
@battleback_sprite.ox = 320
@battleback_sprite.oy = 240
@battleback_sprite.x = 272
@battleback_sprite.y = 176
when 2
@battleback_sprite = BattleBackSprite.new(@viewport1)
end
end
#--------------------------------------------------------------------------
# ? Creating Battle Floor Sprite
#--------------------------------------------------------------------------
alias create_battlefloor_mbb create_battlefloor
def create_battlefloor
create_battlefloor_mbb if BattleBack::BT_FLOOR
end
#--------------------------------------------------------------------------
# ? Delete Battle Floor Sprite
#--------------------------------------------------------------------------
alias dispose_battlefloor_mbb dispose_battlefloor
def dispose_battlefloor
dispose_battlefloor_mbb if BattleBack::BT_FLOOR
end
#--------------------------------------------------------------------------
# ? Update Battle Floor Sprite
#--------------------------------------------------------------------------
alias update_battlefloor_mbb update_battlefloor
def update_battlefloor
update_battlefloor_mbb if BattleBack::BT_FLOOR
end
end


#==============================================================================
# ? BattleBackSprite
#==============================================================================
class BattleBackSprite # Background Screen Size
WIDTH = 544.00
HEIGHT = 288.00
#--------------------------------------------------------------------------
# ? Object Initialization
# viewport : viewport
#--------------------------------------------------------------------------
def initialize(viewport = nil)
super(viewport)
self.bitmap = Cache.system(BattleBack::M_B_BACK[$game_map.map_id])
# Zoom is carried out according to picture size.
@x_zoom = WIDTH / self.bitmap.width
@y_zoom = HEIGHT / self.bitmap.height
@zoom = @x_zoom > @y_zoom ? @x_zoom : @y_zoom
# Zoom is carried out.
self.zoom_x = @zoom
self.zoom_y = @zoom
# Made into central display.
self.ox = self.bitmap.width / 2
self.oy = self.bitmap.height / 2
self.x = (self.bitmap.width / 2) * @zoom
self.y = (self.bitmap.height / 2) * @zoom
end
end
Go to the top of the page
 
 
 Devilraider
post May 8 2008, 06:29 PM
Post #32


Newbie
*

Group: Unknown
Posts: 3
Joined: 1-May 08
From: La Durantaye, Québec , Canada
Member No.: 1,221



Change

BB_TYPE = 0

to

BB_TYPE = 2

It is what activates the custom backgrounds.

EDIT: I resized backgrounds from RMXP RGSS, if anyone would need them, I could upload them.
Go to the top of the page
 
 
 Daldraeic
post May 9 2008, 11:26 AM
Post #33


Newbie
*

Group: Unknown
Posts: 2
Joined: 12-February 08
Member No.: 735



Noob question here. Is there a way to change the background with the script command inside events?
Go to the top of the page
 
 
 

There is 2 page(s) Previous Page Page : 1 2
 
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 13th May 2008 - 06:52 AM