Frictional Games Forum (read-only)
[SCRIPT] Sound not activating upon collision - 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] Sound not activating upon collision (/thread-19521.html)



Sound not activating upon collision - Saitoshiba - 12-11-2012

My script file looks fine, but when the player enters on the scrip area the effect of losing sanity happens( usually don't) but the sound doesn't play. The other room that has the exact same thing plays the sound perfectly.


void OnStart()
{

AddEntityCollideCallback("Player","ScriptArea_8","Torture1",true,0);
AddEntityCollideCallback("Player","ScriptArea_10","Torture2",true,0);
}


void OnEnter()
{

}

void OnLeave()
{
}

// The collision that it is working perfectly

void Torture1(string &in parent, string &in child, int state)
{
GiveSanityDamage(0,true);
PlaySoundAtEntity("Burn1","24_burn.snt","Player",0,false);
}

void Torture2(string &in parent, string &in child, int state)
{
GiveSanityDamage(0,true);
PlaySoundAtEntity("Saw","23_saw2.snt","Player",0,false);
PlaySoundAtEntity("SawVoice","23_saw_voice2.snt","Player",0,false);
}

Can somebody help me?


RE: Sound not activating upon collision - Tomato Cat - 12-11-2012

I'm pretty sure the arguments (or maybe they're called "parameters") for your Torture 1 & 2 functions is supposed to be asChild, asParent, and alState, rather than child, parent, and state.


RE: Sound not activating upon collision - Saitoshiba - 12-12-2012

Doesn't change much. Still not playing the sound in the place, but in another place that there isn't any script area. Weird.


RE: Sound not activating upon collision - The chaser - 12-12-2012

(12-11-2012, 09:54 PM)Saitoshiba Wrote: My script file looks fine, but when the player enters on the scrip area the effect of losing sanity happens( usually don't) but the sound doesn't play. The other room that has the exact same thing plays the sound perfectly.


void OnStart()
{

AddEntityCollideCallback("Player","ScriptArea_8","Torture1",true, 0);
AddEntityCollideCallback("Player","ScriptArea_10","Torture2",true, 0);
}


void OnEnter()
{

}

void OnLeave()
{
}

// The collision that it is working perfectly

void Torture1(string &in asParent, string &in asChild, int alState)
{
GiveSanityDamage(0,true);
PlaySoundAtEntity("Burn1","24_burn.snt","Player",0,false);
}

void Torture2(string &in asParent, string &in asChild, int alState)
{
GiveSanityDamage(0,true);
PlaySoundAtEntity("Saw","23_saw2.snt","Player",0,false);
PlaySoundAtEntity("SawVoice","23_saw_voice2.snt","Player",0,false);
}

Can somebody help me?
Try this script.