IPB

Welcome Guest ( Log In | Register )

> Viewing tutorial/script: Optional Battle Music
Options V
Description: 1 Script
Script Name:Optional Battle Music
Author:Sandgolem
Version:2
Number Of Scripts:1
Description:No Description
Screenshots:None

Instructions:For best results place somewhere under Scene_Debug, the SDK & any audio system rewrites if you're using them. This RMXP script aliases the following:
Game_System bgm_play
Game_System bgm_stop
Scene_Map call_battle


Frequently Asked Questions:None

Script:
CODE
#==========================================================================
# ** SG Optional Battle Music
#==========================================================================
# by sandgolem
# Version 2
# January 15th, 2008
#==========================================================================

module SG
  OptBatMusicSwitch = 1
end

#==========================================================================

if Object.const_defined?('SDK')
  SDK.log('SG Optional Battle Music', 'sandgolem', 2, '15.01.08')
  @sg_nobattlebgm_disabled = true if !SDK.enabled?('SG Optional Battle Music')
end

if !@sg_nobattlebgm_disabled
#--------------------------------------------------------------------------

class Game_System
  alias_method :sg_optionalbatbgm_play, :bgm_play
  def bgm_play(bgm)
    sg_optionalbatbgm_play(bgm) if !$sg_temporary_keepmusic
  end
  
  alias_method :sg_optionalbatbgm_stop, :bgm_stop
  def bgm_stop
    sg_optionalbatbgm_stop if !$sg_temporary_keepmusic
  end
end

class Scene_Map
  alias_method :sg_optionalbatbgm_callbattle, :call_battle
  def call_battle
    $sg_temporary_keepmusic = true if $game_switches[SG::OptBatMusicSwitch]
    sg_optionalbatbgm_callbattle
    $sg_temporary_keepmusic = nil
  end
end

$sg_temporary_keepmusic = nil

#--------------------------------------------------------------------------
end
« View Previous Tutorial/Script · View Next Tutorial/Script »

Category jump:

Collapse

> Tutorials/Scripts System Statistics

2 user(s) active in the Tutorials/Scripts System
Active Users 2 guest(s), 0 member(s) 0 anonymous member(s)
Tutorials/Scripts System Statistics
Board Stats Tutorials/Scripts: 143
Categories: 19
Views: 113,726

(FSY23) Tutorials v2.1 © 2010 by Michael McCune
Lo-Fi Version Time is now: 12th June 2010 - 06:55 AM
Privacy Policy