Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Creating sounds?
Author Message
ZereboO Offline
Member

Posts: 109
Joined: Jul 2012
Reputation: 3
Post: #1
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:

Daniel's Discovery == 10 -15%

(This post was last modified: 07-06-2012 11:14 PM by ZereboO.)
07-06-2012 10:44 PM
Find all posts by this user Quote this message in a reply
Cruzore Offline
Senior Member

Posts: 304
Joined: Jun 2012
Reputation: 37
Post: #2
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
Find all posts by this user Quote this message in a reply
ZereboO Offline
Member

Posts: 109
Joined: Jul 2012
Reputation: 3
Post: #3
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:

Daniel's Discovery == 10 -15%

07-06-2012 11:22 PM
Find all posts by this user Quote this message in a reply
Cruzore Offline
Senior Member

Posts: 304
Joined: Jun 2012
Reputation: 37
Post: #4
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
Find all posts by this user Quote this message in a reply
ZereboO Offline
Member

Posts: 109
Joined: Jul 2012
Reputation: 3
Post: #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:

Daniel's Discovery == 10 -15%

(This post was last modified: 07-06-2012 11:41 PM by ZereboO.)
07-06-2012 11:39 PM
Find all posts by this user Quote this message in a reply
Cruzore Offline
Senior Member

Posts: 304
Joined: Jun 2012
Reputation: 37
Post: #6
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
Find all posts by this user Quote this message in a reply
ZereboO Offline
Member

Posts: 109
Joined: Jul 2012
Reputation: 3
Post: #7
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:

Daniel's Discovery == 10 -15%

(This post was last modified: 07-06-2012 11:47 PM by ZereboO.)
07-06-2012 11:43 PM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)