Frictional Games Forum (read-only)

Full Version: Play custom sound at area?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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);
}

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



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

Would be goodSmile
(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)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, 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.