Author Topic: Help: Want BGM to continue playing after map transfer.  (Read 3131 times)

icecold49

  • Guest
Help: Want BGM to continue playing after map transfer.
« on: February 06, 2008, 01:22:39 AM »
I have a little problem regarding the BGM in RMXP. When i play a BGM, i want the song to continue playing (without it going back to start of song) when i transfer from one map to another. I know you can do this if both maps' auto-BGMs are set to the same song but i want the BGM to continue playing after triggering the BGM with an event. If there is anything that I can do to change this, please tell me. If there is a script for this, than that would be good too.
Thanks. :)

Offline winkio

  • Epiq
  • Administrator
  • Guardian of Chaos
  • *****
  • Posts: 4505
  • LV: 199
  • Gender: Male
  • I am lying.
    • View Profile
Re: Help: Want BGM to continue playing after map transfer.
« Reply #1 on: February 06, 2008, 02:10:02 AM »
One option is to make a parallel process event that plays the bgm you want.  That is what I use in my game, although it can cause some lag.
Another option is to add a line that plays the bgm as the last line of the event that teleports you into the map.

but when you switch maps, if there is no auto change bgm, the bgm should just carry over and not restart...

Hope one of those works for you.

icecold49

  • Guest
Re: Help: Want BGM to continue playing after map transfer.
« Reply #2 on: February 06, 2008, 02:28:55 AM »
Thanks for your suggestions but both of them don't work becuase once I transfer onto another map, the bgm still starts over again. I just want the bgm to continue playing without it starting over again after I transfer onto another map.

Offline winkio

  • Epiq
  • Administrator
  • Guardian of Chaos
  • *****
  • Posts: 4505
  • LV: 199
  • Gender: Male
  • I am lying.
    • View Profile
Re: Help: Want BGM to continue playing after map transfer.
« Reply #3 on: February 06, 2008, 02:47:21 AM »
here, ill make a demo.  Wait a few minutes...

EDIT: okay here it is
it uses 3 options, and you can select witch one you want by changing the starting position.  hope this clears everything up.
http://www.sendspace.com/file/pb7ht2

EDIT#2: You can open up and edit this demo as you wish, to see how it works and change the starting position, so that you can see how each method works.
« Last Edit: February 06, 2008, 04:08:32 AM by winkio »

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 20015
  • LV: 651
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: Help: Want BGM to continue playing after map transfer.
« Reply #4 on: February 06, 2008, 03:07:10 AM »
Or use this mini script. It won't restart the playing BGM or BGS if it is already playing.

Code: [Select]
class Game_System
 
  alias bgm_play_bgmcontinue_later bgm_play
  def bgm_play(bgm)
    if bgm == nil || @playing_bgm == nil || @playing_bgm.name != bgm.name ||
        @playing_bgm.volume != bgm.volume || @playing_bgm.pitch != bgm.pitch
      bgm_play_bgmcontinue_later(bgm)
    end
  end
 
  alias bgs_play_bgscontinue_later bgs_play
  def bgs_play(bgs)
    if bgs == nil || @playing_bgs == nil || @playing_bgs.name != bgs.name ||
        @playing_bgs.volume != bgs.volume || @playing_bgs.pitch != bgs.pitch
      bgs_play_bgscontinue_later(bgs)
    end
  end
 
end

Tell me if it work, I made this out of my head.
« Last Edit: February 06, 2008, 03:08:53 AM by Blizzard »
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

icecold49

  • Guest
Re: Help: Want BGM to continue playing after map transfer.
« Reply #5 on: February 06, 2008, 03:29:54 AM »
 :) Thanks for the script Blizz. However I just tried the script out and it looks like it didn't work. The same thing was happening as before. I played the BGM through a parallel process, then transfered to another map with another parallel process playing the same BGM, and the song stopped for a second and then restarted as usual.  :-\ Really want this to work. Please help.

EDIT: Winkio, i didn't see your message. I'm going to try what you suggested first (the demo).
« Last Edit: February 06, 2008, 03:36:26 AM by icecold49 »

Offline winkio

  • Epiq
  • Administrator
  • Guardian of Chaos
  • *****
  • Posts: 4505
  • LV: 199
  • Gender: Male
  • I am lying.
    • View Profile
Re: Help: Want BGM to continue playing after map transfer.
« Reply #6 on: February 06, 2008, 03:32:17 AM »
This sounds like a problem with your version of RPG Maker or a mod to the system.  Does the demo work?

Here, let me try Blizz's script real quick, and then we shall see if it is our fixes or your version of the program.

EDIT: the script works perfectly fine for me.

icecold, what version of RMXP are you using?
« Last Edit: February 06, 2008, 03:35:55 AM by winkio »

icecold49

  • Guest
Re: Help: Want BGM to continue playing after map transfer.
« Reply #7 on: February 06, 2008, 03:46:19 AM »
Your demo is exactly what I was looking for, Winkio. So, how did you set it up like that?
Where's the script in the demo?
Also - Using RMXP version: 1.0.2.0
« Last Edit: February 06, 2008, 03:47:25 AM by icecold49 »

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 20015
  • LV: 651
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: Help: Want BGM to continue playing after map transfer.
« Reply #8 on: February 06, 2008, 03:49:10 AM »
I am using the same one and I don't have that problem... Are you using a differnt pitch than 100? It could also be that you are calling the same song with a different file name. Check if your folder has duplicates. It happened to me, too.
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

