Frictional Games Forum (read-only)

Full Version: Cant get this function to work (sound)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Quote:void OnStart()
{
SetEntityPlayerInteractCallback("Key_1", "Scary_3_1", true);

}

void Scary_3_1(string &in entity)
{
SetEntityActive("Skull_1", true);
PlaySoundAtEntity("", "21_scream7.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
AddTimer("CabinetTimer",0.7, "Scary_3_2");

}
This is so weird cause all the other functions work but not the "PlaySoundAtEntity" , and I have used that script before, in the same map. Does anyone have an idea why it doesnt work?
(01-03-2012, 03:27 PM)Fralexxelarf Wrote: [ -> ]
Quote:void OnStart()
{
SetEntityPlayerInteractCallback("Key_1", "Scary_3_1", true);

}

void Scary_3_1(string &in entity)
{
SetEntityActive("Skull_1", true);
PlaySoundAtEntity("", "21_scream7.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
AddTimer("CabinetTimer",0.7, "Scary_3_2");

}
This is so weird cause all the other functions work but not the "PlaySoundAtEntity" , and I have used that script before, in the same map. Does anyone have an idea why it doesnt work?
Did you restart the CS and try again?

yep, and i have no music in the background, this works though, after entering an area;
Quote: PlaySoundAtEntity("", "12_girl_scream.snt", "Player", 0, false);
but if i replace it with 21_scream7 in my
Quote:PlaySoundAtEntity("", "21_scream7.snt", "Player", 0, false);
it still doesnt sound when i pick up the key, is there something wrong with
Quote:void Scary_3_1(string &in entity)?


here's an other sound script, the function works but the sound wont play;
Quote:
void OnStart()
{
AddEntityCollideCallback("Player", "Scary_Area_1", "Scary_1", true, 1);

}

void Scary_1(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("Scary_1", "lurker_hit_wood1.snt", "player", 0, false);
AddPropImpulse("armour_nice_complete_1", 0, 0, 2, "world");

}

nevermind, the snt's were corrupt
I've been having the same issue with:

PlaySoundAtEntity("big_clock_chime", "Custom\big_clock_chime.snt", "clock_grandfather_1", 0, false);
The file is located in redist/sounds/Custom, and is not corrupted.
(01-03-2012, 05:51 PM)eagledude4 Wrote: [ -> ]I've been having the same issue with:

PlaySoundAtEntity("big_clock_chime", "Custom\big_clock_chime.snt", "clock_grandfather_1", 0, false);
The file is located in redist/sounds/Custom, and is not corrupted.
The game will find the filename, no need to give it information about the folder location.
PlaySoundAtEntity("big_clock_chime", "big_clock_chime.snt", "clock_grandfather_1", 0, false);
(01-03-2012, 06:17 PM)Khyrpa Wrote: [ -> ]
(01-03-2012, 05:51 PM)eagledude4 Wrote: [ -> ]I've been having the same issue with:

PlaySoundAtEntity("big_clock_chime", "Custom\big_clock_chime.snt", "clock_grandfather_1", 0, false);
The file is located in redist/sounds/Custom, and is not corrupted.
The game will find the filename, no need to give it information about the folder location.
PlaySoundAtEntity("big_clock_chime", "big_clock_chime.snt", "clock_grandfather_1", 0, false);

Using your code, the sound still doesn't load.


also, the syntax was incorrect.

void Scary_3_1(string &in entity)


Should be:

void Scary_3_1(string &in asEntity)



Perhaps that will solve another issue that comes up.
My sound issue hasn't been resolved yet.
(01-05-2012, 02:27 AM)eagledude4 Wrote: [ -> ]My sound issue hasn't been resolved yet.
Have you torrented your amnesia or something? Be honest.
(01-05-2012, 02:29 AM)Statyk Wrote: [ -> ]
(01-05-2012, 02:27 AM)eagledude4 Wrote: [ -> ]My sound issue hasn't been resolved yet.
Have you torrented your amnesia or something? Be honest.

Yes Sad I'd buy it if steam would let me use my debit card. I can get custom sounds to work through the level editor, just not through my script.


Pages: 1 2