Jump to content
Xcheater

Unchange Map to Battle BGM [Update 1/17/2012]

Recommended Posts

Unchange Map to Battle BGM

made by chicheater (a.k.a Xcheater)

 

Introduction:

Hey there everyone, I bring today an epic script: Unchange Map to Battle BGM.

 

Description:

For those who don´t understand or who don´t know want this script does here it goes...

 

When your in a cutscene and then u change to a battle but you dont want to change the BGM,

or even in a sequence of battles that you don´t want the BGM to stop (the victory SE doesn't play)

 

Well you can do it with this new script.

 

Updates:

[1/17/2012 5:45 PM] Saving problem resolved

 

Instructions:

 

REMEMBER -- Paste this code above Main

 

To activate the script use this:

$game_system.map_bgm_continue = true

 

To determinate if the battle final ME will be played use this:

$game_system.last_battle = true

 

To stop this script in battle use this:

$game_system.stop_bgm_unchange = true

 

To deactivate the script out of a battle use this:

$game_system.map_bgm_continue = false

 

Script:

 

 



=begin
				   Unchange Map to Battle BGM
													made by: Chicheater

													version : 1.2

	  #--------------------Instructions--------------------#

 To activate the script use this:
   $game_system.map_bgm_continue = true

 To determinate if the battle final ME will be played use this:
   $game_system.last_battle = true

 To stop this script in battle use this:
   $game_system.stop_bgm_unchange = true

 To deactivate the script out of a battle use this:
   $game_system.map_bgm_continue = false

=end

class Game_System
 attr_accessor :map_bgm_continue
 attr_accessor :last_battle
 attr_accessor :stop_bgm_unchange
 alias chicheater0001_initialize initialize
 def initialize
chicheater0001_initialize
@map_bgm_continue = false
@last_battle = false
@stop_bgm_unchange = false
 end
end


class Scene_Map < Scene_Base
 def pre_battle_scene
Graphics.update
Graphics.freeze
@spriteset.dispose_characters
if $game_system.map_bgm_continue == false
  BattleManager.save_bgm_and_bgs
  BattleManager.play_battle_bgm
  Sound.play_battle_start
end
 end
end

module BattleManager

 def self.save_bgm_and_bgs
@map_bgm = RPG::BGM.last
@map_bgs = RPG::BGS.last
 end

 def self.play_battle_bgm
$game_system.battle_bgm.play
RPG::BGS.stop
 end

 def self.play_battle_end_me
if $game_system.map_bgm_continue
  if $game_system.last_battle
	$game_system.battle_end_me.play
  end
else
  $game_system.battle_end_me.play
end
 end

 def self.replay_bgm_and_bgs
if $game_system.map_bgm_continue == false
  @map_bgm.replay unless $BTEST
  @map_bgs.replay unless $BTEST
end
if $game_system.stop_bgm_unchange
  $game_system.map_bgm_continue = false
end
 end
end

 

 

Edited by Xcheater (aka Chicheater)
  • Like 1

Share this post


Link to post
Share on other sites

There is a problem with you script: the settings ins't carried over the save file.

 

i don't get why you did a whole class and a new global variable for that:

class UnchangeBGM
 attr_accessor :map_bgm_continue
 attr_accessor :last_battle
 attr_accessor :stop_bgm_unchange
 def initialize
       @map_bgm_continue = false
       @last_battle = false
       @stop_bgm_unchange = false
 end
end
$unchange_bgm = UnchangeBGM.new

You can use Game_Temp (for temporary info) or Game_System (for system info, that will be carried on saves)

in you case you can add the new variables on game_system and call $game_system.you_new_variable.

Share this post


Link to post
Share on other sites

i know that it doesnt save; if i wanted it to save i'd make it to save...

are you having any problem with the script?

it doesn't work or something?

Edited by Xcheater (aka Chicheater)

Share this post


Link to post
Share on other sites

Xcheater, if you don't save the variables, then say the maker changes the map bgm into battle variable to true for the upcoming boss. Then, the player saves right after ward, and shuts down. Then, upon reload, that variable is created as false, thus ruining the effect ingame when the player goes to fight said boss.

 

So yes, you do need to save the info, and yes, it does not work 100% like you hoped :P. I'd suggest using $game_system like Victor suggested.

Edited by FenixFyreX

Share this post


Link to post
Share on other sites

Regardless of the saving thing, you just made my day, man. This is exactly what I need! I was getting worried that no one was understanding my request or had no interest in fulfilling it!

Share this post


Link to post
Share on other sites

this script its to use IN THE MOMENT like: u run this code and then comes a battle like a cutscene; unnabiliting the player to save during this . . .

but ok i'll make it in game system as u ask

 

 

 

 

Xcheater, if you don't save the variables, then say the maker changes the map bgm into battle variable to true for the upcoming boss. Then, the player saves right after ward, and shuts down. Then, upon reload, that variable is created as false, thus ruining the effect ingame when the player goes to fight said boss.

 

So yes, you do need to save the info, and yes, it does not work 100% like you hoped :P. I'd suggest using $game_system like Victor suggested.

 

why it doesent work 100%? what's missing? (unless of the saving thing)

 

[EDIT] Script updated

Edited by Xcheater (aka Chicheater)

Share this post


Link to post
Share on other sites

I didn't really get why you were so reluctant to make such a simple edit that would only bring advantage for you script.

 

At last it's good for the users that you changed your mind.

Share this post


Link to post
Share on other sites

Heya, just checking if the transition sound is intentionally disabled? I'd like the option of always having the transition sound, but also always leaving your script on so that battle BGM doesn't come on and instead the regular BGM keeps playing. Is that possible?

Share this post


Link to post
Share on other sites

I had no problem achieving this script's exact effect with no scripting whatsoever. You can do all of this stuff by default.

 

I'm sure some will find it easier to just do a script call, though.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted