G510s
Banned
Posts: 58
Threads: 32
Joined: Jun 2014
|
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 |
|
Neelke
Senior Member
Posts: 668
Threads: 82
Joined: Apr 2013
Reputation:
26
|
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 |
|
Lizard
Member
Posts: 174
Threads: 23
Joined: Jul 2012
Reputation:
5
|
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 |
|
Mudbill
Muderator
Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation:
179
|
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 |
|
Lizard
Member
Posts: 174
Threads: 23
Joined: Jul 2012
Reputation:
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 |
|
G510s
Banned
Posts: 58
Threads: 32
Joined: Jun 2014
|
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 |
|
PutraenusAlivius
Posting Freak
Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation:
119
|
RE: music
void OnLeave() { StopMusic(8.0f, 10); }
This is what Neelke meant.
"Veni, vidi, vici."
"I came, I saw, I conquered."
|
|
07-07-2014, 11:06 AM |
|
G510s
Banned
Posts: 58
Threads: 32
Joined: Jun 2014
|
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 |
|
Lizard
Member
Posts: 174
Threads: 23
Joined: Jul 2012
Reputation:
5
|
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 |
|
G510s
Banned
Posts: 58
Threads: 32
Joined: Jun 2014
|
RE: music
can you please put it into a script example so i can understand more? thx
|
|
07-08-2014, 11:30 PM |
|
|