Frictional Games Forum (read-only)

Full Version: Can't play music
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a problem with the PlayMusic function.
This is my OnEnter part of the script
Code:
void OnEnter()
{
    PlayMusic("amb_25.ogg", true, 1.0f, 0, 1, true);
}

The problem is that the music doesn't play when I enter the map.
I also tried to play it with the AddEntityCollideCallback func but it still doesn't play when I enter the script area

Code:
    void OnStart()
{
AddEntityCollideCallback("Player", "StartMusic", "Music", true, 1);
}

void Music(string &in asParent, string &in asChild, int alState)
{
    PlayMusic("amb_25.ogg", true, 1.0f, 0, 1, true);
}
If anyone know how to resolve this do not hesitate to tell me Big Grin
If there are any other sounds/music playing before that script is triggered, you should set the priority (int alPrio) to 0, meaning the highest priority.

Also, it's a bit basic, but I thought I should ask anyway: are you 100% your .map and .hps files are in the same folder, and are named exactly the same thing?
(08-14-2012, 04:12 PM)andyrockin123 Wrote: [ -> ]If there are any other sounds/music playing before that script is triggered, you should set the priority (int alPrio) to 0, meaning the highest priority.

Also, it's a bit basic, but I thought I should ask anyway: are you 100% your .map and .hps files are in the same folder, and are named exactly the same thing?
Well, there are no other sounds/music playing. Do you think it could be because of the main menu music?
(I tried changing the alPrio to 0 but still no effect)

About the .map and .hps - Yes, there are in the same folder ^^
(08-16-2012, 06:53 AM)amusei Wrote: [ -> ]
(08-14-2012, 04:12 PM)andyrockin123 Wrote: [ -> ]If there are any other sounds/music playing before that script is triggered, you should set the priority (int alPrio) to 0, meaning the highest priority.

Also, it's a bit basic, but I thought I should ask anyway: are you 100% your .map and .hps files are in the same folder, and are named exactly the same thing?
Well, there are no other sounds/music playing. Do you think it could be because of the main menu music?
(I tried changing the alPrio to 0 but still no effect)

About the .map and .hps - Yes, there are in the same folder ^^
Have you tried playing a different music? Re-check the music file's name as well.
(08-16-2012, 07:04 AM)Nemet Robert Wrote: [ -> ]
(08-16-2012, 06:53 AM)amusei Wrote: [ -> ]
(08-14-2012, 04:12 PM)andyrockin123 Wrote: [ -> ]If there are any other sounds/music playing before that script is triggered, you should set the priority (int alPrio) to 0, meaning the highest priority.

Also, it's a bit basic, but I thought I should ask anyway: are you 100% your .map and .hps files are in the same folder, and are named exactly the same thing?
Well, there are no other sounds/music playing. Do you think it could be because of the main menu music?
(I tried changing the alPrio to 0 but still no effect)

About the .map and .hps - Yes, there are in the same folder ^^
Have you tried playing a different music? Re-check the music file's name as well.
I guess amb_25.ogg is bugged Tongue When I changed it to another music file it worked. Thanks!
(08-16-2012, 08:53 AM)amusei Wrote: [ -> ]I guess amb_25.ogg is bugged Tongue When I changed it to another music file it worked. Thanks!


You sure it wasn't called "25_amb"?