Frictional Games Forum (read-only)

Full Version: Exploding door
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
wrong callback syntax:
the callback syntax of SetEntityPlayerInteractCallback should be: void MyFunc(string &in asEntity)
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);
}

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

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

I have stop scripting, when im sleepy