I already posted a thread about this but it was in the wrong section. Basically enemies have slightly more [sometimes double] the HP they should have, and sometimes less.
My Timed Hit script was edited to be able to use skills in menu, but strangely that's when enemy hp issues and crashing began to occur. The crashing problem appears to have been solved though.
This is the edited script
When I start a new project, the problem script appears to be Timed_Hits 2. When that is gone, the enemy HP issue is too, but then of course the timed hits don't work.
This is the script
Also the number 0 shows up when I fix a status ailment as though they consider it an attack.
This is my last thread about this subject. Anyone see anything wrong with this script?
My Timed Hit script was edited to be able to use skills in menu, but strangely that's when enemy hp issues and crashing began to occur. The crashing problem appears to have been solved though.
This is the edited script
Code:
#==============================================================================
# ** Game_Battler
#------------------------------------------------------------------------------
# This class deals with battlers. It's used as a superclass for the Game_Actor
# and Game_Enemy classes.
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias timed_hit_attack_effect attack_effect
alias timed_hit_skill_effect skill_effect
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :timed_hit_hit_percent
attr_accessor :timed_hit_use_percent
attr_accessor :timed_hit_state_to_add
#--------------------------------------------------------------------------
# * Applying Normal Attack Effects
# attacker : battler
#--------------------------------------------------------------------------
def attack_effect(attacker)
effective = false
# If part of Timed Hits
if @timed_hit_use_percent
hp = self.hp
# Perform the original call and get effective
effective = timed_hit_attack_effect(attacker)
if self.damage != "Miss"
self.hp = hp
self.damage = Integer((@timed_hit_hit_percent * self.damage) / 100.0)
if @timed_hit_state_to_add != nil
self.add_state(@timed_hit_state_to_add)
end
end
# If not part of Timed Hits
else
# Perform the original call and get effective
effective = timed_hit_attack_effect(attacker)
end
@timed_hit_use_percent = false
@timed_hit_state_to_add = nil
return effective
end
#--------------------------------------------------------------------------
# * Apply Skill Effects
# user : the one using skills (battler)
# skill : skill
#--------------------------------------------------------------------------
def skill_effect(user, skill)
effective = false
# If part of Timed Hits
if @timed_hit_use_percent
hp = self.hp
# Perform the original call and get effective
effective = timed_hit_skill_effect(user, skill)
if self.damage != "Miss"
self.hp = hp
self.damage = ((@timed_hit_hit_percent * self.damage.to_i) / 100.0).to_i
end
# If not part of Timed Hits
else
# Perform the original call and get effective
effective = timed_hit_skill_effect(user, skill)
end
@timed_hit_use_percent = false
return effective
end
end
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
# This class handles the actor. It's used within the Game_Actors class
# ($game_actors) and refers to the Game_Party class ($game_party).
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :actor_id
end
When I start a new project, the problem script appears to be Timed_Hits 2. When that is gone, the enemy HP issue is too, but then of course the timed hits don't work.
This is the script
Code:
class Scene_Battle
alias timed_hit_start_phase4 start_phase4
def start_phase4
if $game_party.timed_hit == nil
$game_party.timed_hit= Timed_Hit.new
$game_party.timed_hit.setup
end
@timed_hit = $game_party.timed_hit
timed_hit_start_phase4
end
alias timed_hit_update_phase4_step3 update_phase4_step3
def update_phase4_step3
if @active_battler.is_a?(Game_Actor) &&
@active_battler.current_action.kind != 2 &&
@active_battler.current_action.basic != 1
#Get the active battlers id
id = @active_battler.actor_id
#If the bar exists and wait > 0
if @timed_hit_bar != nil && @timed_hit_wait > 0
#Update the bar
@timed_hit_bar.update
key = -1
#Test for a pressed button
for button in @timed_hit.key_list
if Input.trigger?(button)
key = button
break
end
end
#Test for a hit
if key > 0
if @timed_hit_bar.hit?(key)
@timed_hit_bar.update
$game_system.se_play(@timed_hit.hit_sound)
else
$game_system.se_play(@timed_hit.miss_sound)
end
end
@timed_hit_bar.percent = ((@max_wait - @timed_hit_wait) * 100) / @max_wait
@timed_hit_wait -= @timed_hit_wait_increment
return
#If there is no bar
elsif @timed_hit_bar == nil
if @active_battler.current_action.kind == 0
if @timed_hit.actor_attack_data(id) != nil && @timed_hit.actor_data(id) != nil
r_id = rand(@timed_hit.actor_data(id).size)
data = @timed_hit.actor_attack_data(@timed_hit.actor_data(id)[r_id])
timed_hit_make_bar(data)
return
end
elsif @active_battler.current_action.kind == 1
if @timed_hit.skill_data(@active_battler.current_action.skill_id) != nil
timed_hit_make_bar(@timed_hit.skill_data(@active_battler.current_action.skill_id))
return
end
end
end
end
if @active_battler.is_a?(Game_Actor)
if @timed_hit_bar != nil
damage_percent = @timed_hit_bar.damage_percent
end
if @active_battler.current_action.kind == 0 &&
@active_battler.current_action.basic != 1
for target in @target_battlers
if @timed_hit_bar != nil
target.timed_hit_hit_percent = damage_percent + 1
if @timed_hit.weapon_states(@active_battler.weapon_id) != nil
if damage_percent > @timed_hit.weapon_states(@active_battler.weapon_id)[1]
target.timed_hit_state_to_add = @timed_hit.weapon_states(@active_battler.weapon_id)[0]
end
end
target.timed_hit_use_percent = true
target.attack_effect(@active_battler)
else
target.timed_hit_hit_percent = 100
target.timed_hit_use_percent = true
target.attack_effect(@active_battler)
end
end
elsif @active_battler.current_action.kind == 1
for target in @target_battlers
if @timed_hit_bar != nil
target.timed_hit_hit_percent = damage_percent + 1
target.timed_hit_use_percent = true
target.skill_effect(@active_battler, @skill)
else
target.timed_hit_hit_percent = 100
target.timed_hit_use_percent = true
target.skill_effect(@active_battler, @skill)
end
end
end
end
if @active_battler.is_a?(Game_Actor)
if @timed_hit_bar != nil
@timed_hit_bar.dispose
@timed_hit_bar = nil
end
end
timed_hit_update_phase4_step3
end
def timed_hit_make_bar(data)
@max_wait = data[0]
@timed_hit_wait_increment = data[1]
damage_mod = data[2]
key = data[3]
target = data[4]
marker = data[5]
bar_mode = data[6]
@timed_hit_wait = @max_wait
@timed_hit_bar = Spriteset_timerbar.new(@timed_hit.bar_x, @timed_hit.bar_y, damage_mod, key, target, marker, bar_mode)
@timed_hit_bar.update
end
end
Also the number 0 shows up when I fix a status ailment as though they consider it an attack.
This is my last thread about this subject. Anyone see anything wrong with this script?