Frictional Games Forum (read-only)
[SCRIPT] Hear sound at wrong area - 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: [SCRIPT] Hear sound at wrong area (/thread-25283.html)



Hear sound at wrong area - Rowzter - 05-13-2014

I got a little problem i don't know how to solve

I use "PlaySoundAtEntity("", "door_level_cistern_open.snt", "Player", 0.0f, false);" script. But when the sound plays it plays like i am right at the door that opens. How do i change so i hear the sound like it's around a corner or like 10 meters away from me?

I googled and searched on youtube but none gave the answer i needed and i also tried to play around with the "Sounds" thing that is above static_objects in the editor but i don't understand it Sad


My script:
Quote:void chasegruntlook(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("chasegrunt", true);
AddTimer("", 2, "TimerGruntEnd");
StartPlayerLookAt("lookat", 10, 50, "");
AddTimer("", 2, "TimerStopPlayerLook");
AddEnemyPatrolNode("chasegrunt", "chasenode", 0, "");
PlaySoundAtEntity("", "door_level_cistern_open.snt", "Player", 0.0f, false);
}



RE: Hear sound at wrong area - Wapez - 05-13-2014

PlaySoundAtEntity("", "door_level_cistern_open.snt", "Player", 0.0f, false);

Should be:

PlaySoundAtEntity("", "door_level_cistern_open.snt", "MY_AREA", 0.0f, false);

"MY_AREA" needs to be the name of a ScriptArea, or an entity. You can name it whatever you want, as long as you rename it in the script accordingly.

That decides where the sound plays from. You made it play from the player.


RE: Hear sound at wrong area - Rowzter - 05-13-2014

(05-13-2014, 06:38 PM)Wapez Wrote: PlaySoundAtEntity("", "door_level_cistern_open.snt", "Player", 0.0f, false);

Should be:

PlaySoundAtEntity("", "door_level_cistern_open.snt", "MY_AREA", 0.0f, false);

"MY_AREA" needs to be the name of a ScriptArea, or an entity. You can name it whatever you want, as long as you rename it in the script accordingly.

That decides where the sound plays from. You made it play from the player.

daim that was a really easy fix xD, im so stupid. thank you very much! Big Grin