OX論壇
Would you like to react to this message? Create an account in a few clicks or log in to continue.

戰鬥動畫左右翻轉

2 posters

向下

戰鬥動畫左右翻轉 Empty 戰鬥動畫左右翻轉

發表  雪精靈 周五 12月 12, 2008 5:33 pm

因為2K3的戰鬥畫面是分左右兩邊,所以同樣的技能當對手在使用的時候會自動反轉
但是XP因為內建是上下,所以用腳本把主角圖移到畫面右邊的時候,對手發動技能就會出現很豪洨的畫面...
請問有沒有戰鬥動畫左右翻轉的腳本(限對手發動技能時啟動)
雪精靈
雪精靈
頭戴內褲手拿木劍的瘋癲佬
頭戴內褲手拿木劍的瘋癲佬

文章數 : 157
注冊日期 : 2008-06-24
來自 : 日北

回頂端 向下

戰鬥動畫左右翻轉 Empty 回復: 戰鬥動畫左右翻轉

發表  Q—S.T. 周五 12月 12, 2008 7:03 pm

有個很陽春的方法,
就是戰鬥動畫設定成敵方版本和我方版本, 當然技能同理
Q—S.T.
Q—S.T.
精通豆漿拳的正義漢
精通豆漿拳的正義漢

文章數 : 326
注冊日期 : 2008-04-21

回頂端 向下

戰鬥動畫左右翻轉 Empty 回復: 戰鬥動畫左右翻轉

發表  雪精靈 周六 12月 13, 2008 6:53 pm

是可以啦....只是這樣資料庫鐵定不夠...
順便問一下資料庫突破999的腳本好了
雪精靈
雪精靈
頭戴內褲手拿木劍的瘋癲佬
頭戴內褲手拿木劍的瘋癲佬

文章數 : 157
注冊日期 : 2008-06-24
來自 : 日北

回頂端 向下

戰鬥動畫左右翻轉 Empty 回復: 戰鬥動畫左右翻轉

發表  Q—S.T. 周三 12月 23, 2009 12:02 am

不好意思,我到今天才知道怎麼改。如果人還在的話就請看一下吧

把下面的腳本複製貼上即可
#==============================================================================
# ■ Game_Temp
#------------------------------------------------------------------------------
#  在沒有存檔的情況下,處理臨時資料的類別。
#  這個類別的實例請參考 $game_temp 。
#==============================================================================
class Game_Temp
attr_accessor :animeturn #動畫反轉標誌

#--------------------------------------------------------------------------
# ● 初始化物件
#--------------------------------------------------------------------------
alias initialize_animeturn initialize
def initialize
initialize_animeturn
@animeturn = false
end
end



#==============================================================================
# ■ Scene_Battle (分割定義 1)
#------------------------------------------------------------------------------
#  處理戰鬥畫面的類別。
#==============================================================================
class Scene_Battle
#------------------------------------------------------------------------------
# ●主處理
#------------------------------------------------------------------------------
alias main_animeturn main
def main
main_animeturn
$game_temp.animeturn = false #動畫反轉標誌關閉
end
#--------------------------------------------------------------------------
# ●更新畫面 (主回合步驟 3 : 行動方動畫)
#--------------------------------------------------------------------------
alias update_phase4_step3_animeturn update_phase4_step3
def update_phase4_step3

#如果行動者是敵人,反轉戰鬥動畫
if @active_battler.is_a?(Game_Enemy)
$game_temp.animeturn = true
else
$game_temp.animeturn = false
end
#調用原方法
update_phase4_step3_animeturn
end
#--------------------------------------------------------------------------
# ●更新畫面 (主回合步驟 6 : 更新)
#--------------------------------------------------------------------------
alias update_phase4_step6_animeturn update_phase4_step6
def update_phase4_step6
#調用原方法
update_phase4_step6_animeturn
#反轉標記為false
$game_temp.animeturn = false
end
end


#============================================================================
# ■ module RPG
#----------------------------------------------------------------------------
#  RPG模塊
#============================================================================

module RPG
class Sprite < ::Sprite
#--------------------------------------------------------------------------
# ●設定動畫圖像
#--------------------------------------------------------------------------
def animation_set_sprites(sprites, cell_data, position)
for i in 0..15
sprite = sprites[i]
pattern = cell_data[i, 0]
if sprite == nil or pattern == nil or pattern == -1
sprite.visible = false if sprite != nil
next
end
sprite.visible = true
sprite.src_rect.set(pattern % 5 * 192, pattern / 5 * 192, 192, 192)
if position == 3 #全畫面攻擊動畫位置
if self.viewport != nil
sprite.x = self.viewport.rect.width / 2
if $game_temp.in_battle and self.battler.is_a?(Game_Enemy)
sprite.y = self.viewport.rect.height - 320 #敵方動畫位置
else
sprite.y = self.viewport.rect.height - 320 #我方動畫位置
end
else
sprite.x = 320
sprite.y = 240
end
else
sprite.x = self.x + self.viewport.rect.x -
self.ox + self.src_rect.width / 2
if $game_temp.in_battle and self.battler.is_a?(Game_Enemy)
sprite.y = self.y - self.oy * self.zoom_y / 2 +
self.viewport.rect.y
if position == 0
sprite.y -= self.src_rect.height * self.zoom_y / 4
elsif position == 2
sprite.y += self.src_rect.height * self.zoom_y / 4
end
else
sprite.y = self.y + self.viewport.rect.y -
self.oy + self.src_rect.height / 2
sprite.y -= self.src_rect.height / 4 if position == 0
sprite.y += self.src_rect.height / 4 if position == 2
end
end
#如果是敵方使用戰鬥動畫,反轉位置
if $game_temp.animeturn
sprite.x -= cell_data[i, 1]
else
sprite.x += cell_data[i, 1]
end
sprite.y += cell_data[i, 2]
#非全螢幕動畫的情況下(而且是戰鬥中),動畫的Z軸等於作用對象的Z軸
if position == 3 or not $game_temp.in_battle
sprite.z = 2000
else
sprite.z = self.battler.screen_z
end
sprite.ox = 96
sprite.oy = 96
sprite.zoom_x = cell_data[i, 3] / 100.0
sprite.zoom_y = cell_data[i, 3] / 100.0
if position != 3
sprite.zoom_x *= self.zoom_x
sprite.zoom_y *= self.zoom_y
end
#如果是敵方使用戰鬥動畫,反轉動畫與角度
if $game_temp.animeturn
sprite.angle = (360 - cell_data[i, 4])
sprite.mirror = (cell_data[i, 5] == 0)
else
sprite.angle = cell_data[i, 4]
sprite.mirror = (cell_data[i, 5] == 1)
end
#如果旋轉角度為360度就設為0度以免吃資源
if sprite.angle == 360
sprite.angle = 0
end
sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
sprite.blend_type = cell_data[i, 7]
end
end
end
end

教學來源:http://windmesser.tm.land.to/rgss/rgss014.rhtml
Q—S.T.
Q—S.T.
精通豆漿拳的正義漢
精通豆漿拳的正義漢

文章數 : 326
注冊日期 : 2008-04-21

回頂端 向下

回頂端


 
這個論壇的權限:
無法 在這個版面回復文章