设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 2219|回复: 2
打印 上一主题 下一主题

[已经过期] 利用 RGSS3腳本 在 戰鬥中撥放音效 會不斷重複

[复制链接]

Lv3.寻梦者

梦石
0
星屑
2296
在线时间
611 小时
注册时间
2009-1-21
帖子
273
跳转到指定楼层
1
发表于 2012-8-10 11:01:28 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
本帖最后由 御之嵐 于 2012-8-10 17:06 编辑

RT

這個是舊問題 已經解決
新的問題  我更新在這樓 的下面


======================================================================
這個腳本 是我在戰鬥中
如果 HP 低於50% 的話
他的立繪  會進行更換

RUBY 代码复制
  1. #残りHPが50%以下
  2.     if ($game_actors[1].hp < $game_actors[1].mhp / 2) && ($game_actors[1].hp > $game_actors[1].mhp / 5)
  3.       #装備とコスプレ画像の連動
  4.       if $game_actors[1].armors[0] == nil
  5.         @bust_up.contents.blt(100,60,Cache.picture("menu_06b"),Rect.new(0,0,272,416))
  6.       else
  7.         case $game_actors[1].armors[0].id
  8.         when 65
  9.         @bust_up.contents.blt(100,60,Cache.picture("menu_01b"),Rect.new(0,0,272,416))


但是要如何 修改  才能 在更換的同時  撥放音效呢?

比如說
HP 50%以下
立繪 從完整的衣著 → 破碎的衣著
同時撥放  衣服撕裂的音效

這樣怎麼改呢?


======================================================================



新問題

依據 人物的血量
進行音效的播放 並且 更換立繪

我用的腳本在這邊
  1.   #--------------------------------------------------------------------------
  2.   # ● 更新畫面(基礎)
  3.   #--------------------------------------------------------------------------
  4.   def update_basic
  5.     super
  6.     $game_timer.update
  7.     $game_troop.update
  8.     @spriteset.update
  9.     update_info_viewport
  10.     update_message_open
  11.    
  12.    
  13.     @bust_up.contents.clear #表示内容のクリア
  14.    
  15.     #残りHPが50%以上
  16.     if ($game_actors[1].hp >= $game_actors[1].mhp / 2)
  17.       #装備とコスプレ画像の連動
  18.       if $game_actors[1].armors[0] == nil
  19.         @bust_up.contents.blt(100,60,Cache.picture("menu_06a"),Rect.new(0,0,272,416))
  20.       else
  21.         case $game_actors[1].armors[0].id
  22.         when 65
  23.         @bust_up.contents.blt(100,60,Cache.picture("menu_01a"),Rect.new(0,0,272,416))
  24.         when 2
  25.         @bust_up.contents.blt(0,0,Cache.picture("menu_02a"),Rect.new(0,0,272,416))
  26.         when 3
  27.         @bust_up.contents.blt(0,0,Cache.picture("menu_03a"),Rect.new(0,0,272,416))
  28.         when 4
  29.         @bust_up.contents.blt(0,0,Cache.picture("menu_04a"),Rect.new(0,0,272,416))
  30.         when 5
  31.         @bust_up.contents.blt(0,0,Cache.picture("menu_05a"),Rect.new(0,0,272,416))
  32.         end
  33.       end
  34.     end
  35.    
  36.     #残りHPが50%以下
  37.     if ($game_actors[1].hp < $game_actors[1].mhp / 2) && ($game_actors[1].hp > $game_actors[1].mhp / 5)
  38.       #装備とコスプレ画像の連動
  39.       if $game_actors[1].armors[0] == nil
  40.         @bust_up.contents.blt(100,60,Cache.picture("menu_06b"),Rect.new(0,0,272,416))
  41.       else
  42.         case $game_actors[1].armors[0].id
  43.         when 65
  44.         @bust_up.contents.blt(100,60,Cache.picture("menu_01b"),Rect.new(0,0,272,416))
  45.         Audio.se_play("Audio/SE/"+"biri01.wav",80,100)
  46.         Audio.se_stop
  47.         when 2
  48.         @bust_up.contents.blt(0,0,Cache.picture("menu_02b"),Rect.new(0,0,272,416))
  49.         when 3
  50.         @bust_up.contents.blt(0,0,Cache.picture("menu_03b"),Rect.new(0,0,272,416))
  51.         when 4
  52.         @bust_up.contents.blt(0,0,Cache.picture("menu_04b"),Rect.new(0,0,272,416))
  53.         when 5
  54.         @bust_up.contents.blt(0,0,Cache.picture("menu_05b"),Rect.new(0,0,272,416))
  55.         end
  56.       end
  57.     end
  58.    
  59.     #残りHPが20%以上
  60.     if $game_actors[1].hp <= $game_actors[1].mhp / 5
  61.       @bust_up.contents.blt(100,60,Cache.picture("menu_06c"),Rect.new(0,0,272,416))
  62.     end
  63.    
  64.    
  65.   end
复制代码
可能是他不斷 的確認 血量  和 立繪
所以他會不斷地更新

如果加入
Audio.se_play("Audio/SE/"+"biri01.wav",80,100)
他會像是  當機 般的不斷撥放

而在下面 加入
Audio.se_stop

他就會斷斷續續地撥放
要怎樣修改  才能 讓他只撥放一次呢?

Lv1.梦旅人

梦石
0
星屑
68
在线时间
931 小时
注册时间
2009-5-25
帖子
430

开拓者

2
发表于 2012-8-10 15:35:47 | 只看该作者

点评

其中的 一句 語句 有幫上忙 謝謝,只不過現在有新的問題了  发表于 2012-8-10 16:56
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
2296
在线时间
611 小时
注册时间
2009-1-21
帖子
273
3
 楼主| 发表于 2012-8-12 01:09:04 | 只看该作者
上提一下

幫幫忙
要如何解決 音效重複撥放的問題
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-5-2 23:38

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表