Ok, so I have the BOF battle system right? I need a script that will overlay another spirte sheet of a weapon overtop of each character depending on what weapon they have equipped. This may be hard or easy I don't really know but any help would be much appreaciated. Here's the code for the sprite part of it:
All it would require is another sprite being displayed depending on the weapon name or ID or something. I really need this so thanks if you can help.
Just in case you have no idea what I'm talking about here's a picture lol...
http://img82.imageshack.us/img82/2928/char1hg6.png[/IMG]
My original charater sprite.
http://img50.imageshack.us/img50/9617/char2ye3.png[/IMG]
The weapon sprite that I will have.
http://img299.imageshack.us/img299/2531/char3ge0.png[/IMG]
What I want the final result to look like in battle. (2 serperate pictures overlapped)
Code:
#==============================================================================
# â– Sprite_Battler
#------------------------------------------------------------------------------
#  ãƒãƒˆãƒ©ãƒ¼è¡¨ç¤ºç”¨ã®ã‚¹ãƒ—ライトã§ã™ã€‚Game_Battler クラスã®ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹ã‚’監視ã—ã€
# スプライトã®çŠ¶æ…‹ã‚’自動的ã«å¤‰åŒ–ã•ã›ã¾ã™ã€‚
#==============================================================================
class Sprite_Battler < Animated_Sprite
#--------------------------------------------------------------------------
# ◠公開インスタンス変数
#--------------------------------------------------------------------------
attr_accessor :battler # ãƒãƒˆãƒ©ãƒ¼
attr_accessor :frame_width
#--------------------------------------------------------------------------
# ◠オブジェクトåˆæœŸåŒ–
# viewport : ビューãƒãƒ¼ãƒˆ
# battler : ãƒãƒˆãƒ©ãƒ¼ (Game_Battler)
#--------------------------------------------------------------------------
def initialize(viewport, battler = nil)
super(viewport)
@battler = battler
@battler_visible = false
@dead = false
#aqui se define el tama?o por cada cuadro q hace la animacion del personaje,
#puedes apreciarlo mas claramente viendo el archivo del personaje
@frame_width, @frame_height = 160, 160
@frames = 6
@enemy_frames = 6
@enemy_poses = 5
@delay = 4
@battler.is_a?(Game_Enemy) ? enemy_pose(0) : pose(0)
end
#--------------------------------------------------------------------------
# ◠解放
#--------------------------------------------------------------------------
def dispose
if self.bitmap != nil
self.bitmap.dispose
end
super
end
#--------------------------------------------------------------------------
# - Poses para los personajes (hero)
# number : pose' number
#--------------------------------------------------------------------------
def pose(number)
case number
when 0 # Normal stance, loops
change(@frames, @delay, 0, 0, 0)
when 1 # Attack, no loop
change(@frames, @delay, 0, @frame_height, 0, true)
when 2 # Skill, loops
change(@frames, @delay, 0, @frame_height * 2)
when 3 # Hurt, loops
change(@frames, @delay, 0, @frame_height * 3)
when 4 # Defend, loops
change(@frames, @delay, 0, @frame_height * 4)
when 5 # Death, loops
change(@frames, @delay, 0, @frame_height * 5)
when 6 # Victory, loops
change(@frames, @delay, 0, @frame_height * 2)
when 7 # Walk, loops
change(@frames, @delay, 0, @frame_height * 6)
when 8 # Item, no loop
change(@frames, @delay, 0, @frame_height * 2, 0, true)
#when 9
# change(@frames, @delay, 0, @frame_height * 9)
# ...etc.
else
change(@frames, @delay, 0, 0, 0)
end
end
#--------------------------------------------------------------------------
# - Poses para los enemigos (en caso de q sea animado)
# number : pose' number
#--------------------------------------------------------------------------
def enemy_pose(number)
return unless $game_system.animated_enemy
case number
when 0 # Normal stance, loops
change(@enemy_frames, @delay, 0, 0, 0)
when 1 # Attack, no loop
change(@enemy_frames, @delay, 0, @frame_height, 0, true)
when 2 # Skill, loops
change(@enemy_frames, @delay, 0, @frame_height * 2)
when 3 # Hurt, loops
change(@enemy_frames, @delay, 0, @frame_height * 3, 0, true)
when 4
change(@enemy_frames, @delay, 0, @frame_height * 4, 0, true)
# ...etc.
else
change(@enemy_frames, @delay, 0, 0, 0)
end
end
#--------------------------------------------------------------------------
# ◠フレーム更新
#--------------------------------------------------------------------------
def update
super
# ãƒãƒˆãƒ©ãƒ¼ãŒ nil ã®å ´åˆ
if @battler == nil
self.bitmap = nil
loop_animation(nil)
return
end
# ファイルåã‹è‰²ç›¸ãŒç¾åœ¨ã®ã‚‚ã®ã¨ç•°ãªã‚‹å ´åˆ
if @battler.battler_name != @battler_name or
@battler.battler_hue != @battler_hue
# ビットマップをå–å¾—ã€è¨å®š
@battler_name = @battler.battler_name
@battler_hue = @battler.battler_hue
self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
@width = bitmap.width
@height = bitmap.height
self.ox = @frame_width / 2
self.oy = @frame_height
if @battler.is_a?(Game_Enemy) and $game_system.animated_enemy
@frame_width = self.bitmap.width / @enemy_frames
@frame_height = self.bitmap.height / @enemy_poses
self.ox = @frame_width / 2
self.oy = @frame_height
enemy_pose(0)
elsif @battler.is_a?(Game_Enemy)
@frame_width, @frame_height = bitmap.width, bitmap.height
change
self.ox = @width / 2
self.oy = @height
end
# 戦闘ä¸èƒ½ã¾ãŸã¯éš れ状態ãªã‚‰ä¸é€æ˜Žåº¦ã‚’ 0 ã«ã™ã‚‹
if @battler.dead? or @battler.hidden
self.opacity = 0
end
self.x = @battler.screen_x
self.y = @battler.screen_y
self.z = @battler.screen_z
end
# アニメーション ID ãŒç¾åœ¨ã®ã‚‚ã®ã¨ç•°ãªã‚‹å ´åˆ
if @battler.damage == nil and
@battler.state_animation_id != @state_animation_id
@state_animation_id = @battler.state_animation_id
loop_animation($data_animations[@state_animation_id])
end
# 表示ã•ã‚Œã‚‹ã¹ãアクターã®å ´åˆ
if @battler.is_a?(Game_Actor) and @battler_visible
# メインフェーズã§ãªã„ã¨ãã¯ä¸é€æ˜Žåº¦ã‚’やや下ã’ã‚‹
if $game_temp.battle_main_phase
self.opacity += 3 if self.opacity < 255
else
self.opacity -= 3 if self.opacity > 207
end
end
# 明滅
if @battler.blink
blink_on
else
blink_off
end
# ä¸å¯è¦–ã®å ´åˆ
unless @battler_visible
# 出ç¾
if not @battler.hidden and not @battler.dead? and
(@battler.damage == nil or @battler.damage_pop)
appear
@battler_visible = true
end
if not @battler.hidden and
(@battler.damage == nil or @battler.damage_pop) and
@battler.is_a?(Game_Actor)
appear
@battler_visible = true
end
end
# å¯è¦–ã®å ´åˆ
if @battler_visible
# 逃走
if @battler.hidden
$game_system.se_play($data_system.escape_se)
escape
@battler_visible = false
end
# 白フラッシュ
if @battler.white_flash
whiten
@battler.white_flash = false
end
# アニメーション
if @battler.animation_id != 0
animation = $data_animations[@battler.animation_id]
animation(animation, @battler.animation_hit)
@battler.animation_id = 0
end
# ダメージ
if @battler.damage_pop
damage(@battler.damage, @battler.critical)
@battler.damage = nil
@battler.critical = false
@battler.damage_pop = false
end
# コラプス
if @battler.damage == nil and @battler.dead?
if @battler.is_a?(Game_Enemy)
$game_system.se_play($data_system.enemy_collapse_se)
enemy_pose(4)
@battler_visible = false
else
$game_system.se_play($data_system.actor_collapse_se) unless @dead
@dead = true
pose(5)
end
else
@dead = false
end
end
# スプライトã®åº§æ¨™ã‚’è¨å®š
end
end
All it would require is another sprite being displayed depending on the weapon name or ID or something. I really need this so thanks if you can help.
Just in case you have no idea what I'm talking about here's a picture lol...
http://img82.imageshack.us/img82/2928/char1hg6.png[/IMG]
My original charater sprite.
http://img50.imageshack.us/img50/9617/char2ye3.png[/IMG]
The weapon sprite that I will have.
http://img299.imageshack.us/img299/2531/char3ge0.png[/IMG]
What I want the final result to look like in battle. (2 serperate pictures overlapped)