Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help music
G510s Offline
Banned

Posts: 58
Threads: 32
Joined: Jun 2014
#1
music

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()
{

}
06-16-2014, 10:15 PM
Find
Neelke Offline
Senior Member

Posts: 668
Threads: 82
Joined: Apr 2013
Reputation: 26
#2
RE: music

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);

Derp.
06-16-2014, 10:23 PM
Find
Lizard Offline
Member

Posts: 174
Threads: 23
Joined: Jul 2012
Reputation: 5
#3
RE: music

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

CURRENT PROJECT:
A Fathers Secret == Just started
(This post was last modified: 06-16-2014, 10:30 PM by Lizard.)
06-16-2014, 10:29 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#4
RE: music

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.

06-16-2014, 10:44 PM
Find
Lizard Offline
Member

Posts: 174
Threads: 23
Joined: Jul 2012
Reputation: 5
#5
RE: music

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

CURRENT PROJECT:
A Fathers Secret == Just started
06-16-2014, 10:56 PM
Find
G510s Offline
Banned

Posts: 58
Threads: 32
Joined: Jun 2014
#6
RE: music

(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?
07-07-2014, 08:59 AM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#7
RE: music

PHP Code: (Select All)
void OnLeave()
{
StopMusic(8.0f10);

This is what Neelke meant.

"Veni, vidi, vici."
"I came, I saw, I conquered."
07-07-2014, 11:06 AM
Find
G510s Offline
Banned

Posts: 58
Threads: 32
Joined: Jun 2014
#8
RE: music

and how do i get a key for lvl 1 to work in level 2? or3 ect...
07-08-2014, 08:49 AM
Find
Lizard Offline
Member

Posts: 174
Threads: 23
Joined: Jul 2012
Reputation: 5
#9
RE: music

You just put the script into the level it is supposed to be used in

CURRENT PROJECT:
A Fathers Secret == Just started
07-08-2014, 09:27 AM
Find
G510s Offline
Banned

Posts: 58
Threads: 32
Joined: Jun 2014
#10
RE: music

can you please put it into a script example so i can understand more? thx Smile
07-08-2014, 11:30 PM
Find




Users browsing this thread: 1 Guest(s)