Frictional Games Forum (read-only)
enemy area not working? - 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: enemy area not working? (/thread-20207.html)



enemy area not working? - 39Games - 02-06-2013

I have a brute to walk into an area and a door will break, and it just wont work, just the sanity loss when he walks into it... Here is the code.
Code:
void OnStart ()
{
    AddEntityCollideCallback("brute1", "poof", "disspear", true, 1);
    AddEntityCollideCallback("brute1", "break2", "break2", true, 1);    
    AddEntityCollideCallback("brute1", "break3", "break3", true, 1);
    AddEntityCollideCallback("brute1", "break4", "break4", true, 1);
    AddEntityCollideCallback("brute1", "AreaPushDoor", "break1", true, 1);
    
}
void break2(string &in asParent, string &in asChild, int alState)
{
    SetPropHealth("BDoor2", -1);
    GiveSanityDamage(0.1f, true);        
}
void break3(string &in asParent, string &in asChild, int alState)
{
    SetPropHealth("BDoor3", -1);
    GiveSanityDamage(0.1f, true);        
}
void break4(string &in asParent, string &in asChild, int alState)
{
    SetPropHealth("prison", -1);
    GiveSanityDamage(0.1f, true);        
}
void break1(string &in asParent, string &in asChild, int alState)
{
    SetPropHealth("realdoor", -1);
    GiveSanityDamage(0.1f, true);        
}



RE: enemy area not working? - FlawlessHappiness - 02-06-2013

-1 is not enough damage.

A door has 100 health. You need to SetPropHealth("DOOR", -100);


RE: enemy area not working? - 39Games - 02-06-2013

(02-06-2013, 06:52 AM)BeeKayK Wrote: -1 is not enough damage.

A door has 100 health. You need to SetPropHealth("DOOR", -100);

just tried, it did not work, i set it to -1000, nothing


RE: enemy area not working? - NaxEla - 02-06-2013

Try setting the prop's health to 0.


RE: enemy area not working? - 39Games - 02-06-2013

(02-06-2013, 07:42 AM)NaxEla Wrote: Try setting the prop's health to 0.

I just figured it out, i was using the plain doors, insted of the others which can be destroyed, i switched to the other ones and it works, thanks for the suggestion(s) anyway Smile


RE: enemy area not working? - FlawlessHappiness - 02-06-2013

(02-06-2013, 07:42 AM)NaxEla Wrote: Try setting the prop's health to 0.

God i'm stupid. Of course it's 0... Duuuh.

Though, setting it to -1000 would not solve the problem if -100 didn't