Frictional Games Forum (read-only)
[SCRIPT] How to add scripted 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: [SCRIPT] How to add scripted sound (/thread-14396.html)



How to add scripted sound - zombiehacker595 - 04-01-2012

how do i add scripted sound as i enter a certain area i can use scripted sound on like a door but how do i pt just to say in the middle of a dark room


RE: How to add scripted sound - Xanthos - 04-01-2012


AddEntityCollideCallback("Player", "DarkRoomScript_1", "ScarySound", true, 1);

void ScarySound(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "SOUNDNAME.snt", "EntityPlayedOn", 0, false);

GiveSanityDamage(5.0f);
}


RE: How to add scripted sound - zombiehacker595 - 04-01-2012

(04-01-2012, 03:26 AM)Xanthos Wrote: AddEntityCollideCallback("Player", "DarkRoomScript_1", "ScarySound", true, 1);

void ScarySound(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "SOUNDNAME.snt", "EntityPlayedOn", 0, false);

GiveSanityDamage(5.0f);
}
wow thanks it works but i had to delete the sanitydamage thing it caused my game to crash but the sound works thanks heeps Smile





RE: How to add scripted sound - Xanthos - 04-01-2012

GiveSanityDamage(5.0f, true);
oops


RE: How to add scripted sound - zombiehacker595 - 04-01-2012

(04-01-2012, 03:36 AM)Xanthos Wrote: GiveSanityDamage(5.0f, true);
oops

haha now it works thanks Smile