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.
[RESOLVED] Battle Background Script Problem

0 Members and 1 Guest are viewing this topic.

**
Rep: +0/-0Level 75
RMRK Junior
I'm having a small issue getting my battle backgrounds to display correctly. When I test each map they default to my "grassland" battleback instead of using the caves or desert so far. I've double checked my files. They are named correctly and are in the "pictures" folder. So I thought maybe I made a scripting mistake when I added them to the list. If anyone wouldn't mind taking a look and seeing if there's a mistake I may have made, I'd appreciate it.

EDIT: I had a major conflict in my scripts. I corrected it and haven't had a problem since.

#===============================================================================
# Battle Backgrounds - RMVX
#===============================================================================
# Written by Synthesize
# January 20, 2008
# Version 1.00A
#===============================================================================
#                       * This script is untested. *
#===============================================================================
module SynBattleB
  # Place your battle backgrounds in the 'Pictures' folder (Graphics/Pictures)
  # Format = {map_id => Battleback Name}
  Battle_background =
  {
  1 => "001-Grassland01",
  2 => "001-Grassland01",
  3 => "001-Grassland01",
  4 => "001-Grassland01",
  5 => "001-Grassland01",
  6 => "001-Grassland01",
  7 => "006-Desert01",
  8 => "001-Grassland01",
  9 => "007-Cave04",
  10 => "001-Grassland01",
  11 => "001-Grassland01",
  12 => "001-Grassland01",
  13 => "001-Grassland01",
  14 => "001-Grassland01",
  15 => "001-Grassland01",
  17 => "001-Grassland01",
  18 => "001-Grassland01",
  19 => "007-Cave04",
  20 => "007-Cave04",
  21 => "007-Cave04",
  22 => "007-Cave04",
  23 => "007-Cave04",
  24 => "007-Cave04",
  }
  #-----------------------------------------------------------------------------
  # Create the battlefloor?
  Create_battlefloor = false
  #-----------------------------------------------------------------------------
  # This was being requested on quite a fe forums now, so I threw a quick script
  # together. It is nice and simple, and does what it is suppsoed to do. Once
  # RMVX is released in English, then I will add additional features into this.
  #-----------------------------------------------------------------------------
end
#-------------------------------------------------------------------------------
# Spriteset_Battle
#-------------------------------------------------------------------------------
class Spriteset_Battle
  alias syn_create_battlefloor create_battlefloor
  #-----------------------------------------------------------------------------
  # Create Battleback
  #-----------------------------------------------------------------------------
  def create_battleback
    image = SynBattleB::Battle_background[$game_map.map_id]
    @battleback_sprite = Sprite.new(@viewport1)
    @battleback_sprite.bitmap = Cache.picture(image)
  end
  def create_battlefloor
    @battlefloor_sprite = Sprite.new(@viewport1)
    syn_create_battlefloor if SynBattleB::Create_battlefloor == true
  end
end
#===============================================================================
#                        * This script is untested *
#=============================================================================== 
# Version 1.00A
# January 20, 2008
# Written by Synthesize
#===============================================================================
# Battle Backgrounds - RMVX
#===============================================================================
« Last Edit: September 10, 2010, 09:12:32 PM by Skias »

*
Rep: +0/-0Level 70
RMRK Junior
Just guessing:Your map ID is wrong.Go to map properties to see map ID.