Frictional Games Forum (read-only)
Cant get this function to work (sound) - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Cant get this function to work (sound) (/thread-12320.html)

Pages: 1 2


Cant get this function to work (sound) - Fralexxelarf - 01-03-2012

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?



RE: Cant get this function to work (sound) - flamez3 - 01-03-2012

(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?




RE: Cant get this function to work (sound) - Fralexxelarf - 01-03-2012

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



RE: Cant get this function to work (sound) - eagledude4 - 01-03-2012

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.



RE: Cant get this function to work (sound) - Khyrpa - 01-03-2012

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



RE: Cant get this function to work (sound) - eagledude4 - 01-03-2012

(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.





RE: Cant get this function to work (sound) - Statyk - 01-03-2012

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.


RE: Cant get this function to work (sound) - eagledude4 - 01-05-2012

My sound issue hasn't been resolved yet.



RE: Cant get this function to work (sound) - Statyk - 01-05-2012

(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.


RE: Cant get this function to work (sound) - eagledude4 - 01-05-2012

(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.