Lizard
Member
Posts: 174
Threads: 23
Joined: Jul 2012
Reputation:
5
|
Creating sounds?
Hey guys, yep it's me again.
It is my first time creating a map and my first time im working with scripting.
My second map of my cs is almost done.
All i need is an area that, when the player walks into it, starts the sound of a grunt and lets the sound run for about 10 seconds and then fades out again.
I've been looking around on the script site, i found two voids that might do the trick, but before doing anything i would like know from you guys if i have found the right voids.
The two i found was:
void FadeInSound(string& asSoundName, float afFadeTime, bool abPlayStart);
and
void StopSound(string& asSoundName, float afFadeTime);
I like to know if it are those two i have to use, and if it is how to set them up.
I would really appriciate your help
CURRENT PROJECT:
A Fathers Secret == Just started
(This post was last modified: 07-06-2012, 11:14 PM by Lizard.)
|
|
07-06-2012, 10:44 PM |
|
Cruzore
Senior Member
Posts: 301
Threads: 2
Joined: Jun 2012
Reputation:
37
|
RE: Greating sounds?
You should use:
AddEntityCollideCallback(string& asParentName, string& asChildName, string& asFunction, bool abDeleteOnCollide, int alStates);
and:
PlaySoundAtEntity(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound);
FadeInSound could work too, but you don't want the grunt sound to be faded in, don't you?
If you need help at making a grunt sound only(normally it will choose the brute) refer to this page where I cleared it up:
http://www.frictionalgames.com/forum/thr...age-7.html
(first post at that page is explanation + PlayMusic, and second post is for PlaySoundAtEntity)
Think, before you speak Google, before you post
(This post was last modified: 07-06-2012, 11:15 PM by Cruzore.)
|
|
07-06-2012, 11:14 PM |
|
Lizard
Member
Posts: 174
Threads: 23
Joined: Jul 2012
Reputation:
5
|
RE: Greating sounds?
(07-06-2012, 11:14 PM)FastHunteR Wrote: You should use:
AddEntityCollideCallback(string& asParentName, string& asChildName, string& asFunction, bool abDeleteOnCollide, int alStates);
and:
PlaySoundAtEntity(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound);
FadeInSound could work too, but you don't want the grunt sound to be faded in, don't you?
If you need help at making a grunt sound only(normally it will choose the brute) refer to this page where I cleared it up:
http://www.frictionalgames.com/forum/thr...age-7.html
(first post at that page is explanation + PlayMusic, and second post is for PlaySoundAtEntity) ____________________________________________________________________________________
Yeah i guess the sound should be there instantly and not just be faded in, i see your point on that one.
So as understand, i just need an entity to combine the sound with?
CURRENT PROJECT:
A Fathers Secret == Just started
|
|
07-06-2012, 11:22 PM |
|
Cruzore
Senior Member
Posts: 301
Threads: 2
Joined: Jun 2012
Reputation:
37
|
RE: Creating sounds?
the entity is the thing you play the sound on. If you, for example, want to hear the sound at the end of a corridor, then you choose something there as the Entity. If you just want to hear it good, like if it could be anywhere, you can use "Player".
Think, before you speak Google, before you post
|
|
07-06-2012, 11:25 PM |
|
Lizard
Member
Posts: 174
Threads: 23
Joined: Jul 2012
Reputation:
5
|
RE: Creating sounds?
(07-06-2012, 11:25 PM)FastHunteR Wrote: the entity is the thing you play the sound on. If you, for example, want to hear the sound at the end of a corridor, then you choose something there as the Entity. If you just want to hear it good, like if it could be anywhere, you can use "Player". I see your point.
I know it might be frustraiting, but this is just so im sure.
In this script: AddEntityCollideCallback(string& asParentName, string& asChildName, string& asFunction, bool abDeleteOnCollide, int alStates);
"string& asParentName" could be "player" and "string& asChildName" could be "SoundArea_1" and
"bool abDeleteOnCollide" is if "SoundArea_!" should be deleted after the collide and int alState is if should when i enter or leave the area?
AddEntityCollideCallback(string& asParentName, string& asChildName, string& asFunction, bool abDeleteOnCollide, int alStates);
CURRENT PROJECT:
A Fathers Secret == Just started
(This post was last modified: 07-06-2012, 11:41 PM by Lizard.)
|
|
07-06-2012, 11:39 PM |
|
Cruzore
Senior Member
Posts: 301
Threads: 2
Joined: Jun 2012
Reputation:
37
|
RE: Creating sounds?
You will have to place the callback inside OnEnter() or OnStart(), depends.
For the DeleteOnCollide, if the callback is called, the callback will be removed. That means it only activates once.
Think, before you speak Google, before you post
|
|
07-06-2012, 11:41 PM |
|
Lizard
Member
Posts: 174
Threads: 23
Joined: Jul 2012
Reputation:
5
|
RE: Creating sounds?
(07-06-2012, 11:41 PM)FastHunteR Wrote: You will have to place the callback inside OnEnter() or OnStart(), depends.
For the DeleteOnCollide, if the callback is called, the callback will be removed. That means it only activates once. Okay, thanks man, this really helped me
One last thing, what script should i use to stop the sound, or will it stop by it self?
CURRENT PROJECT:
A Fathers Secret == Just started
(This post was last modified: 07-06-2012, 11:47 PM by Lizard.)
|
|
07-06-2012, 11:43 PM |
|
|