Project1

标题: 如何用地图音乐当战斗音乐 [打印本页]

作者: quyangyang    时间: 2022-2-6 18:54
标题: 如何用地图音乐当战斗音乐
就是触发战斗后,地图音乐不停止,继续播放

我试了取消战斗音乐,结果只是没有声音

还找到一个脚本

class Scene_Map < Scene_Base
def call_battle
@spriteset.update
Graphics.update
$game_player.make_encounter_count
$game_player.straighten
Sound.play_battle_start
$game_temp.next_scene = nil
$scene = Scene_Battle.new
end
end

也只是没有声音了,并没有继续播放地图音乐
作者: alexncf125    时间: 2022-2-6 19:41
本帖最后由 alexncf125 于 2022-2-6 19:44 编辑

忠告: 若看见类似$scene = Scene_Battle.new等写著$scene的代码, 那九成不是VA能用的脚本
  1. module BattleManager
  2.   class << self
  3.     #--------------------------------------------------------------------------
  4.     # ● 播放战斗 BGM
  5.     #--------------------------------------------------------------------------
  6.     alias mapbgm_play_battle_bgm play_battle_bgm unless $@
  7.     def play_battle_bgm
  8.       return if $game_system.mapbgm == true
  9.       mapbgm_play_battle_bgm
  10.     end
  11.   end
  12. end

  13. class Game_System
  14.   #--------------------------------------------------------------------------
  15.   # ● 定义实例变量
  16.   #--------------------------------------------------------------------------
  17.   attr_accessor :mapbgm
  18.   #--------------------------------------------------------------------------
  19.   # ● 初始化对象
  20.   #--------------------------------------------------------------------------
  21.   alias mapbgm_initialize initialize
  22.   def initialize
  23.     mapbgm_initialize
  24.     @mapbgm = true
  25.   end
  26. end

  27. class Scene_Map < Scene_Base
  28.   #--------------------------------------------------------------------------
  29.   # ● 切换战斗画面前的処理
  30.   #--------------------------------------------------------------------------
  31.   alias mapbgm_pre_battle_scene pre_battle_scene
  32.   def pre_battle_scene
  33.     $game_system.mapbgm = true
  34.     mapbgm_pre_battle_scene
  35.     $game_system.mapbgm = false
  36.   end
  37. end
复制代码

作者: quyangyang    时间: 2022-2-10 22:14
alexncf125 发表于 2022-2-6 19:41
忠告: 若看见类似$scene = Scene_Battle.new等写著$scene的代码, 那九成不是VA能用的脚本
...

感谢大神,我是小白,我还想知道如何调整字体大小,是需要脚本还是改动一些内容呢?
作者: BCJT    时间: 2022-2-11 08:59
VA自带这个功能,你把战斗音乐设置成与地图同名同音调即可,只改变音量的话不影响音乐的播放,非常好。




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1