As I said: the dammaged eventhandler DOES NOT FIRE if the damage of the player is set to -5. Try this:
Have a unit, name him, say, unit1. We'll make a global variable that should update with each eventhandler and then displayed in a hint. So, define a global variable named EH_Hint = []; someplace, say in the init field of a unit. First, add only this eventhandler:
unit1 addeventhandler ["dammaged", {EH_Hint = EH_Hint + [_this]; hint str (EH_Hint)}];
Now shoot unit1, and you'll probably (unless you killed him) get a hint with all the contents of the dammaged eventhandler (unit hit, area hit, total damage to area etc.).
Now, add a second eventhandler:
unit1 addeventhandler ["hit", {EH_Hint = EH_Hint + [_this]; hint str (EH_Hint)}];
And shoot unit1: see which hint displays last (i.e., you should first get the "hit" information and then the "dammaged" information). So far so good, eh?
Now, change the "hit" eventhandler:
unit1 addeventhandler ["hit", {unit1 setdamage -5;EH_Hint = EH_Hint + [_this]; hint str (EH_Hint)}];
Also, change the init of the unit to include the line : this setdamage -5 (will keep the first shot from being an insta-kill). Leave the dammaged eventhandler as it is.
And...whatever happened? :O The dammaged eventhandler NEVER FIRES anymore! This is because, as mentioned, it never has time to fire, since the hit eventhandler always resets damage to -5. However, the unit is happily invulnerable.
Now, as a final test, try adding a tiny sleep to the hit eventhandler, to allow the dammaged to fire:
unit1 addeventhandler ["hit", {sleep 0.02;unit1 setdamage -5;EH_Hint = EH_Hint + [_this]; hint str (EH_Hint)}];
And try to kill unit1 -> you will find you can kill him again, which defeats the purpose of the whole body armor script.
Thank you for your suggestions, but I -have- tried some stuff before making it.
If you -do- come up with a fully working alternative "head shot allowing" version, please do give me an example script or example mission where it works! I'm sure I haven't tested -everything- yet.
Wolfrug out.