Frictional Games Forum (read-only)
[SCRIPT] Exploding door - 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] Exploding door (/thread-16894.html)



Exploding door - Lizard - 07-11-2012

Hey guys, I have done this scripts before, but this time, i just can't get the door to explode (break)

SetEntityPlayerInteractCallback("CellarKey_2", "AreaActive", true);
AddEntityCollideCallback("Player", "ExplodingDoorArea_1", "Explode2", true, 1);


void AreaActive(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("ExplodingDoorArea_1", true);
}


void Explode2(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("ExplodingDoor_1", 0);
CreateParticleSystemAtEntity("", "ps_area_fog_falling", "ExplodingDoor_1", false);
PlaySoundAtEntity("", "break_wood", "ExplodingDoor_1", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
GiveSanityDamage(10, true);
}


Can you help me out on this one


RE: Exploding door - Cruzore - 07-11-2012

wrong callback syntax:
the callback syntax of SetEntityPlayerInteractCallback should be: void MyFunc(string &in asEntity)


RE: Exploding door - Kazakarumariou - 07-11-2012

NEVERMIND I GOT NINJA'D


Spoiler below!

I see this

void AreaActive(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("ExplodingDoorArea_1", true);
}



------------FIXED-----------
void AreaActive(string& asEntity)

{
SetEntityActive("ExplodingDoorArea_1", true);
}




RE: Exploding door - Cruzore - 07-11-2012

correction:
it should be string &in asEntity, not string&


RE: Exploding door - Lizard - 07-11-2012

Thanks.

I just copied it from another hps file, but apparently forgot to edit all 100%

I have stop scripting, when im sleepy