Frictional Games Forum (read-only)

Full Version: music
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
the music from the first level is still playing in the 2nd level...this is my script.


--------------
01_UnTold.hps
--------------

void OnStart()
{
PlayMusic("10_amb", true, 4.3, 7, 0, true);


AddUseItemCallback("", "Key_01", "Door_01", "DoorUnlock", true);


AddEntityCollideCallback("Player", "Script", "Music", true, 1);
}

void DoorUnlock(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "Unlock_Door.snt", asEntity, 0, false);
RemoveItem(asItem);
}

void Music(string &in asParent, string &in asChild, int alState)
{
PlayMusic("dan_Brute", true, 3.2, 8, 10, true);
}








void OnEnter()
{

}







void OnLeave()
{

}


--------------
02_UnTold.hps
--------------

void OnStart()
{
PlayMusic("01_amb_darkness", true, 4.3, 7, 1, true);
}


void DoorLockedPlayer(string &in entity)
{

GetSwingDoorLocked("DoorMessage");
SetMessage("Sign", "msgname", 0);

}





void OnEnter()
{

}




void OnLeave()
{

}
Which music? There are two of them. I'm assuming the brute music, but its the same problem there which I told you before. Too high priority. On void OnLeave in the first hps file, put this there:

StopMusic(8.0f, 10);
If you have used PlayMusic in a map, then you always has to use StopMusic with the same values at void OnLeave if you dont want them to continue in the other maps aswell
Actually, as long as the priority is higher, one music track will overlap and mute the other. The lower one will continue if the highest is stopped though.
yeah but as soon the sound/music with the highest priority stops the lower continues, but he wanted it to stop on leaving the map, then you have to use the StopMusic to prevent to continue at any point
(06-16-2014, 10:23 PM)Neelke Wrote: [ -> ]Which music? There are two of them. I'm assuming the brute music, but its the same problem there which I told you before. Too high priority. On void OnLeave in the first hps file, put this there:

StopMusic(8.0f, 10);

can you please show me more...by that i mean will you show the script and how i will need to put it into the code?
PHP Code:
void OnLeave()
{
StopMusic(8.0f10);

This is what Neelke meant.
and how do i get a key for lvl 1 to work in level 2? or3 ect...
You just put the script into the level it is supposed to be used in
can you please put it into a script example so i can understand more? thx Smile
Pages: 1 2