[Hướng Dẫn] [VXA] Làm thế nào để BGM của map vẫn giữ nguyên khi vào đánh quái

加藤悦男加藤悦男 Posts: 99Registered
Hôm bữa em thử nhưng không làm được, ai giúp em với ;;w;;

Comments

  • 0no012340no01234 Posts: 326Registered
    Xem thử script này
    #===================================
    #  Leon's battle BGM Fix
    #----------------------------------------------------------------------
    #  Feature:
    #    You can turn off the battle music for battles, and let the
    #    bgm play through.  It will only be interupted by the music
    #    effect of battle, then the music fades back in.
    #
    #  Instructions:
    #    Place after Scene_Debug, but before Main
    #    set SWITCH_TO_BYPASS equal to the switch that needs
    #    to be on for this to work.  So, if SWITCH_TO_BYPASS equalled 1,
    #    and switch 1 is on, the BGM plays through battle.  When switch
    #    1 is off, it will turn on the battle background music.
    #===================================
    
    class Scene_Map
     alias leon_bgmfix_scenemap_callbattle call_battle
     SWITCH_TO_BYPASS = 12
    
     def call_battle
       $game_temp.battle_calling = false
       $game_temp.menu_calling = false
       $game_temp.menu_beep = false
       $game_player.make_encounter_count
       $game_temp.map_bgm = $game_system.playing_bgm
       $game_system.se_play($data_system.battle_start_se)
       unless $game_switches[SWITCH_TO_BYPASS] == true
         $game_system.bgm_stop
         $game_system.bgm_play($game_system.battle_bgm)
       end
       $game_player.straighten
       $scene = Scene_Battle.new
     end
    end
    
  • 加藤悦男加藤悦男 Posts: 99Registered
    0no01234 wrote:
    Xem thử script này
    #===================================
    #  Leon's battle BGM Fix
    #----------------------------------------------------------------------
    #  Feature:
    #    You can turn off the battle music for battles, and let the
    #    bgm play through.  It will only be interupted by the music
    #    effect of battle, then the music fades back in.
    #
    #  Instructions:
    #    Place after Scene_Debug, but before Main
    #    set SWITCH_TO_BYPASS equal to the switch that needs
    #    to be on for this to work.  So, if SWITCH_TO_BYPASS equalled 1,
    #    and switch 1 is on, the BGM plays through battle.  When switch
    #    1 is off, it will turn on the battle background music.
    #===================================
    
    class Scene_Map
     alias leon_bgmfix_scenemap_callbattle call_battle
     SWITCH_TO_BYPASS = 12
    
     def call_battle
       $game_temp.battle_calling = false
       $game_temp.menu_calling = false
       $game_temp.menu_beep = false
       $game_player.make_encounter_count
       $game_temp.map_bgm = $game_system.playing_bgm
       $game_system.se_play($data_system.battle_start_se)
       unless $game_switches[SWITCH_TO_BYPASS] == true
         $game_system.bgm_stop
         $game_system.bgm_play($game_system.battle_bgm)
       end
       $game_player.straighten
       $scene = Scene_Battle.new
     end
    end
    

    Cái này có cần lệnh gọi script không ạ? ;;w;;
  • 0no012340no01234 Posts: 326Registered
    0no01234 wrote:
    Xem thử script này
    #===================================
    #  Leon's battle BGM Fix
    #----------------------------------------------------------------------
    #  Feature:
    #    You can turn off the battle music for battles, and let the
    #    bgm play through.  It will only be interupted by the music
    #    effect of battle, then the music fades back in.
    #
    #  Instructions:
    #    Place after Scene_Debug, but before Main
    #    set SWITCH_TO_BYPASS equal to the switch that needs
    #    to be on for this to work.  So, if SWITCH_TO_BYPASS equalled 1,
    #    and switch 1 is on, the BGM plays through battle.  When switch
    #    1 is off, it will turn on the battle background music.
    #===================================
    
    class Scene_Map
     alias leon_bgmfix_scenemap_callbattle call_battle
     SWITCH_TO_BYPASS = 12
    
     def call_battle
       $game_temp.battle_calling = false
       $game_temp.menu_calling = false
       $game_temp.menu_beep = false
       $game_player.make_encounter_count
       $game_temp.map_bgm = $game_system.playing_bgm
       $game_system.se_play($data_system.battle_start_se)
       unless $game_switches[SWITCH_TO_BYPASS] == true
         $game_system.bgm_stop
         $game_system.bgm_play($game_system.battle_bgm)
       end
       $game_player.straighten
       $scene = Scene_Battle.new
     end
    end
    

    Cái này có cần lệnh gọi script không ạ? ;;w;;

    xài switch trong script ghi hướng dẫn hết rồi mà .-.
  • 加藤悦男加藤悦男 Posts: 99Registered
    0no01234 wrote:

    Cái này có cần lệnh gọi script không ạ? ;;w;;

    xài switch trong script ghi hướng dẫn hết rồi mà .-.

    HÌnh như có gì không ổn ạ ;;w;;
    v12i8
  • 0no012340no01234 Posts: 326Registered
    bác thử thêm cả script này vào,để trên Main, trước script Leon's Battle BGM Fix. Đây là fix của Shaz
    class Game_System
     alias preserve_bgm_bgm_play bgm_play
     def bgm_play(bgm)
       preserve_bgm_bgm_play if !$game_switches[15] # <<<<<<<<<<<<<<<<<<<< PUT YOUR SWITCH NUMBER HERE
     end
    end
    
    class Scene_Map
     def call_battle
       # Clear battle calling flag
       $game_temp.battle_calling = false
       # Clear menu calling flag
       $game_temp.menu_calling = false
       $game_temp.menu_beep = false
       # Make encounter count
       $game_player.make_encounter_count
       # Change bgm if preserve switch is off
       if !$game_switches[15]  # <<<<<<<<<<<<<<<<<<<<<<<<<<< PUT YOUR SWITCH NUMBER HERE
         # Memorize map BGM and stop BGM
         $game_temp.map_bgm = $game_system.playing_bgm
         $game_system.bgm_stop
         # Play battle BGM
         $game_system.bgm_play($game_system.battle_bgm)
       end
       # Play battle start SE
       $game_system.se_play($data_system.battle_start_se)
       # Straighten player position
       $game_player.straighten
       # Switch to battle screen
       $scene = Scene_Battle.new
     end
    end
    
    Nếu như mà có script nào mà chỉnh sửa method âm thanh của game thì có thể 2 script này sẽ không hoạt động. Không được nữa thì chắc chịu :v
  • 加藤悦男加藤悦男 Posts: 99Registered
    0no01234 wrote:
    bác thử thêm cả script này vào,để trên Main, trước script Leon's Battle BGM Fix. Đây là fix của Shaz
    class Game_System
     alias preserve_bgm_bgm_play bgm_play
     def bgm_play(bgm)
       preserve_bgm_bgm_play if !$game_switches[15] # <<<<<<<<<<<<<<<<<<<< PUT YOUR SWITCH NUMBER HERE
     end
    end
    
    class Scene_Map
     def call_battle
       # Clear battle calling flag
       $game_temp.battle_calling = false
       # Clear menu calling flag
       $game_temp.menu_calling = false
       $game_temp.menu_beep = false
       # Make encounter count
       $game_player.make_encounter_count
       # Change bgm if preserve switch is off
       if !$game_switches[15]  # <<<<<<<<<<<<<<<<<<<<<<<<<<< PUT YOUR SWITCH NUMBER HERE
         # Memorize map BGM and stop BGM
         $game_temp.map_bgm = $game_system.playing_bgm
         $game_system.bgm_stop
         # Play battle BGM
         $game_system.bgm_play($game_system.battle_bgm)
       end
       # Play battle start SE
       $game_system.se_play($data_system.battle_start_se)
       # Straighten player position
       $game_player.straighten
       # Switch to battle screen
       $scene = Scene_Battle.new
     end
    end
    
    Nếu như mà có script nào mà chỉnh sửa method âm thanh của game thì có thể 2 script này sẽ không hoạt động. Không được nữa thì chắc chịu :v
    Giờ thì bị lỗi dòng thứ 2 ạ ;;w;;
  • 0no012340no01234 Posts: 326Registered
    Sorry nhé :v nãy h lấy script của XP, bảo sao ko xài đc ;v
  • 加藤悦男加藤悦男 Posts: 99Registered
    0no01234 wrote:
    Sorry nhé :v nãy h lấy script của XP, bảo sao ko xài đc ;v

    :rolleyes: :rolleyes: :rolleyes: :rolleyes: :rolleyes: :rolleyes:
  • Son Ngo HoangSon Ngo Hoang Posts: 17Registered
    Khi vào map, chỉnh field BGM và battle BGM cùng một bài là được, không cần script
  • Focker_cFocker_c Posts: 1,577Registered
    Như vậy thì sẽ bị restart BGM mỗi lần battle :) .
    Chưa triệt để, nhưng nếu chấp nhận đc như vậy thì .. fine. :3
  • Son Ngo HoangSon Ngo Hoang Posts: 17Registered
    Thực ra trong VX Ace, BGM sẽ không reset chừng nào mình chọn Stop/Replay hoặc đổi sang BGM khác (kể cả khi chỉnh volumn).
    Khi transfer nhân vật vào map,
    1229c84d12477cbd771bb090c1b71b83.png

    thì lúc vào battle, BGM vẫn chạy tiếp như thường.
  • Focker_cFocker_c Posts: 1,577Registered
    Oh, that's new for me
    So we don't need script anymore. :3
Sign In or Register to comment.