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
Stop music
xtron Offline
Senior Member

Posts: 402
Threads: 37
Joined: May 2011
Reputation: 2
#1
Stop music

What's the code, when the player reaches a specific area the music stops.
I can't get the:
void StopMusic(float afFadeTime, int alPrio);
To work... :/

EDIT: This doesn't seems to work :O. any ideas?
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();
}

[Image: 44917299.jpg]Dubstep <3
(This post was last modified: 06-06-2011, 11:49 AM by xtron.)
06-06-2011, 11:43 AM
Find
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#2
RE: Stop music

alPrio should be same.

06-06-2011, 11:52 AM
Website Find
xtron Offline
Senior Member

Posts: 402
Threads: 37
Joined: May 2011
Reputation: 2
#3
RE: Stop music

(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"?

[Image: 44917299.jpg]Dubstep <3
06-06-2011, 11:53 AM
Find
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#4
RE: Stop music

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

06-06-2011, 12:04 PM
Website Find
xtron Offline
Senior Member

Posts: 402
Threads: 37
Joined: May 2011
Reputation: 2
#5
RE: Stop music

Ok thanks ^^.

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

I edited my first post.

[Image: 44917299.jpg]Dubstep <3
06-06-2011, 12:06 PM
Find
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#6
RE: Stop music

TimerDestroyPiano1
TimerDestoryPiano1

Function and timer names are not same. Destroy - Destory

06-06-2011, 12:14 PM
Website Find
xtron Offline
Senior Member

Posts: 402
Threads: 37
Joined: May 2011
Reputation: 2
#7
RE: Stop music

(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.

SetPropHealth("piano1", -100);

[Image: 44917299.jpg]Dubstep <3
(This post was last modified: 06-06-2011, 12:50 PM by xtron.)
06-06-2011, 12:24 PM
Find
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#8
RE: Stop music

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.

06-06-2011, 12:49 PM
Website Find
xtron Offline
Senior Member

Posts: 402
Threads: 37
Joined: May 2011
Reputation: 2
#9
RE: Stop music

Oh thanks.

asEntity is the if there's an entity involved?
and what is "string &in asParent, string &in asChild"?

[Image: 44917299.jpg]Dubstep <3
06-06-2011, 12:53 PM
Find
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#10
RE: Stop music

"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.

06-06-2011, 01:03 PM
Website Find




Users browsing this thread: 4 Guest(s)