Hello
I have a PROBLEM! Please help me!
But 1st can I just say what a cool topic this is, having all the demos so people can try out different battle styles easily, is great for anyone new to the scene.
Plus all the scripts are arranged in the right order for you, no issues all good!
Except they're not! Argh! The horror!
Before I begin let me just apologise if you frequent other RMXP sites, i'm posting this everywhere as the problem has bottle necked my games development, my time, and my fun for 3 days now!
http://www.fileden.com/files/2008/10/3/2...Extras.zip from this thread
^
I downloaded that, after some messing around got all its stuff working in my game, EXCEPT Mimi's Battleback Changer
I really really like its features, ESPECIALLY the ability to fight on the map, not a battle back. MY BIG problem is that, if I have a fight
on the map when the fight exits I get this error:
Whenever the game tries to return to the map. it breaks :(
Additionally if any fight starts without a default BB chosen thenit crahses, but I can event around that, but the above problem is KILLING me!
I've really searched around but can't find any help anywhere :(
BTW the demo above comes with a 'global version' of M'sBB. Somewhere in my searches I found a Mimi and Dalissa D/L of just mimi's battleback and music changer.
This had the BB as global and a game initiated version, tried that too to know effect :(
PLease help me.
Wow I've had that problem for 3 days And couldnt figure it.
So i totally judt deconstructed my game and it's scripts from the top down.
AND I FOUND MY PROBLEM!! Woohoo!!
Battle Report v 1.6 by Illustrationism
That I'm a novice who spent AGES playing with M'sBB and it was just that Battle Report v 1.6 isn't compatible.
So if you put out updated versions of your EXCELLENT demos (and thank you again) please remove Battle Report!
BTW if you put Battle Report RIGHT at the bottom of your scripts, then the error message comes up as relating to Battle Report.
Jsut incase someone wants to 'solve' the problem rather just dumping Battle Report.
I have a PROBLEM! Please help me!
But 1st can I just say what a cool topic this is, having all the demos so people can try out different battle styles easily, is great for anyone new to the scene.
Plus all the scripts are arranged in the right order for you, no issues all good!
Except they're not! Argh! The horror!
Before I begin let me just apologise if you frequent other RMXP sites, i'm posting this everywhere as the problem has bottle necked my games development, my time, and my fun for 3 days now!
http://www.fileden.com/files/2008/10/3/2...Extras.zip from this thread
^
I downloaded that, after some messing around got all its stuff working in my game, EXCEPT Mimi's Battleback Changer
I really really like its features, ESPECIALLY the ability to fight on the map, not a battle back. MY BIG problem is that, if I have a fight
on the map when the fight exits I get this error:
Whenever the game tries to return to the map. it breaks :(
Additionally if any fight starts without a default BB chosen thenit crahses, but I can event around that, but the above problem is KILLING me!
I've really searched around but can't find any help anywhere :(
BTW the demo above comes with a 'global version' of M'sBB. Somewhere in my searches I found a Mimi and Dalissa D/L of just mimi's battleback and music changer.
This had the BB as global and a game initiated version, tried that too to know effect :(
PLease help me.
The Code Just in case
Code:
#==============================================================================
# ** Mimi's Battleback Changer
#------------------------------------------------------------------------------
# by DerVVulfman
# version 2.5-a ( ($)Global value version)
# 12-02-2007
# Full SDK 2.3 Compatible (Does not need or require SDK 2.3)
#------------------------------------------------------------------------------
#
# INTRODUCTION:
#
# This system allows you to pre-set the battle background shown during battle.
# You can set up the system to display the background based on the terrain id
# or by a separate variable that can describe what kind of event your party is
# engaging.
#
# This script was designed similarly to 'Mimi's Battle Music" and is a simple
# supplement for a feature ignored by RMXP's designers.
#
# But, unlike RM2K's and 2K3's design, you can also use "EVENT" variable to
# change your backgrounds and not the terrains underfoot. With that, this
# script can be used in conjunction with RPG Advocate's 'RM2K Defined Areas'
# or Sephiroth Spawn's 'Encounter Control' script.
# IE: If a player enters a rectangle set up by one of these scripts, the value
# may change to:
# $bbg_event = 2
# Then if the player enters another rectangle, the value may be set to:
# $bbg_event = 3
#
# Also, the system has support for 'animated' battlebacks... discussed further
# down in its own section.
#
#------------------------------------------------------------------------------
#
# USAGE:
#
# This version uses global values used throughout the system. As such, it has
# two bonuses: An easier to find config system at the top of the script, and
# a slightly easier method to change the 'cries' in-game:
#
# This script uses two global values: $bbg_type and $bbg_event
#
# $bbg_type This value determines whether the backgound shown during combat
# will be based on the default systems, based on the terrain tags
# of your tileset, or based on the current events of your story.
#
# $bbg_event This value merely determines what background is used IF you're
# scripting out your game to show the battle background based on
# the events your hero encounters.
#
#
# How to run:
#
# In an event... maybe an event like a monster (Action Button/Player Touch) or
# an automated event... you change the value of $bmg_type (and/or $bmg_event).
#
# By default $bbg_type is already set at 0, which tells it to play the default
# background normal. If you set $bbg_type = 1, then when the battle starts,
# the background will match the terrain (assuming you MADE it match).
#
# If you've changed $bbg_type = 2 AND changed $bbg_event = 1, then the first
# programmed event battle background will show instead of EITHER the terrain's
# background or the default battle background.
#
# And if you've set the $bbg_type to 3, then the battle background will be the
# actual field map... really. However, the routine that disposes of the battle
# background could not be easily aliased...
#
#------------------------------------------------------------------------------
#
# SETTING THE BACKGROUNDS:
#
# The configuration system is fairly simple. There are two hash arrays, one
# for the Event-Based BattleBackgrounds & the other for Terrain Based Battle
# Battlebacks. Both follow the same setup principle:
#
# $bback_event = { index => filename, index=> filename, etc. ... }
#
# The index value in the hash is the value of the $bbg_event value called in
# the system. Fairly simple.
#
# The same configuration layout applies to the Terrain-Themed array as well
# and uses the map's terrain tags as the index in its hash array.
#
# You may notice that in this script, the filenames don't have any .png exten-
# sion. They aren't needed. How nice... :)
#
# Just in case, the hash arrays have been declared as ($)Global hash arrays,
# so they can be re-entered through script events or whatnot. They are no
# longer static or constant lists and can be changed in-game.
#
#------------------------------------------------------------------------------
#
# ANIMATED BATTLEBACKS:
#
# This system has the ability to show an 'animated' background when in combat,
# typically referred to as an Animated Battleback. The Animated Battleback
# system was originally designed by RPG way back in '05, so this isn't exactly
# new.
#
# Animated battleback files should always end with two numbers, first is the
# total number of frames (ranging from 0 to 9) and the second is the current
# frame for this battleback (starting from 0 to the total number - 1), so if
# you had 5 frames for some desert battleback, you'd name the files:
#
# * desert50
# * desert51
# * desert52
# * desert53
# * desert54
#
# That's all there is to it. The script will check the second number from the
# end of the filename (total frames). If it's a digit in range from 0 to 9
# (and there aren't any other digits :p), it'll update the battleback.
#
# If the the battleback sequence is missing a file, it skips the load/display
# of that file to prevent a crash. While it may 'assume' that a battleback
# with two numbers at the end of the filename, it will not prevent the system
# from showing regular battlebacks so named. Nice, eh?
#
#------------------------------------------------------------------------------
#
# CAMERA ZOOM SYSTEMS:
#
# Whether it be the XRXS Camera Zoom or Cogwheel's Camera Drive system built
# into RTAB or CTB, the Animated Battleback and Map-For-Battleback options are
# non-functional and will cause errors.
#
# If you plan to use the ZOOM feature by either Cogwheel or XRXS, it is recom-
# mended to set the @camera_drive switch in the config section to false. It
# should mirror the @drive option in RTAB'S/CTB's ATB_Setup section (if used).
#
# Setting this switch to 'true' disables the battleback animation system and
# prevents it from crashing when regular battlebacks are called. However,
# camera zoom systems cannot be used in tandem with the Map-For-Battleback
# option. To use Field Map Battlebacks, you just can't use Camera Zooms and
# have to keep it set to 'false'.
#
#------------------------------------------------------------------------------
#
# JUST IN CASE:
#
# By default, the system will show the default battle background without any
# problem. Also, if no TERRAIN_ID or BMG_EVENT value matches what you've set
# in the script, it will show the normally used image file.
#
# Finally, with a little assistance from Me™ and Mr.Mo, I was able to create
# an Error-Checking routine that 'ensures' that no error in this system will
# cause the system to crash.
#
# For example, if you enter into the list of backgrounds used in the system, a
# file that doesn't exist (either in the project or the RTP file), then this
# script will use the default battle background instead. And if that's missing
# too, the battle background will be set to [none] to prevent errors.
#
#------------------------------------------------------------------------------
#
# COMPATABILITY:
#
# This system is compatible with most ANY battlesystem and the SDK 2.2. But,
# as there was a rewrite of the Spriteset_Battle's 'dispose' method, there
# may be issues with other systems that alias or alter the dispose method.
#
# If that is the case, you can remove the entire 'Spriteset_Battle' class in
# this script and not use the 'Map-for-Battleback' routine, or post this sys-
# tem above the conflicting script, and let the other take effect.
#
#==============================================================================
#========================================================================
# ** C O N F I G U R A T I O N S Y S T E M ** #
#========================================================================
$bback_event = { 1 => "041-EvilCastle01" }
$bback_terrain = { 1 => "001-Grassland01",
2 => "006-Desert01",
3 => "005-Beach01",
4 => "007-Swamp01" }
$bbg_delay = 20
# Switch required if using a Camera Zoom system
$camera_drive = false
#==============================================================================
# ** Game_System
#------------------------------------------------------------------------------
# This class handles data surrounding the system. Backround music, etc.
# is managed here as well. Refer to "$game_system" for the instance of
# this class.
#==============================================================================
class Game_System
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :default_bg
attr_accessor :mbc_bbe # Savable BBack Event Array
attr_accessor :mbc_bbt # Savable BBack Terrain Array
attr_accessor :mbc_bbgt # Savable BBack Type Global
attr_accessor :mbc_bbe # Savable BBack Event Global
attr_accessor :mbc_bbgd # Savable BBack Delay Global
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias mmbbc_init initialize
def initialize
# Perform the original call
mmbbc_init
# Create the savable values
@mbc_bbe = {}
@mbc_bbt = {}
@mbc_bbgt = 0
@mbc_bbe = 0
@mbc_bbgd = 20
end
end
#==============================================================================
# ** Spriteset_Battle
#------------------------------------------------------------------------------
# This class brings together battle screen sprites. It's used within
# the Scene_Battle class.
#==============================================================================
class Spriteset_Battle
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias bg_init initialize
def initialize
# Animation values
@bbg_frame = 0
@bbg_frame_num = 1
@bbg_frame_count = Graphics.frame_count
# The original call
bg_init
# If the battleback is a map
if $bbg_type == 3
# Make the battleback sprite
@battleback_sprite = Tilemap.new(@viewport1)
# Obtain the current tileset
@battleback_sprite.tileset = RPG::Cache.tileset($game_map.tileset_name)
# Obtain the current autotiles
for i in 0..6
autotile_name = $game_map.autotile_names[i]
@battleback_sprite.autotiles[i] = RPG::Cache.autotile(autotile_name)
end
# Set the battleback based on the current map
@battleback_sprite.map_data = $game_map.data
@battleback_sprite.ox = $game_map.display_x / 4
@battleback_sprite.oy = $game_map.display_y / 4
# Frame update
update
end
end
#--------------------------------------------------------------------------
# * Dispose (Cannot alias. No SDK Spriteset_Battle dispose method)
#--------------------------------------------------------------------------
def dispose
# If the battleback is a map...
if $bbg_type == 3
# If battleback tileset exists, dispose of it
if @battleback_sprite.tileset != nil
@battleback_sprite.tileset.dispose
end
# If battleback_autotiles exist, dispose of them
for i in 0..6
if @battleback_sprite.autotiles[i] != nil
@battleback_sprite.autotiles[i].dispose
end
end
# Otherwise, if the battleback is a bitmap
else
# NOTE: Since it is not created when calling a
# map battleback, this would have caused
# an undefined.bitmap error.
# If battleback bit map exists, dispose of it
if @battleback_sprite.bitmap != nil
@battleback_sprite.bitmap.dispose
end
end
# Dispose of battleback sprite
@battleback_sprite.dispose
# Dispose of enemy sprites and actor sprites
for sprite in @enemy_sprites + @actor_sprites
sprite.dispose
end
# Dispose of weather
@weather.dispose
# Dispose of picture sprites
for sprite in @picture_sprites
sprite.dispose
end
# Dispose of timer sprite
@timer_sprite.dispose
# Dispose of viewports
@viewport1.dispose
@viewport2.dispose
@viewport3.dispose
@viewport4.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
alias bg_update update
def update
# Unless a camera_drive system is turned on
unless $camera_drive
# Unless using a Field Map background
unless $bbg_type == 3
# If battleback file name is different from current one
if @battleback_name != $game_temp.battleback_name
@battleback_name = $game_temp.battleback_name
# Obtain Battleback animation frames (if any)
@bbg_frame_num = @battleback_name[@battleback_name.size-2].chr
@bbg_frame_num = (0..9).include?(@bbg_frame_num.to_i) ? @bbg_frame_num.to_i : 1
if @battleback_sprite.bitmap != nil
@battleback_sprite.bitmap.dispose
end
@battleback_sprite.bitmap = RPG::Cache.battleback(@battleback_name)
@battleback_sprite.src_rect.set(0, 0, 640, 320)
end
end
end
# Original call
bg_update
# Unless a camera_drive system is turned on
unless $camera_drive
# Unless using a Field Map background
unless $bbg_type == 3
# Perform animation
if @bbg_frame_num > @bbg_frame and Graphics.frame_count - @bbg_frame_count > $bbg_delay
@bbg_frame += 1
@bbg_frame %= @bbg_frame_num
@battleback_name[@battleback_name.size-1] = @bbg_frame.to_s
# Background skip switch
b_skip = false
# Error checking. Makes sure that the current background is available.
# If it is missing, then the system will skip loading.
begin
@trd = RPG::Cache.battleback(@battleback_name)
rescue Errno::ENOENT
# Background file is invalid (don't use any)
b_skip = true
end
# Only load if the Background Skip switch is false
@battleback_sprite.bitmap = RPG::Cache.battleback(@battleback_name) unless b_skip
@bbg_frame_count = Graphics.frame_count
end
end
end
end
end
#==============================================================================
# ** Scene_Save
#------------------------------------------------------------------------------
# This class performs save screen processing.
#==============================================================================
class Scene_Save < Scene_File
#--------------------------------------------------------------------------
# * Write Save Data
# file : write file object (opened)
#--------------------------------------------------------------------------
alias mmbbc_wsd write_save_data
def write_save_data(file)
# Store the globals
$game_system.mbc_bbe = $bback_event
$game_system.mbc_bbt = $bback_terrain
$game_system.mbc_bbgt = $bbg_type
$game_system.mbc_bbe = $bbg_event
$game_system.mbc_bbgd = $bbg_delay
$game_system.mbc_cam = $camera_drive
# Perform the original call
mmbbc_wsd(file)
end
end
#==============================================================================
# ** Scene_Load
#------------------------------------------------------------------------------
# This class performs load screen processing.
#==============================================================================
class Scene_Load < Scene_File
#--------------------------------------------------------------------------
# * Read Save Data
# file : file object for reading (opened)
#--------------------------------------------------------------------------
alias mmbbc_rsd read_save_data
def read_save_data(file)
#Perform the original call
mmbbc_rsd(file)
# ReStore the globals
$music_event = $game_system.mbc_bbe
$music_actor = $game_system.mbc_bba
$bbg_type = $game_system.mbc_bbgt
$bbg_event = $game_system.mbc_bbe
$bbg_delay = $game_system.mbc_bbgd
$camera_drive = $game_system.mbc_cam
end
end
#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
# This class performs battle screen processing.
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
alias bg_main main
def main
# Store the background just in case
@bbg = $game_map.battleback_name
# Branch based on what type of battle background condition we're using.
case $bbg_type
when 0 # Default (normal default settings)
$game_map.battleback_name = @bbg
when 1 # Terrain Tag based
ttag = $game_map.terrain_tag($game_player.x,$game_player.y)
$game_map.battleback_name = $bback_terrain[ttag] if $bback_terrain.include?(ttag)
when 2 # Entered ID based
$game_map.battleback_name = $bback_event[$bbg_event] if $bback_event.include?($bbg_event)
end
# Error checking. Makes sure that what is chosen is a valid battleback file.
# If not, then the system restores the default backgound file in it's place.
begin
@trd = RPG::Cache.battleback($game_map.battleback_name)
rescue Errno::ENOENT
# Background file is invalid (restore default)
$game_map.battleback_name = @bbg
end
# Error checking. Makes sure that even the default background is available.
# If it is missing, then the system will set the battleback to >none<.
begin
@trd = RPG::Cache.battleback($game_map.battleback_name)
rescue Errno::ENOENT
# Background file is invalid (don't use any)
$game_map.battleback_name = ""
end
# Now, perform the ORIGINAL battle call
bg_main
# And Return the original battleback to the default
$game_map.battleback_name = @bbg
end
end
Wow I've had that problem for 3 days And couldnt figure it.
So i totally judt deconstructed my game and it's scripts from the top down.
AND I FOUND MY PROBLEM!! Woohoo!!
Battle Report v 1.6 by Illustrationism
That I'm a novice who spent AGES playing with M'sBB and it was just that Battle Report v 1.6 isn't compatible.
So if you put out updated versions of your EXCELLENT demos (and thank you again) please remove Battle Report!
BTW if you put Battle Report RIGHT at the bottom of your scripts, then the error message comes up as relating to Battle Report.
Jsut incase someone wants to 'solve' the problem rather just dumping Battle Report.