Can someone help me figure out a script call? (VX custom script)

Darth Equus

I *HATE* Parallax Mapping.
Veteran
Joined
Feb 7, 2013
Messages
254
Reaction score
415
First Language
English
Primarily Uses
RMVX
Hello. I feel this is the right section to post this in, so here's my problem:

I commissioned a script a little while ago, because I need the field music to persist playing when a battle starts, and when it ends. Think of how Aeris' theme keeps on playing before, during and after the battle with the boss Jenova Life at the Ancient Capital in FF7, or this:


I'm 120% sure it was working fine in a prior build of the game that I didn't save, and I foolishly lost the note where I wrote the script call. As a result, I'm having the problem of the music restarting at the end of the battle. Turning off the victory theme has no effect; I've also tried changing the battle BGM to match the theme, to no effect. Again, I'm sure it was all handled via a script call, and I'm not sure if I can get a hold of the scripter who made them, as he's busy with university life. Here are the scripts:

Part one (it's entered as two separate scripts):
Code:
class Game_Temp
  attr_accessor :equus_dont_stop_bgm
end
Part two:
Code:
class Scene_Map < Scene_Base
  def call_battle
    @spriteset.update
    Graphics.update
    $game_player.make_encounter_count
    $game_player.straighten
    $game_temp.map_bgm = RPG::BGM.last
    $game_temp.map_bgs = RPG::BGS.last
    unless $game_temp.equus_dont_stop_bgm
      RPG::BGM.stop
      RPG::BGS.stop
    end
    Sound.play_battle_start
    $game_system.battle_bgm.play unless $game_temp.equus_dont_stop_bgm
    $game_temp.next_scene = nil
    $scene = Scene_Battle.new
  end
end
Using the script call "$game_temp.equus_dont_stop_bgm=true" produces the results described above, so I think there must be something else that needs to be entered. If someone can please help me figure out the rest of the call (if any), let me know, and thanks in advance. Further info available if needed.

Short version: I need this script to keep on playing the field music as a battle starts, and not restart it at the end of the battle.

Thanks.
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,592
Reaction score
6,522
First Language
Indonesian
Primarily Uses
RMVXA
$game_temp doesn't get saved when you save the game. So when you call the script to change it to true, if you load the game, it will be back to nil, which is "false". Maybe you want to change it to Game_System instead.

Code:
class Game_System
  attr_accessor :equus_dont_stop_bgm
end

class Scene_Map < Scene_Base
  def call_battle
   @spriteset.update
   Graphics.update
   $game_player.make_encounter_count
   $game_player.straighten
   $game_temp.map_bgm = RPG::BGM.last
   $game_temp.map_bgs = RPG::BGS.last
   unless $game_system.equus_dont_stop_bgm
     RPG::BGM.stop
     RPG::BGS.stop
   end
   Sound.play_battle_start
   $game_system.battle_bgm.play unless $game_system.equus_dont_stop_bgm
   $game_temp.next_scene = nil
   $scene = Scene_Battle.new
  end
end
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Agree with the above.

And the script call to turn it on would be:
Code:
$game_system.equus_dont_stop_bgm = true
and the script call to turn it off would be:
Code:
$game_system.equus_dont_stop_bgm = false
 

Darth Equus

I *HATE* Parallax Mapping.
Veteran
Joined
Feb 7, 2013
Messages
254
Reaction score
415
First Language
English
Primarily Uses
RMVX
Going to try it later today. Though, the problem happened even after the event that calls the script does it right before execution. If this doesn't fix it, I'll have to make a request on the Classifieds. Thanks for both your input, will report later.
 

Darth Equus

I *HATE* Parallax Mapping.
Veteran
Joined
Feb 7, 2013
Messages
254
Reaction score
415
First Language
English
Primarily Uses
RMVX
Welp, that didn't work. I get these errors when trying the suggested solution, on a freshly started game. (Not loading a test save)

Error1.jpg


Error2.jpg

Could there be a script call not to restart the track after the battle ends? That's the problem I'm having, and I remember it was working fine before. Thanks to anyone who looked at this, regardless.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,081
Members
137,582
Latest member
Spartacraft
Top