Hey there guys, I hope this is the correct section to post this, a long long time ago I downloaded a final fantasy XII style battlesystem.
and everything is perfect with one single problem...
sometimes when I defeat an enemy (most of the time a boss) the game crashes and gives me this error message:
I haven't been able to see what's causing the error, and it seems the script was dumped, so I can't really get a fixed version, here's the line that gives the error ni the script:
t.battler.skill_effect(self.battler, skill)
I'm at a loss here because I know some scripting but CBS still go way over my head
here's the complete script that gives the error message:
BTW the whole battlesystem uses many scripts more than just that one, but I don't know if I should post them ALL in here...
I hope someone can help me with this, I just want the script to stop crashing the game, that's all =P
and everything is perfect with one single problem...
sometimes when I defeat an enemy (most of the time a boss) the game crashes and gives me this error message:
I haven't been able to see what's causing the error, and it seems the script was dumped, so I can't really get a fixed version, here's the line that gives the error ni the script:
t.battler.skill_effect(self.battler, skill)
I'm at a loss here because I know some scripting but CBS still go way over my head
here's the complete script that gives the error message:
Code:
#===============================================================================
# FFXII - Game_Character - Attack
#-------------------------------------------------------------------------------
# Criador: RTH
#===============================================================================
class Game_Character
#-----------------------------------------------------------------------------
# Attaca o alvo
#-----------------------------------------------------------------------------
def attack(target)
return false unless FFXII.valid_attack?(self, target)
@animation_type = 0
target.battler.attack_effect(self.battler)
if target.enemy?
target.agressivity = 1
end
target.setup_damage
target.animation_id = @battler.animation2_id
return true
end
#-----------------------------------------------------------------------------
# Attaca o alvo
#-----------------------------------------------------------------------------
def skill(skill, target)
return false unless FFXII.valid_attack?(self, target)
return false if skill.nil?
return false if @battler.sp < skill.sp_cost
if skill.allsp?
@battler.sp = @battler.sp - @battler.maxsp
else
@battler.sp = @battler.sp - skill.sp_cost
end
if skill.quickening?
quickening(skill, target)
return
end
@animation_id = skill.animation1_id
animation = $data_animations[@animation_id]
counter_max = 1
if animation != nil
counter_max = (Graphics.frame_rate * animation.frame_max / 20.0).to_i
end
@animation_type = 1
@skill_id = skill.id
@last_skill_id = skill.id
@last_skill_target = target
@last_skill_damage_count = counter_max
if @last_skill_damage_count <= 0
skill_damage(skill, target)
end
end
def skill_damage(skill, target)
@last_skill_id = 0
@last_skill_target = nil
@last_skill_damage_count = 0
targets = [target]
if skill.raio > 0
if self.enemy?
for i in 0...FFXII::MAX_ACTORS
next if $game_party.actors[i].nil? or $game_party.actors[i].dead?
if i == $game_player.main_actor
actor = $game_player
else
actor = $game_train_actors[$game_party.actors[i].id]
end
next if actor == target
if target.inside_real_raio?(actor, skill.raio)
targets.push(actor)
end
end
else
case skill.scope
when 1..2
for event in $game_map.screen_events.values
next if event.nil? or event.battler.nil? or event.battler.dead?
next if event == target
if skill.scope == 2
targets.push(event)
next
end
if target.inside_real_raio?(event, skill.raio)
targets.push(event)
end
end
when 3..6
for i in 0...$game_pacty.actors.size
next if $game_pacty.actors[i].nil?
next unless $game_pacty.actors[i].active
next if (skill.scope <= 4 ? $game_pacty.actors[i].dead? : (!$game_pacty.actors[i].dead?))
actor = (i == $game_player.main_actor ? $game_player : $game_train_actors[$game_pacty.actors[i].id])
if [4, 6].include?(skill.scope)
targets.push($actor) unless targets.include?(actor)
next
end
if target.inside_real_raio?(actor, skill.raio)
targets.push($actor) unless targets.include?(actor)
end
end
end
end
end
$game_temp.in_battle = true
animation_2 = $data_animations[skill.animation2_id]
if animation_2.nil?
all_animation = true
elsif animation_2.position == 3
all_animation = false
else
all_animation = true
end
if all_animation == false
target.animation_id = skill.animation2_id
end
for t in targets
next if t.nil?
t.battler.skill_effect(self.battler, skill)
if t.enemy?
t.agressivity = 1
end
t.setup_damage
t.animation_id = skill.animation2_id if all_animation
end
$game_temp.in_battle = false
return true
end
#-----------------------------------------------------------------------------
# Quickening Alguem
#-----------------------------------------------------------------------------
def quickening(skill, target)
targets = [target]
if skill.raio > 0
if self.enemy?
for i in 0...FFXII::MAX_ACTORS
next if $game_party.actors[i].nil? or $game_party.actors[i].dead?
if i == $game_player.main_actor
actor = $game_player
else
actor = $game_train_actors[$game_party.actors[i].id]
end
next if actor == target
if target.inside_real_raio?(actor, skill.raio)
targets.push(actor)
end
end
else
for event in $game_map.screen_events.values
next if event.nil? or event.battler.nil? or event.battler.dead?
next if event == target
if target.inside_real_raio?(event, skill.raio)
targets.push(event)
end
end
end
end
$game_temp.quickening_player = self
$game_temp.quickening_targets = targets
$game_temp.quickening_skill_id = skill.id
end
#-----------------------------------------------------------------------------
# Usa o item no alvo
#-----------------------------------------------------------------------------
def item(item, target)
return false unless FFXII.valid_attack?(self, target)
return false if item.nil?
return false if $game_party.item_number(item.id) <= 0
$game_party.lose_item(item.id, 1)
@animation_id = item.animation1_id
animation = $data_animations[@animation_id]
if animation != nil and $scene.instance_of?(Scene_Map)
counter_max = (Graphics.frame_rate * animation.frame_max / 20.0).to_i
for i in 0...counter_max
Graphics.update
Input.update
$scene.action_update
end
end
targets = [target]
$game_temp.in_battle = true
for t in targets
next if t.nil?
t.battler.item_effect(item)
t.setup_damage
if t.enemy?
t.agressivity = 1
end
t.animation_id = item.animation2_id
end
$game_temp.in_battle = false
return true
end
#-----------------------------------------------------------------------------
# Atualiza o dano
#-----------------------------------------------------------------------------
def setup_damage
@damage = @battler.damage
@critical = @battler.critical
end
#-----------------------------------------------------------------------------
# Faz a ação
#-----------------------------------------------------------------------------
def make_action
if @target.is_a?(Game_Train_Actor)
unless $game_party.actors[$game_player.main_actor].nil?
if @target.id == $game_party.actors[$game_player.main_actor].id
self.target = $game_player
end
end
end
if @battler.attacking?
attack(@target)
self.target = nil
elsif @battler.skilling?
skill($data_skills[@battler.current_action.skill_id], @target)
self.target = nil
elsif @battler.iteming?
item($data_items[@battler.current_action.item_id], @target)
self.target = nil
end
@battler.current_action.clear
end
#-----------------------------------------------------------------------------
# Inicia o ataque
#-----------------------------------------------------------------------------
def start_attack(target)
return if @battler.nil? or target.nil? or target.battler.nil?
@battler.current_action.kind = 0
@battler.current_action.basic = 0
@battler.current_action.setup_action_speed
self.target = target
end
#-----------------------------------------------------------------------------
# Inicia a habilidade
#-----------------------------------------------------------------------------
def start_skill(skill_id, target)
return if @battler.nil? or target.nil? or target.battler.nil?
$game_temp.in_battle = true
unless @battler.skill_can_use?(skill_id)
$game_temp.in_battle = false
return
end
$game_temp.in_battle = false
@battler.current_action.kind = 1
@battler.current_action.skill_id = skill_id
@battler.current_action.basic = 0
@battler.current_action.setup_action_speed
self.target = target
end
#-----------------------------------------------------------------------------
# Inicia o Item
#-----------------------------------------------------------------------------
def start_item(item_id, target)
return if @battler.nil? or target.nil? or target.battler.nil?
@battler.current_action.kind = 2
@battler.current_action.item_id = item_id
@battler.current_action.basic = 0
@battler.current_action.setup_action_speed
self.target = target
end
#-----------------------------------------------------------------------------
# Limpa a ação
#-----------------------------------------------------------------------------
def clear_action
self.target = nil
return if @battler.nil?
@battler.current_action.clear
end
end
I hope someone can help me with this, I just want the script to stop crashing the game, that's all =P