Hi, I have a problem whit the Yami engine battle, I try to change the battler graphics, I thake an existing battler graphic and replace it whit a largest one and when I try the game it crash whit this error:
Script 'Holders Battlers' line 368: ZeroDivisionError occured.
Error occured, check the debug console for more information
The line 368 is this:
@ch = bitmap.height / (bitmap.height / bmp.height)
Please help me, thanks :)
P.S. Sorry for my english >.<
Need help whit Yami engine battle
● ARCHIVED · READ-ONLY
-
-
Please link to the script you're using, and post a screenshot of the enemy including the notebox so that we can see what you placed as notetags to define the battlers.
-
This is the script
And this is the enemy noteboxSpoiler#==============================================================================
#
# ¥ Yami Engine Symphony - Add-on: Holder Battlers
# -- Last Updated: 2013.02.01
# -- Level: Nothing
# -- Requires: n/a
# -- Modified by Crystal Noel
#
#==============================================================================
$imported = {} if $imported.nil?
$imported["BattleSymphony-HB"] = true
$imported["BattleSymphony-HB_CE_Mod"] = true
#==============================================================================
# ¥ Updates
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 2013.02.01 - Adjust for Symphony v1.13.
# 2012.10.20 - Finished Script.
# 2012.07.01 - Started Script.
#
#==============================================================================
# ¥ Compatibility
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
# it will run with RPG Maker VX without adjusting.
# Remember to put this script under Battle Symphony.
#
#==============================================================================
#==============================================================================
# ¡ Direction - Advanced Configuration
#==============================================================================
module Direction
#--------------------------------------------------------------------------
# self.index_hb
#--------------------------------------------------------------------------
def self.index_hb(pose)
case pose
# array = [row, frames]
# frames is optional, default is 15
when :idle
array = [0, 3]
when :intro
array = [1, 3]
else; array = [0, 3]
end
return array
end
#--------------------------------------------------------------------------
# self.auto_pose_hb
#--------------------------------------------------------------------------
def self.auto_pose_hb(battler)
return :dead if battler.dead?
return :woozy if battler.hp < battler.mhp / 4
return :idle
end
end # Direction
#==============================================================================
# ¡ BattleManager
#==============================================================================
module BattleManager
#--------------------------------------------------------------------------
# alias method: process_victory
#--------------------------------------------------------------------------
class <<self; alias bes_hb_process_victory process_victory; end
def self.process_victory
$game_party.alive_members.each { |battler| battler.force_pose_hb:)victory) }
return bes_hb_process_victory
end
#--------------------------------------------------------------------------
# alias method: process_defeat
#--------------------------------------------------------------------------
class <<self; alias bes_hb_process_defeat process_defeat; end
def self.process_defeat
$game_troop.alive_members.each { |battler| battler.force_pose_hb:)victory) }
return bes_hb_process_defeat
end
end # BattleManager
#==============================================================================
# ¡ Regular Expression
#==============================================================================
module REGEXP
module SYMPHONY
HOLDERS_BATTLER = /<(?:HOLDERS_BATTLER|holders battler):[ ]*(.*)>/i
end
end
#==============================================================================
# ¡ DataManager
#==============================================================================
module DataManager
#--------------------------------------------------------------------------
# alias method: load_database
#--------------------------------------------------------------------------
class <<self; alias load_database_bes_hb load_database; end
def self.load_database
load_database_bes_hb
load_notetags_bes_hb
end
#--------------------------------------------------------------------------
# new method: load_notetags_bes_hb
#--------------------------------------------------------------------------
def self.load_notetags_bes_hb
groups = [$data_actors, $data_enemies]
groups.each { |group|
group.each { |obj|
next if obj.nil?
obj.battle_symphony_holders_battler
}
}
end
end # DataManager
#==============================================================================
# ¡ RPG::BaseItem
#==============================================================================
class RPG::BaseItem
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :holders_name
#--------------------------------------------------------------------------
# new method: battle_symphony_holders_battler
#--------------------------------------------------------------------------
def battle_symphony_holders_battler
self.note.split(/[\r\n]+/).each { |line|
case line
when REGEXP::SYMPHONY::HOLDERS_BATTLER
@holders_name = $1.to_s
end
}
end
end # RPG::BaseItem
#==============================================================================
# ¡ Game_Battler
#==============================================================================
class Game_Battler < Game_BattlerBase
#--------------------------------------------------------------------------
# new method: use_hb?
#--------------------------------------------------------------------------
def use_hb?
return true if FileTest.exists?("Graphics\\Battlers\\#{self.battler_name}[anim].png")
return true if FileTest.exists?("Graphics\\Battlers\\#{self.battler_name}.png")
return self.battler_name != "" #true if
return self.actor? ? !actor.holders_name.nil? : !enemy.holders_name.nil?
end
#--------------------------------------------------------------------------
# new method: holders_name
#--------------------------------------------------------------------------
def holders_name
self.battler_name #self.actor? ? actor.holders_name : enemy.holders_name
end
#--------------------------------------------------------------------------
# alias method: set_default_position
#--------------------------------------------------------------------------
alias bes_hb_set_default_position set_default_position
def set_default_position
bes_hb_set_default_position
set_hb_default_position if self.use_hb?
end
#--------------------------------------------------------------------------
# new method: set_8d_default_position
#--------------------------------------------------------------------------
def set_hb_default_position
self.pose = Direction.auto_pose_hb(self)
end
#--------------------------------------------------------------------------
# alias method: break_pose
#--------------------------------------------------------------------------
alias bes_hb_break_pose break_pose
def break_pose
bes_hb_break_pose
break_pose_hb if self.use_hb?
end
#--------------------------------------------------------------------------
# new method: break_pose_hb
#--------------------------------------------------------------------------
def break_pose_hb
@pose = Direction.auto_pose_hb(self)
#---
return unless SceneManager.scene.spriteset
return unless self.sprite
@direction = SYMPHONY::View::pARTY_DIRECTION
@direction = Direction.opposite(@direction) if self.enemy?
self.sprite.mirror = [9, 6, 3].include?(@direction)
#@direction = Direction.opposite(@direction) if self.sprite.mirror
end
#--------------------------------------------------------------------------
# new method: force_pose_hb
#--------------------------------------------------------------------------
def force_pose_hb(pose)
return unless self.use_hb?
return unless self.exist?
#---
self.break_pose
self.pose = pose
@force_pose = true
end
end # Game_Battler
#==============================================================================
# ¡ Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
alias init_ce_holders initialize
def initalize(actor_id)
init_ce_holders(actor_id)
@battler_name = holders_name if holders_name
end
#--------------------------------------------------------------------------
# alias method: use_charset?
#--------------------------------------------------------------------------
alias bes_hb_use_charset? use_charset?
def use_charset?
return false if use_hb?
return bes_hb_use_charset?
end
end # Game_Actor
#==============================================================================
# ¡ Game_Enemy
#==============================================================================
class Game_Enemy < Game_Battler
alias init_ce_holders initialize
def initalize(index, enemy_id)
init_ce_holders(index, enemy_id)
@battler_name = holders_name if holders_name
end
#--------------------------------------------------------------------------
# alias method: use_charset?
#--------------------------------------------------------------------------
alias bes_hb_use_charset? use_charset?
def use_charset?
return false if use_hb?
return bes_hb_use_charset?
end
end # Game_Enemy
#==============================================================================
# ¡ Sprite_Battler
#==============================================================================
class Sprite_Battler < Sprite_Base
#--------------------------------------------------------------------------
# alias method: update_bitmap
#--------------------------------------------------------------------------
alias bes_hb_update_bitmap update_bitmap
def update_bitmap
correct_change_pose if @timer.nil?
@battler.use_hb? ? update_hbset : bes_hb_update_bitmap
end
#--------------------------------------------------------------------------
# alias method: update_origin
#--------------------------------------------------------------------------
alias bes_hb_update_origin update_origin
def update_origin
bes_hb_update_origin
update_origin_hb if @battler.use_hb?
end
#--------------------------------------------------------------------------
# new method: update_charset
#--------------------------------------------------------------------------
def update_hbset
@battler.set_default_position unless pose
#---
update_hbset_bitmap
update_src_rect
end
#--------------------------------------------------------------------------
# alias method: correct_change_pose
#--------------------------------------------------------------------------
alias bes_hb_correct_change_pose correct_change_pose
def correct_change_pose
return self.bitmap.clear if @battler.nil?
bes_hb_correct_change_pose unless @battler.use_hb?
correct_change_pose_hb if @battler.use_hb?
end
#--------------------------------------------------------------------------
# new method: correct_change_pose_hb
#--------------------------------------------------------------------------
def correct_change_pose_hb
array = Direction.index_hb(pose)
@pattern = @battler.reverse_pose ? 3 : 0
@timer = array[1].nil? ? 15 : array[1]
@last_pose = pose
@back_step = false
end
#--------------------------------------------------------------------------
# new method: update_charset_origin
#--------------------------------------------------------------------------
def update_origin_hb
if bitmap
self.ox = @cw / 2
self.oy = @ch
end
end
#--------------------------------------------------------------------------
# new method: hb_graphic_changed?
#--------------------------------------------------------------------------
def hb_graphic_changed?
self.bitmap.nil? || @character_name != @battler.battler_name
end
#--------------------------------------------------------------------------
# alias method: set_character_bitmap
#--------------------------------------------------------------------------
alias bes_hb_set_character_bitmap set_character_bitmap
def set_character_bitmap
bes_hb_set_character_bitmap unless @battler.use_hb?
return unless @battler.use_hb?
name = @battler.battler_name
hue = @battler.battler_hue
if FileTest.exists?("Graphics\\Battlers\\#{name}[anim].png")
self.bitmap = Cache.battler(name + "[anim]", hue)
else
self.bitmap = Cache.battler(name, hue)
end
bmp = Cache.battler(@battler.battler_name, @battler.battler_hue)
@cw = bitmap.width / (bitmap.width / bmp.width)
@ch = bitmap.height / (bitmap.height / bmp.height)
end
#--------------------------------------------------------------------------
# new method: update_hbset_bitmap
#--------------------------------------------------------------------------
def update_hbset_bitmap
if hb_graphic_changed?
@character_name = @battler.holders_name
set_character_bitmap
end
end
#--------------------------------------------------------------------------
# alias method: update_src_rect
#--------------------------------------------------------------------------
alias bes_hb_update_src_rect update_src_rect
def update_src_rect
bes_hb_update_src_rect unless @battler.use_hb?
return unless @battler.use_hb?
@timer -= 1
bmp = Cache.battler(@battler.battler_name, @battler.battler_hue)
frames = bitmap.width / bmp.width
if @battler.force_pose
if @timer <= 0 && @pattern < frames - 1
array = []
array = Direction.index_hb(pose)
@pattern += 1
@timer = array[1].nil? ? 15 : array[1]
elsif @pattern >= frames - 1
@battler.break_pose if @battler.pose == :intro
end
else
if @timer <= 0
@pattern += 1
@pattern = 0 if @pattern > frames - 1
@timer = Direction.index_hb(pose)[1]
end
end
#---
line_no = Direction.index_hb(pose)[0]
sx = @pattern * @cw
sy = line_no * @ch
self.src_rect.set(sx, sy, @cw, @ch)
end
end # Sprite_Battler
#==============================================================================
# ** Sprite_Battler
#------------------------------------------------------------------------------
# This sprite is used to display battlers. It observes an instance of the
# Game_Battler class and automatically changes sprite states.
#==============================================================================
class Sprite_Battler < Sprite_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias init_ce_holder_battlers initialize
def initialize(viewport, battler = nil)
init_ce_holder_battlers(viewport, battler)
if @battler && @battler.is_a?(Game_Trainer)
@battler.force_pose_hb:)intro) unless @battler.introduced
@battler.introduced = true
end
end
end
#===============================================================================
#
# END OF FILE
#
#===============================================================================

-
I asked you to link to the script, not copy it here - and that script is proof for one of the reasons why we ask for links - it does not contain the instructions how the notetags should look. That instruction is probably only on the page where you got the script.
And the notetag you're using looks wrong because it contains two data fields (Nate and Backsprite, that are two different parts because they are seperated by a space - is that correct?) - if I remember correctly, it should contain only one data object, but I can't tell without a link to the script's instruction) -
Sorry I have a little problem to unerstand >.<
I think is this
http://symphonyan.org/battle-symphony-introduction/ -
Yes, I remembrered correctly - see http://symphonyan.org/battle-symphony-introduction/symphony-download/add-on-holder-battlers/
The notetag needs to be
<holders_battler: filename>Your first mistake is to use the wrong notetag - you mispelled the notetag. That is this part:
Code:Your second mistake is that it requires only the single filename as a data part, but you gave two parts.If your battler's filename contains spaces, then RENAME it - the filename used MUST NOT contain spaces<holders_battler: <== Correct spelling<holders battler: <== Wrong spelling
You can use a filename like "NateBacksprite" OR a filename like "Nate_Backsprite", but you CANNOT use a filename like "Nate Backsprite".
In programming, coding and scripting the exact spelling is the most important part - you cannot guess or use random letters if you want everything to work correctly, and that goes especially for adding or missing spaces in the commands... -
Thanks for the answer, but the problem isn't for nate, is for the player's pokemon, i try to change the graphic size but maybe it's controlled by another script...serching I found viewports for the battle sprites, I think they are the problem, is it possible?
-
Then you should have given the screenshot of that pokemon.Thanks for the answer, but the problem isn't for nate, is for the player's pokemon,
Holder's battler NEEDS the correct notetag, and if you used the wrong notetag for Nate, then you'll probably have used the wrong notetag for the pokeman that gives the error as well. -
@Chiara90 Symphony is a very complex battle system and can require a lot of customization. Did you read all the instruction Yami gave for the scripts?
I see you only have four posts. You may want to start with an easier battle system.
Now for the Knowledge. You will need to read...
Tutorial - Guide to Yami's Symphony
http://forums.rpgmakerweb.com/index.php?/topic/19884-a-guide-to-yamis-battle-symphony/
Holders Battlers Page
http://symphonyan.org/battle-symphony-introduction/symphony-download/add-on-holder-battlers/
Yami World Page
http://yamiworld.wordpress.com/2012/08/01/battle-symphony-8d-battlers/
Did you check the debug console for more information as the error message said??
What did it say?
Also you said something about them the pokemon? Tell me you have the pokemon in Holder's Battler's Style? because the are arranged in a different pattern that both 8d and the RTP character formats.
Holder's Battler's Sheet Information
http://animatedbattlers.wordpress.com/animated-battler-sheet-information/