Frictional Games Forum (read-only)

Full Version: Stop music
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
What's the code, when the player reaches a specific area the music stops.
I can't get the:
Code:
void StopMusic(float afFadeTime, int alPrio);
To work... :/

EDIT: This doesn't seems to work :O. any ideas?
Code:
void func_piano1_disapear(string &in asEntity, int alState)
{
StartPlayerLookAt("piano1_disapear", 10, 50, "");
AddTimer("", 0.5f, "TimerDestroyPiano1");
}

void TimerDestoryPiano1(string &in asTimer)
{
SetPropHealth("piano1_disapear", -100);
PlayMusic("05_event_steps.ogg", false, 80, 0, 10, false);
GiveSanityDamage(4.0f, true);
PlaySoundAtEntity("", "react_scare.snt", "Player", 0, false);
AddTimer("", 1.0f, "TimerStopLook1");
}

void TimerStopLook1(string &in asTimer)
{
StopPlayerLookAt();
}
alPrio should be same.
(06-06-2011, 11:52 AM)Tanshaydar Wrote: [ -> ]alPrio should be same.

"should be same", what do you mean, should it stay like "int alPrio"?
You wrote:
PlayMusic("05_event_steps.ogg", false, 80, 0, 10, false);
Here, alPrio is 10.
When you use StopMusic, you should write like this:
StopMusic( 0, 10);
Ok thanks ^^.

Btw, can you check why my second script aint working?.

I edited my first post.
TimerDestroyPiano1
TimerDestoryPiano1

Function and timer names are not same. Destroy - Destory
(06-06-2011, 12:14 PM)Tanshaydar Wrote: [ -> ]TimerDestroyPiano1
TimerDestoryPiano1

Function and timer names are not same. Destroy - Destory

Oh. I'm so stupid xD

Thanks ! <3
It doesn't work...is the function right? the "(string &in asEntity, int alState)"


EDIT!: I got it working (solution: (string &in asParent, string &in asChild, int alState) as function)

But now when I enter the script the piano doesn't explode :S.

Code:
SetPropHealth("piano1", -100);
void func_piano1_disapear(string &in asEntity, int alState)

I don't know where or why you call it. This phrase: "(string &in asEntity, int alState)" is used for state changes, like wheels or levers.
Oh thanks.

asEntity is the if there's an entity involved?
and what is "string &in asParent, string &in asChild"?
"string &in asParent, string &in asChild, int alState" is for collide callbacks. Parent is the entity to collide, like player or a grunt; Child is entity or area or whatever to be collided. State, 1 for entering -1 for exiting.
Pages: 1 2