Jump to content
Sign in to follow this  
Armach

Making vehicle armored

Recommended Posts

Hello!

I had made some feature for my needs and want to share it with you since somebody may found it to be useful.

My target was to make an armored car for VIP person transportation. The thing is, that nor in Vanilla, nor in Ace even a car itself is undamageable, the passenger can be easily killed by shot through the glass.

Here is my suggestion how to avoid it:

1) put these string sinto the vehicle init section:

this addEventHandler ["getIn", {(_this select 2) allowDamage false}];
this addEventHandler ["getOut", {(_this select 2) allowDamage true}];

this strings make the vehicle passengers undamagable ubtil they are inside the vehicle or until the vehicle is alive.

Now we have situation that the passenger stays alive inside the vehicle until the vehicle get destroyed. For my needs i wanted to have car which simulates VIP armored car so i wanted the tires to be stronger than they were by default. For this aim i've done the following:

2) add this string into vehicle init section too:

this addEventHandler ["HandleDamage",{0.5*(_this select 2)}];

This code catch all the famage applied to the vehicle and pass to the engine only 0.5 of its volume. I've tried this for SUV and this gives me the following: i cant destroy the tires by 5.45 or 5.56 caliber bullets. The car was able to continue moving after been caught under fire of such rifles.

The syntax of HandleDamage event controller is properly described here with examples by Celery: http://forums.bistudio.com/showthread.php?113418-HandleDamage-EH-explained-%28-poor-man-s-getHit%29

Here is my example:

3) instead of code in point 2) use this code:

this addEventHandler ["HandleDamage",{_selection = _this select 1; _damage = _this select 2; if (_selection == "wheel_1_1_steering" or _selection == "wheel_1_2_steering" or _selection == "wheel_2_1_steering" or _selection == "wheel_2_2_steering") then {0.5*_damage} else {0.75*_damage};}];

This approach makes the wheel two times resistable and the other part of car becomes resistable on 25%.

Notes:

1) This work only with real players, it doesnt wortk with AI.

2) sometimes passenger can be killed even when the car is still alive - i have seen it while been fired the car with KORD. Cant explain this properly.

3) If u use a vehicle with a turret the gunner will be undefeatable the same way as the passengers, that might spoil the realistic side of simulation though it depends on vehicle a lot, imho.

4) I have no info about how much it overload the PC. As i understand from the description, all additional computations are to be processed on clientside so it is not supposed to overload the server though i might be wrong.

Potential usage:

1) may be used for some vehicles to protect the crew anf make the vehicle usage more realistic - to armor helis place for gunner and pilot where it needed (in Hind for example), to emulate bullet resistable tires on Humvees (like this http://news.cnet.com/8301-13639_3-10098240-42.html)

2) may be used to test enemy combat behaviour when u need to face the attack and to stya alive at the same time.

Regards.

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  

×