Ainz
Junior Member
Posts: 9
Threads: 1
Joined: Sep 2012
Reputation:
0
|
PlayMusic Problem
Hey guys,
I'm pretty much done with my CS, I only need to fix a little problem with the PlayMusic command.
When I'm testing just the map (let's call it: map 2) where some music is supposed to be played everything works just fine.
Though, when you play the custom story, and get teleported to that map (map 2), you still hear the sound from the map (map 1) you got teleported from.
I used several commands to stop the music and also I lowered the sounds priority.
Here's an outtake from the script:
void OnStart()
{
PlayMusic("06_amb.ogg", true, 1, 3, 0.9f, true);
}
void OnLeave()
{
StopMusic(1, 1);
StopSound("06_amb.ogg", 1);
AddDebugMessage("Sounds Removed", false);
}
because that didn't do anything, I copied and pasted it in the OnStart of the next maps script as well without any result. The sound keeps playing.
If you want the whole custom story - either to test it for me and give me some criticism or - to check out the problem with the sound yourself, just tell me and I'll give you a download link.
Thanks in advance,
Ainz
|
|
09-16-2012, 06:21 PM |
|
Robby
Posting Freak
Posts: 2,549
Threads: 38
Joined: Jun 2009
Reputation:
47
|
RE: PlayMusic Problem
The "StopSound" function's unnecessary. It is used for sounds, you tried using it for music.
Try this:
void OnStart()
{
PlayMusic("06_amb.ogg", true, 1, 3, 0.9, true);
}
void OnLeave()
{
StopMusic(1, 0.9);
AddDebugMessage("Sounds Removed", false);
}
Highlighted what I just changed.
Infrequently active. Don't expect an immediate response. Best to contact me at a different locale. If I create a thread, expect me to be quite active.
|
|
09-16-2012, 06:29 PM |
|
Ainz
Junior Member
Posts: 9
Threads: 1
Joined: Sep 2012
Reputation:
0
|
RE: PlayMusic Problem
Thanks for the fast answer but that didn't solve it, actually it made it even worse. That way the other sounds that were going to play later on in that map didn't start anymore because their priority was too low. maybe i would have to remove the f there as well but I'm almost 100% sure it'll not solve the problem.
And I think the sound playing isn't the ambience sound but it is the ambience sound of the grunt that runs to the player before getting teleported. Any idea how I stop the grunt ambience sound since the StopMusic doesn't seem to work on that.
|
|
09-16-2012, 09:13 PM |
|
Robby
Posting Freak
Posts: 2,549
Threads: 38
Joined: Jun 2009
Reputation:
47
|
RE: PlayMusic Problem
Set the priority to 0. Change the highlighted "0.9" to 0 in both functions. And don't add the "f" letter to the last number in the "PlayMusic" function.
The reason you should try 0 = It should prevent the grunt's music from starting. I did that, and it works.
Infrequently active. Don't expect an immediate response. Best to contact me at a different locale. If I create a thread, expect me to be quite active.
(This post was last modified: 09-17-2012, 11:41 AM by Robby.)
|
|
09-17-2012, 11:40 AM |
|
Ainz
Junior Member
Posts: 9
Threads: 1
Joined: Sep 2012
Reputation:
0
|
RE: PlayMusic Problem
That didn't help either but I got it now.
The sound on the next map shall only play once so I didn't put it as a loop sound.
When I use it as a loop sound though, everything works just as desired - I don't know how but hey it works
Thanks for your help anyway Robert
|
|
09-17-2012, 12:26 PM |
|
Robby
Posting Freak
Posts: 2,549
Threads: 38
Joined: Jun 2009
Reputation:
47
|
RE: PlayMusic Problem
Ok, you're welcome.
Infrequently active. Don't expect an immediate response. Best to contact me at a different locale. If I create a thread, expect me to be quite active.
|
|
09-17-2012, 12:37 PM |
|
|