Offline winkio

  • Epiq
  • Administrator
  • Guardian of Chaos
  • *****
  • Posts: 4505
  • LV: 199
  • Gender: Male
  • I am lying.
    • View Profile
Re: Help: Want BGM to continue playing after map transfer.
« Reply #9 on: February 06, 2008, 03:57:28 AM »
I am not using ANY scripts in the demo.  Im also using the same version of RPG Maker as you.  That means that the error is probably with your scripts.  Might want to copy over Game_System from the demo to your game, in case part of that script was deleted.  Also, custom scripts should go below every other script except main.  Thats all the advice I can give you for now.

The demo was set up using EVENTS ONLY.  You can look at the events in the demo by opening up the project and looking at them.
« Last Edit: February 06, 2008, 03:58:23 AM by winkio »

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 20015
  • LV: 651
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: Help: Want BGM to continue playing after map transfer.
« Reply #10 on: February 06, 2008, 04:05:04 AM »
Actually calling Audio.bgm_play('NAME', VOLUME, PITCH) doesn't start over if it is the same file. >_>
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

icecold49

  • Guest
Re: Help: Want BGM to continue playing after map transfer.
« Reply #11 on: February 06, 2008, 04:06:28 AM »
Hmmm, I see. The BGM actually did continue on when transfering to another map. However, when there were other auto-change BGMs on the maps, it didn't work. Is there any sollution to this? I need my auto-change BGMs. By "didn't work" I mean the BGM stopped for 1 second and then started it up again from the beginning.
« Last Edit: February 06, 2008, 04:07:50 AM by icecold49 »

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 20015
  • LV: 651
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: Help: Want BGM to continue playing after map transfer.
« Reply #12 on: February 06, 2008, 04:11:44 AM »
Hm... Try getting another RGSS102E.dll. Yours could have an error.  You can try to google it or simply download a game from here that has it. I know that my CP has it for sure, I can't remember if CoSLAL had it, though.
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

Offline winkio

  • Epiq
  • Administrator
  • Guardian of Chaos
  • *****
  • Posts: 4505
  • LV: 199
  • Gender: Male
  • I am lying.
    • View Profile
Re: Help: Want BGM to continue playing after map transfer.
« Reply #13 on: February 06, 2008, 04:19:44 AM »
ohh, okay.  THAT makes more sense.

There is no way to do it with autochanging BGM.  There is still a way you can do it though:

1.  Create a switch (ill call it "DifBGM).
2.  turn the switch on before you transfer the player over to the second map if you want the different bgm to keep playing, off if you want the auto-start bgm to     
     play.
3.  Turn off the autostart bgm on the second map (uncheck the box).
4.  Create a paralell process that has 2 pages (on the second map):
     Page1 should just play the bgm you would normally have auto-start (this will function the same as an autostart)
     Page2 should have the condition of switch "DifBGM" being on, and play the different bgm from the event.
     Then, when you exit the map or want to switch the bgm back to normal, simply turn off the switch.

Here is a demo of what I mean:

http://www.sendspace.com/file/be49jf

EDIT:  There is no error with any file Blizz.  Its just how RPG Maker works.  I got the same thing he did.  This fix works tho.  Its what I use all the time in my game.
« Last Edit: February 06, 2008, 05:40:41 AM by winkio »

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 20015
  • LV: 651
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: Help: Want BGM to continue playing after map transfer.
« Reply #14 on: February 06, 2008, 02:26:54 PM »
It doesn't restart the BGM when I use the same one in two maps. =/ I don't know why it doesn't work as it should.
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

Offline winkio

  • Epiq
  • Administrator
  • Guardian of Chaos
  • *****
  • Posts: 4505
  • LV: 199
  • Gender: Male
  • I am lying.
    • View Profile
Re: Help: Want BGM to continue playing after map transfer.
« Reply #15 on: February 07, 2008, 12:29:07 AM »
Blizz, thats not what he is talking about:

he is talking about BGM A being autostarted in Map1 and BGM B being autostarted in Map 2

then, an event in map 1 plays BGM C, and he wants BGM C to carry over to map two, without restarting or playing BGM B.

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 20015
  • LV: 651
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: Help: Want BGM to continue playing after map transfer.
« Reply #16 on: February 07, 2008, 12:42:25 AM »
Ah, I see. Yes, you can't do that without a switch. You should use a parallel process for the BGM A instead of the usual autostarter and simply disable that one by switch when you start BGM C.
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

Offline winkio

  • Epiq
  • Administrator
  • Guardian of Chaos
  • *****
  • Posts: 4505
  • LV: 199
  • Gender: Male
  • I am lying.
    • View Profile
Re: Help: Want BGM to continue playing after map transfer.
« Reply #17 on: February 07, 2008, 12:56:53 AM »
yes, that it what I told him to do, and is what I did in the demo.

Wow, I came up with the exact same thing Blizz did, only 8 hours sooner! :P

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 20015
  • LV: 651
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: Help: Want BGM to continue playing after map transfer.
« Reply #18 on: February 07, 2008, 01:43:17 AM »
I know, I'm just putting it into less words. :P
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.