Jump to content
Sign in to follow this  
NeV3rKilL

Hit in the leg.

Recommended Posts

How can i give damage to a leg?

I know , which returns hands damage, but how can I set hands and legs damage? And how can I get legs damage?

In a car how can I get/set the damage of the different parts of the vehicle??

Thank you.

Share this post


Link to post
Share on other sites

SetHit is great! And for get the damage? Anithing like getdamage ?

Share this post


Link to post
Share on other sites

make a eventhandler "handledammage" or "hit" or "dammaged"

UNN had a example with handledammage somewhere on this forum.

look in ArmA 2 : CONFIGS AND SCRIPTING (addons) for handledammage

its actually verry simple :)

Share this post


Link to post
Share on other sites

Ok I didn't know the handlers and all my job was around activators now a new door is opend for me :D

Thank you very much!!

---------- Post added at 10:02 PM ---------- Previous post was at 08:04 PM ----------

I have another question now about handlers.

How many times handler is activated?? I have create a small script to test it:

i=0;
_car addEventHandler ["handleDamage", { i=i+1; hint format["%1",i];; }];

This Handler is activated 5 times if I hit to a human, and more than 20 if I hit a tank!!

Then this example:

this addEventHandler ["handleDamage", { (damage (_this select 0)) + ((_this select 2) * 0.1) }]; // Take 10% damage.

Dosn't work for me, because the damage is takened 21 times. I have test with:

this addEventHandler ["handleDamage", { (damage (_this select 0)) + ((_this select 2) * 1) }]; // Take 100% damage.

And traktor have been destroyed with a couple of hits. ¿?¿?

Why ¿?

Share this post


Link to post
Share on other sites

The event handler is executed by the hitpoints. If you shoot a tank, you apply an amount of damage to each point no matter where you shoot. Same with the soldier. This is stupid because it counter acts the whole idea of using hitpoints in the first place.

Share this post


Link to post
Share on other sites

OK I have found the error. In that "FAQ" tells that :

Number: The new damage level to apply

True: Apply damage normally.

False: Ignore the damage entirely. Injured soldier does not even flinch or bleed from this.

nil: Apply damage normally.

And the first sentence is WRONG.

The "number" is added at the actual damage, is not a new level like using setdamage just add.

Share this post


Link to post
Share on other sites

NeV3rKilL let it also be said that you only add 1 eventhandler of each type to each unit once.

this addEventHandler ["handleDamage", { (damage (_this select 0)) + ((_this select 2) * 1) }]; // Take 100% damage.

that will not work

you are using dammage which set total dammage to the object.

so to set dammage only to legs you do like.

player setHit ["legs", 1];  

or hands

player setHit ["hands", 1];  

now you can shoot him anywhere and his legs will be hurt.

this addEventHandler ["dammaged","_this select 0 sethit['legs',1]"]

so if you do this.

this addEventHandler ["dammaged","(_this select 0) sethit [(_this select 1),(_this select 2) + 1]"]

you will add 1 in dammage to the part you hit.

Be Aware that the dammaged EH does NOT work on planes

Edited by nuxil

Share this post


Link to post
Share on other sites

I don't understand eventhandler "handleDamage". Just it dosn't works how it would have.

This code extract from http://dev-heaven.net/boards/37/topics/show/949#message-1205

this addEventHandler ["handleDamage", { (damage (_this select 0)) + ((_this select 2) * 0.1) }]; // Take 10% damage.

Destrois a T90 with 5 M16A1 hits when the T90 would must support 10 times most damage. Forgot hit locations just talking about global damage.

I Don't undestand, the damage passed by (_this select 2) seems to be exponential, when it would have be constant value. I have done tests with

this addEventHandler ["handleDamage", { (damage (_this select 0)) +  0.1 }]; 

And works perfect, after 10 shots T90 explodes but if I use _this select 2, then it's incontrolable and another question:

I want to do normal damage, how can I do ?

nil: Apply damage normally.

But if I use nil value then the T90 is invulnerable.

I think that handleDamage is too green.

Edited by NeV3rKilL

Share this post


Link to post
Share on other sites
How can i give damage to a leg?

And how can I get legs damage?

Thank you.

To return the dammage to the legs or hands, use:

?(legsHit _unit > 0):hint "Legs are hit!";

?(handsHit _unit == 0):hint "Hands are fine.";

I tested and it works great! Hope this helps!

-Ganst949

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×