Project1
标题:
利用 RGSS3腳本 在 戰鬥中撥放音效 會不斷重複
[打印本页]
作者:
御之嵐
时间:
2012-8-10 11:01
标题:
利用 RGSS3腳本 在 戰鬥中撥放音效 會不斷重複
本帖最后由 御之嵐 于 2012-8-10 17:06 编辑
RT
這個是舊問題 已經解決
新的問題 我更新在這樓 的下面
======================================================================
這個腳本 是我在戰鬥中
如果 HP 低於50% 的話
他的立繪 會進行更換
[pre lang="ruby" line="1"]#残りHPが50%以下
if ($game_actors[1].hp < $game_actors[1].mhp / 2) && ($game_actors[1].hp > $game_actors[1].mhp / 5)
#装備とコスプレ画像の連動
if $game_actors[1].armors[0] == nil
@bust_up.contents.blt(100,60,Cache.picture("menu_06b"),Rect.new(0,0,272,416))
else
case $game_actors[1].armors[0].id
when 65
@bust_up.contents.blt(100,60,Cache.picture("menu_01b"),Rect.new(0,0,272,416))[/pre]
但是要如何 修改 才能 在更換的同時 撥放音效呢?
比如說
HP 50%以下
立繪 從完整的衣著 → 破碎的衣著
同時撥放 衣服撕裂的音效
這樣怎麼改呢?
======================================================================
新問題
依據 人物的血量
進行音效的播放 並且 更換立繪
我用的腳本在這邊
#--------------------------------------------------------------------------
# ● 更新畫面(基礎)
#--------------------------------------------------------------------------
def update_basic
super
$game_timer.update
$game_troop.update
@spriteset.update
update_info_viewport
update_message_open
@bust_up.contents.clear #表示内容のクリア
#残りHPが50%以上
if ($game_actors[1].hp >= $game_actors[1].mhp / 2)
#装備とコスプレ画像の連動
if $game_actors[1].armors[0] == nil
@bust_up.contents.blt(100,60,Cache.picture("menu_06a"),Rect.new(0,0,272,416))
else
case $game_actors[1].armors[0].id
when 65
@bust_up.contents.blt(100,60,Cache.picture("menu_01a"),Rect.new(0,0,272,416))
when 2
@bust_up.contents.blt(0,0,Cache.picture("menu_02a"),Rect.new(0,0,272,416))
when 3
@bust_up.contents.blt(0,0,Cache.picture("menu_03a"),Rect.new(0,0,272,416))
when 4
@bust_up.contents.blt(0,0,Cache.picture("menu_04a"),Rect.new(0,0,272,416))
when 5
@bust_up.contents.blt(0,0,Cache.picture("menu_05a"),Rect.new(0,0,272,416))
end
end
end
#残りHPが50%以下
if ($game_actors[1].hp < $game_actors[1].mhp / 2) && ($game_actors[1].hp > $game_actors[1].mhp / 5)
#装備とコスプレ画像の連動
if $game_actors[1].armors[0] == nil
@bust_up.contents.blt(100,60,Cache.picture("menu_06b"),Rect.new(0,0,272,416))
else
case $game_actors[1].armors[0].id
when 65
@bust_up.contents.blt(100,60,Cache.picture("menu_01b"),Rect.new(0,0,272,416))
Audio.se_play("Audio/SE/"+"biri01.wav",80,100)
Audio.se_stop
when 2
@bust_up.contents.blt(0,0,Cache.picture("menu_02b"),Rect.new(0,0,272,416))
when 3
@bust_up.contents.blt(0,0,Cache.picture("menu_03b"),Rect.new(0,0,272,416))
when 4
@bust_up.contents.blt(0,0,Cache.picture("menu_04b"),Rect.new(0,0,272,416))
when 5
@bust_up.contents.blt(0,0,Cache.picture("menu_05b"),Rect.new(0,0,272,416))
end
end
end
#残りHPが20%以上
if $game_actors[1].hp <= $game_actors[1].mhp / 5
@bust_up.contents.blt(100,60,Cache.picture("menu_06c"),Rect.new(0,0,272,416))
end
end
复制代码
可能是他不斷 的確認 血量 和 立繪
所以他會不斷地更新
如果加入
Audio.se_play("Audio/SE/"+"biri01.wav",80,100)
他會像是 當機 般的不斷撥放
而在下面 加入
Audio.se_stop
他就會斷斷續續地撥放
要怎樣修改 才能 讓他只撥放一次呢?
作者:
alann
时间:
2012-8-10 15:35
http://rpg.blue/forum.php?mod=vi ... D610%26typeid%3D610
看看这一个能帮上忙不
作者:
御之嵐
时间:
2012-8-12 01:09
上提一下
幫幫忙
要如何解決 音效重複撥放的問題
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X5.0