I'm using this script:
KGC Multi Hit
For some reason, when I've got it loaded into my game, the battle messages flow far more quickly than normal. Things like "Defend" stay on screen for about half the time they usually would. I'm guessing it is to do with the way that the script handles the multiple hits, and while it isn't that big a deal, I can see it hurting playability a little if you can't tell what an enemy is doing (or, say, read what item is stolen) before the system whisks it away again.
Any advice on how to fix this? If necessary, I'll just extend the wait command that must already be there on the battle dialogues in the scripts, if someone can point me to the lines of code I'd need to play about with to adjust that. I'd rather fix the script itself, but I'll take whatever I can.
KGC Multi Hit
Code:
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/ ◆ 多段攻撃 - KGC_MultiAttack ◆
#_/----------------------------------------------------------------------------
#_/ 複数回効果をé©ç”¨ã™ã‚‹è¡Œå‹•ã‚’作æˆã—ã¾ã™ã€‚
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#==============================================================================
# ★ ã‚«ã‚¹ã‚¿ãƒžã‚¤ã‚ºé …ç›® ★
#==============================================================================
module KGC
# ◆攻撃判定用SEファイルå
# (大文å—・å°æ–‡å—ã¯å•ã‚ãªã„。拡張åä¸è¦)
MATK_HIT_SE = "_multi_attack"
# ◆多段攻撃時ã€1Hitã”ã¨ã«ã‚¹ãƒ†ãƒ¼ã‚¿ã‚¹ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã‚’å†æç”»
# (無駄ã«é‡ã„ã®ã§ã€é«˜é€ŸåŒ–ACB以外ã§ã¯ä½¿ç”¨ã—ãªã„æ–¹ãŒç„¡é›£)
MATK_HIT_REFRESH = false
# â—†åˆè¨ˆãƒ€ãƒ¡ãƒ¼ã‚¸è¡¨ç¤º
# åˆè¨ˆãƒ€ãƒ¡ãƒ¼ã‚¸ã‚’é€æ¬¡è¡¨ç¤ºã€‚
MATK_SHOW_TOTAL_DMG = true
# â—†å‰ã®ãƒ€ãƒ¡ãƒ¼ã‚¸è¡¨ç¤ºã‚’消去
# å‰å›žã®ãƒ€ãƒ¡ãƒ¼ã‚¸ã‚’消去ã—ã¦ã‹ã‚‰æ¬¡ã®ãƒ€ãƒ¡ãƒ¼ã‚¸è¡¨ç¤ºã‚’出ã™ã€‚
MATK_DELETE_PREV_DMG = false
# ◆ダメージ表示をãšã‚‰ã™
# å‰å›žã®ãƒ€ãƒ¡ãƒ¼ã‚¸è¡¨ç¤ºã‹ã‚‰å°‘ã—ãšã‚ŒãŸä½ç½®ã«æ¬¡ã®ãƒ€ãƒ¡ãƒ¼ã‚¸è¡¨ç¤ºã‚’出ã™ã€‚
MATK_SHIFT_DMG_POS = true
# ◆ダメージ表示ã®ãšã‚Œã®å¤§ãã•
# æ£ã«ã™ã‚‹ã¨ä¸‹æ–¹å‘ã€è² ã«ã™ã‚‹ã¨ä¸Šæ–¹å‘ã«ãšã‚Œã‚‹ã€‚
MATK_SHIFT_DMG_POS_AMT = -4
# ◆ヒット数表示
MATK_SHOW_HIT_COUNT = true
# ◆ヒット数ã®æ›¸å¼
# ã€{n}…ヒット数】
MATK_HIT_COUNT_FORMAT = "{n}Hits"
# ◆ヒット数ã®æ–‡å—色
MATK_HIT_COUNT_COLOR = Color.new(255, 224, 160)
# ◆ヒット数ã®ãƒ•ã‚©ãƒ³ãƒˆ
MATK_HIT_COUNT_FONT_NAME = ["ï¼ï¼³ P明æœ", "Times New Roman"] # フォントå
MATK_HIT_COUNT_FONT_SIZE = 22 # サイズ
MATK_HIT_COUNT_FONT_BOLD = true # 太å—
MATK_HIT_COUNT_FONT_ITALIC = true # 斜体
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
$imported = {} if $imported == nil
$imported["MultiAttack"] = true
#==============================================================================
# â– Sprite_Battler
#==============================================================================
class Sprite_Battler < RPG::Sprite
#--------------------------------------------------------------------------
# ◠オブジェクトåˆæœŸåŒ–
#--------------------------------------------------------------------------
alias initialize_KGC_MultiAttack initialize
def initialize(viewport, battler = nil)
initialize_KGC_MultiAttack(viewport, battler)
@_damage_sprite_array = []
@_damage_duration_array = []
@_hit_count_sprite = Sprite.new(viewport)
@_hit_count_sprite.bitmap =
Bitmap.new(160, KGC::MATK_HIT_COUNT_FONT_SIZE * 3 / 2)
reset_hit_count
end
#--------------------------------------------------------------------------
# ◠解放
#--------------------------------------------------------------------------
alias dispose_KGC_MultiAttack dispose
def dispose
@_damage_sprite_array.each_index { |i| dispose_damage(i) }
@_hit_count_sprite.bitmap.dispose
@_hit_count_sprite.dispose
dispose_KGC_MultiAttack
end
#--------------------------------------------------------------------------
# ◠多段ヒット判定
#--------------------------------------------------------------------------
def multi_attack?
if @_multi_attack
@_multi_attack = false
return true
end
return false
end
#--------------------------------------------------------------------------
# â— ãƒ’ãƒƒãƒˆã‚«ã‚¦ãƒ³ãƒˆåŠ ç®—
#--------------------------------------------------------------------------
def add_hit_count
@_hit_count += 1
end
#--------------------------------------------------------------------------
# ◠ヒットカウントåˆæœŸåŒ–
#--------------------------------------------------------------------------
def reset_hit_count
@_hit_count = 0
end
#------------------------------------------------------------------------
# ◠ダメージスプライト作æˆ
#------------------------------------------------------------------------
def damage(value, critical)
@_damage_sprite_array.compact!
@_damage_duration_array.compact!
super
sprite = RPG::Sprite.new
sprite.bitmap = @_damage_sprite.bitmap.dup
sprite.ox = @_damage_sprite.ox
sprite.oy = @_damage_sprite.oy
sprite.x = @_damage_sprite.x
sprite.y = @_damage_sprite.y
if KGC::MATK_SHIFT_DMG_POS
sprite.y += @_damage_sprite_array.size * KGC::MATK_SHIFT_DMG_POS_AMT
end
sprite.z = @_damage_sprite.z
@_damage_sprite_array.unshift(sprite)
@_damage_duration_array.unshift(40)
# ヒットカウント作æˆ
if KGC::MATK_SHOW_HIT_COUNT
img = @_hit_count_sprite.bitmap
img.clear
if @_hit_count > 1
img.font.name = KGC::MATK_HIT_COUNT_FONT_NAME
img.font.size = KGC::MATK_HIT_COUNT_FONT_SIZE
img.font.bold = KGC::MATK_HIT_COUNT_FONT_BOLD
img.font.italic = KGC::MATK_HIT_COUNT_FONT_ITALIC
img.font.color = KGC::MATK_HIT_COUNT_COLOR
format = KGC::MATK_HIT_COUNT_FORMAT.gsub(/{n}/i) {"#{@_hit_count}"}
img.draw_frame_text(0, 0, sprite.bitmap.width, img.height, format, 1)
end
end
dispose_damage(-1)
end
#--------------------------------------------------------------------------
# â— ãƒ€ãƒ¡ãƒ¼ã‚¸ã‚¹ãƒ—ãƒ©ã‚¤ãƒˆç ´æ£„
#--------------------------------------------------------------------------
def dispose_damage(index = nil)
return if index == nil
if index >= 0 && @_damage_sprite_array[index] != nil
@_damage_sprite_array[index].bitmap.dispose
@_damage_sprite_array[index].dispose
@_damage_sprite_array[index] = nil
@_damage_duration_array[index] = nil
@_damage_sprite_array.compact!
@_damage_duration_array.compact!
elsif index < 0 && @_damage_sprite != nil
@_damage_sprite.bitmap.dispose
@_damage_sprite.dispose
@_damage_sprite = nil
@_damage_duration = 0
end
end
#--------------------------------------------------------------------------
# ◠ダメージスプライトクリア
#--------------------------------------------------------------------------
def clear_damage
@_damage_sprite_array.each_index { |i|
dispose_damage(i)
}
end
#--------------------------------------------------------------------------
# ◠アニメーション実行タイミング
#--------------------------------------------------------------------------
def animation_process_timing(timing, hit)
if (timing.condition == 0) || (timing.condition == 1 && hit) ||
(timing.condition == 2 && !hit)
if timing.se.name != ""
@_multi_attack |= timing.se.name.upcase == KGC::MATK_HIT_SE.upcase
end
end
super
end
#--------------------------------------------------------------------------
# ◠フレーム更新
#--------------------------------------------------------------------------
alias update_KGC_MultiAttack update
def update
@_multi_attack = false if Graphics.frame_count % 2 == 0
update_KGC_MultiAttack
if @_damage_sprite_array.size > 0
@_damage_sprite_array.each_with_index { |sp, i|
if sp == nil
next
end
if @_damage_duration_array[i] == 0
dispose_damage(i)
next
end
@_damage_duration_array[i] -= 1
sp.x = self.x
if $imported["DamageAlter"]
damage_direct(sp, @_damage_duration_array[i])
else
case @_damage_duration_array[i]
when 38..39
sp.y -= 4
when 36..37
sp.y -= 2
when 34..35
sp.y += 2
when 28..33
sp.y += 4
end
sp.opacity = 256 - (12 - @_damage_duration_array[i]) * 32
end
}
if KGC::MATK_SHOW_HIT_COUNT && @_damage_sprite_array[0] != nil
sp = @_damage_sprite_array[0]
sp2 = @_hit_count_sprite
sp2.ox = sp.ox
sp2.oy = sp.oy
sp2.x = sp.x
sp2.y = sp.y + 48
sp2.z = sp.z
sp2.opacity = sp.opacity
end
end
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# â– Spriteset_Battle
#==============================================================================
class Spriteset_Battle
#--------------------------------------------------------------------------
# ◠スプライトå–å¾—
#--------------------------------------------------------------------------
def sprites
return @enemy_sprites + @actor_sprites
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■Scene_Battle (分割定義 1)
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# ◠フレーム更新
#--------------------------------------------------------------------------
alias update_KGC_MultiAttack update
def update
attacker = ($imported["ActiveCountBattle"] ?
@action_battler : @active_battler)
if @phase4_step == 5 && @target_battlers != [] && attacker != nil
# ステータスウィンドウå†æç”»
@status_window.refresh if KGC::MATK_HIT_REFRESH
@spriteset.sprites.each { |sp|
# 多段ヒット判定
unless sp.multi_attack? && @target_battlers.include?(sp.battler)
next
end
if KGC::MATK_DELETE_PREV_DMG
sp.clear_damage
end
if KGC::MATK_SHOW_TOTAL_DMG # åˆè¨ˆã‚’表示
if @_matk_total_damage[sp.battler] == nil
@_matk_total_damage[sp.battler] = 0
end
if sp.battler.damage.is_a?(Numeric)
@_matk_total_damage[sp.battler] += sp.battler.damage
if KGC::MATK_SHOW_HIT_COUNT
sp.add_hit_count
end
end
sp.damage(@_matk_total_damage[sp.battler], sp.battler.critical)
else # é€æ¬¡è¡¨ç¤º
sp.damage(sp.battler.damage, sp.battler.critical)
end
# 効果を追åŠ
case attacker.current_action.kind
when 0
if attacker.current_action.basic == 0
sp.battler.attack_effect(attacker)
end
when 1
skill = $data_skills[attacker.current_action.skill_id]
sp.battler.skill_effect(attacker, skill)
when 2
item = $data_skills[attacker.current_action.item_id]
sp.battler.item_effect(item)
end
}
end
update_KGC_MultiAttack
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■Scene_Battle (分割定義 4)
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# ◠フレーム更新 (メインフェーズ ステップ 4 : 対象å´ã‚¢ãƒ‹ãƒ¡ãƒ¼ã‚·ãƒ§ãƒ³)
#--------------------------------------------------------------------------
alias update_phase4_step4_KGC_MultiAttack update_phase4_step4
def update_phase4_step4
# 多段攻撃用ã®åˆæœŸåŒ–処ç†
if @_matk_total_damage == nil
@_matk_total_damage = {}
else
@_matk_total_damage.clear
end
if KGC::MATK_SHOW_HIT_COUNT
@spriteset.sprites.each { |sp| sp.reset_hit_count }
end
update_phase4_step4_KGC_MultiAttack
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (メインフェーズ ステップ 5 : ダメージ表示)
#--------------------------------------------------------------------------
alias update_phase4_step5_KGC_MultiAttack update_phase4_step5
def update_phase4_step5
# 多段ダメージ更新処ç†
@spriteset.sprites.each { |sp|
if @target_battlers.include?(sp.battler) &&
@_matk_total_damage[sp.battler] != nil &&
sp.battler.damage.is_a?(Numeric)
if KGC::MATK_SHOW_TOTAL_DMG
sp.battler.damage = @_matk_total_damage[sp.battler] + sp.battler.damage
end
if KGC::MATK_SHOW_HIT_COUNT
sp.add_hit_count
end
end
}
update_phase4_step5_KGC_MultiAttack
end
end
For some reason, when I've got it loaded into my game, the battle messages flow far more quickly than normal. Things like "Defend" stay on screen for about half the time they usually would. I'm guessing it is to do with the way that the script handles the multiple hits, and while it isn't that big a deal, I can see it hurting playability a little if you can't tell what an enemy is doing (or, say, read what item is stolen) before the system whisks it away again.
Any advice on how to fix this? If necessary, I'll just extend the wait command that must already be there on the battle dialogues in the scripts, if someone can point me to the lines of code I'd need to play about with to adjust that. I'd rather fix the script itself, but I'll take whatever I can.