Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
enemy area not working?
39Games Offline
Junior Member

Posts: 48
Threads: 14
Joined: Jan 2013
Reputation: 0
#1
enemy area not working?

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.
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);        
}

02-06-2013, 06:44 AM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#2
RE: enemy area not working?

-1 is not enough damage.

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

Trying is the first step to success.
02-06-2013, 06:52 AM
Find
39Games Offline
Junior Member

Posts: 48
Threads: 14
Joined: Jan 2013
Reputation: 0
#3
RE: enemy area not working?

(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

02-06-2013, 07:40 AM
Find
NaxEla Offline
Senior Member

Posts: 415
Threads: 5
Joined: Dec 2012
Reputation: 28
#4
RE: enemy area not working?

Try setting the prop's health to 0.

In Ruins [WIP]
02-06-2013, 07:42 AM
Find
39Games Offline
Junior Member

Posts: 48
Threads: 14
Joined: Jan 2013
Reputation: 0
#5
RE: enemy area not working?

(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:54 AM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#6
RE: enemy area not working?

(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

Trying is the first step to success.
02-06-2013, 08:00 AM
Find




Users browsing this thread: 1 Guest(s)