39Games
Junior Member
Posts: 48
Threads: 14
Joined: Jan 2013
Reputation:
0
|
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 |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
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 |
|
39Games
Junior Member
Posts: 48
Threads: 14
Joined: Jan 2013
Reputation:
0
|
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 |
|
NaxEla
Senior Member
Posts: 415
Threads: 5
Joined: Dec 2012
Reputation:
28
|
RE: enemy area not working?
Try setting the prop's health to 0.
|
|
02-06-2013, 07:42 AM |
|
39Games
Junior Member
Posts: 48
Threads: 14
Joined: Jan 2013
Reputation:
0
|
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
|
|
02-06-2013, 07:54 AM |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
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 |
|
|