Sound at Entity - 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: Sound at Entity (/thread-9519.html) |
Sound at Entity - mr.bonent - 07-31-2011 Hey guys! I want to play a Sound on a Entity when the Player enters an area. It doesn't work yet. Here my script. Thanks for help.[/quote] Quote:void OnStart() RE: Sound at Entity - MrCookieh - 07-31-2011 void DoorSchrei(string &in asParent, string &in asChild, int alState); remove the semicolon RE: Sound at Entity - mr.bonent - 07-31-2011 Ok thanks, the error message does not appear anymore. But no sound was there when I entered the area. RE: Sound at Entity - Janni1234 - 07-31-2011 PlaySoundAtEntity("Schrei", "05_event_door_bang.snt", "mansion_6", 2.0f, false); try: PlaySoundAtEntity("Player", "05_event_door_bang.snt", "mansion_6", 2.0f, false); RE: Sound at Entity - Angerpull - 07-31-2011 When you're playing a sound at an Entity, do not use the SNT at the end. Just use it's name. RE: Sound at Entity - MrCookieh - 08-01-2011 and you can put these PlaySoundAtEntity("Schrei", "05_event_door_bang.snt", "mansion_6", 2.0f, false); StopSound("Schrei", 5.0f); into your void DoorClosedAndLook(string &in asParent, string &in asChild, int alState) because the are executed at the same time RE: Sound at Entity - Kyle - 08-01-2011 Guys, why not we just play the sound at the entity the NORMAL way, no extra modifications that are needed. -_- The reason why the sound doesn't work is because you're starting it up and then it gets canceled. Do this: Code: void OnStart() It's useless to call the different functions with the same parent and child at the same time. I was also wondering what's the point for playing a sound and then have it be stopped? The sound isn't a repeating one. RE: Sound at Entity - mr.bonent - 08-01-2011 Thank you very much guys! Kyle your script works perfect. Greets! RE: Sound at Entity - Kyle - 08-01-2011 (08-01-2011, 04:45 PM)mr.bonent Wrote: Thank you very much guys! Kyle your script works perfect. No problem, I try my hardest. |