OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Kaja on 12 Jan 2003, 03:17:56

Title: addEventHandler "Hit": Improper Documentation
Post by: Kaja on 12 Jan 2003, 03:17:56
Hello,
There seems to be an error in the official ComRef in regards to addEventHandler "Hit". Seems BIS forgot to mention that there are three variables passed on instead of the documented two. What I found as the missing variable is in bold, can someone please confirm this?

"Hit" object:objectHit,object:causedBy,scalar:howMuch

Thanks all.
Title: Re:addEventHandler "Hit": Improper Documentation
Post by: Dinger on 12 Jan 2003, 04:54:49
absolutely, all EHs return in the first field the unit they're attached to.
Title: Re:addEventHandler "Hit": Improper Documentation
Post by: Kaja on 12 Jan 2003, 06:03:51
Thx Dinger, I probably should have noticed this initially.

One quick follow up question, is there a reason the "Hit" event handler doesn't work with certain combinations of weapons and targets? Hit event isn't triggered if you have a UAZ as a target and shoot it with a rifle; even if you destroy said UAZ with rifle fire. However a grenade will set off the hit event, even if it's not a direct hit. This seems to hold true for larger vehicles as well, destroying a helo as a machine gunner doesn't set off the hit event either.

Thanks again.
Title: Re:addEventHandler "Hit": Improper Documentation
Post by: Dinger on 12 Jan 2003, 19:34:02
"Hit" only fires when an object incurs >= 5% damage.