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
Play custom sound at area?
FreshKorruption Offline
Member

Posts: 94
Threads: 27
Joined: Oct 2011
Reputation: 1
#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);
}

Custom Stories

-BrastaSauce

(This post was last modified: 12-03-2011, 07:28 AM by FreshKorruption.)
12-03-2011, 07:27 AM
Website Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#2
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
Find
Unearthlybrutal Offline
Posting Freak

Posts: 775
Threads: 12
Joined: May 2011
Reputation: 26
#3
RE: Play custom sound at area?

void OnStart()
{
PreloadSound("fmscream1.snt");
}

Would be goodSmile

When Life No Longer Exists
Full-conversion mod
(This post was last modified: 12-03-2011, 02:25 PM by Unearthlybrutal.)
12-03-2011, 02:25 PM
Website Find
FreshKorruption Offline
Member

Posts: 94
Threads: 27
Joined: Oct 2011
Reputation: 1
#4
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?

Custom Stories

-BrastaSauce

12-03-2011, 02:40 PM
Website Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#5
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
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#6
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
Find




Users browsing this thread: 1 Guest(s)