FreshKorruption
Member
Posts: 94
Threads: 27
Joined: Oct 2011
Reputation:
1
|
Play custom sound at area?
Hey guys. So I don't know what I am doing wrong. I have the custom sound (fmscream1.ogg) in the sounds folder, but when i hit the area, it wont play the sound. Here is the script i have. BTW it isn't scripted like this. It is scripted in the right positions and not just beside each other.
AddEntityCollideCallback("Player", "scream_1", "Scream", true, 1);
void Scream(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "fmscream1", "Player", 0, false);
}
|
|
12-03-2011, 07:27 AM |
|
flamez3
Posting Freak
Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation:
57
|
RE: Play custom sound at area?
You need to go into the sounds folder and create a fmscream1.snt file. Than add this:
<SOUNDENTITY>
<SOUNDS>
<Main>
<Sound File="fmscream1.ogg" />
</Main>
</SOUNDS>
<PROPERTIES Volume="1" MinDistance="20" MaxDistance="100" Random="1" Interval="5" FadeEnd="False" FadeStart="False" Stream="False" Loop="False" Use3D="True" Blockable="False" BlockVolumeMul="0.8" Priority="0" />
</SOUNDENTITY>
Than instead of this:
PlaySoundAtEntity("", "fmscream1", "Player", 0, false);
Do this:
PlaySoundAtEntity("", "fmscream1.snt", "Player", 0, false);
|
|
12-03-2011, 07:53 AM |
|
Unearthlybrutal
Posting Freak
Posts: 775
Threads: 12
Joined: May 2011
Reputation:
26
|
RE: Play custom sound at area?
void OnStart()
{
PreloadSound("fmscream1.snt");
}
Would be good
|
|
12-03-2011, 02:25 PM |
|
FreshKorruption
Member
Posts: 94
Threads: 27
Joined: Oct 2011
Reputation:
1
|
RE: Play custom sound at area?
(12-03-2011, 07:53 AM)flamez3 Wrote: You need to go into the sounds folder and create a fmscream1.snt file. Than add this:
</properties>
Than instead of this:
PlaySoundAtEntity("", "fmscream1", "Player", 0, false);
Do this:
PlaySoundAtEntity("", "fmscream1.snt", "Player", 0, false);
Thanks it worked. Would i have to do the same thing with the music i am going to play during the credits?
|
|
12-03-2011, 02:40 PM |
|
flamez3
Posting Freak
Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation:
57
|
RE: Play custom sound at area?
(12-03-2011, 02:40 PM)FreshKorruption Wrote: (12-03-2011, 07:53 AM)flamez3 Wrote: You need to go into the sounds folder and create a fmscream1.snt file. Than add this:
Than instead of this:
PlaySoundAtEntity("", "fmscream1", "Player", 0, false);
Do this:
PlaySoundAtEntity("", "fmscream1.snt", "Player", 0, false);
Thanks it worked. Would i have to do the same thing with the music i am going to play during the credits?
I would do that just to be sure.
|
|
12-03-2011, 03:23 PM |
|
Statyk
Schrödinger's Mod
Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation:
241
|
RE: Play custom sound at area?
(12-03-2011, 02:40 PM)FreshKorruption Wrote: Thanks it worked. Would i have to do the same thing with the music i am going to play during the credits? As far as I know, the credits run ".ogg", so no .snt is necessary. but if not, just make the .snt.
|
|
12-03-2011, 07:30 PM |
|
|