Frictional Games Forum (read-only)

Full Version: enemy area not working?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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);        
}
-1 is not enough damage.

A door has 100 health. You need to SetPropHealth("DOOR", -100);
(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
Try setting the prop's health to 0.
(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
(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