OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: HedgeHog on 01 Oct 2008, 23:27:28

Title: How to strengthen tanks armor
Post by: HedgeHog on 01 Oct 2008, 23:27:28
I'm building a mission in which I need three tanks to survive in a battle for a longer time than normal, so I need a script to strengthen their armor and make them last longer.

Can you suggest me an easy way to make this? :)


Thank you in advance! :D
Title: Re: How to strengthen tanks armor
Post by: Planck on 02 Oct 2008, 04:03:34
Why not just setDamage 0 from a hit eventhandler, so their damage is reset to nil each time they are hit ... until you want to revert to normal again.

Comref definition of setDamage (http://www.ofpec.com/COMREF/index.php?action=list&game=All&letter=s#291).

Tutorial about eventhandlers (http://www.ofpec.com/ed_depot/index.php?action=details&id=39&page=0&cat=xyz).


Planck
Title: Re: How to strengthen tanks armor
Post by: Turk on 02 Oct 2008, 19:00:04
I played around with this a while back, try adding this to the INT of the tank.

Code: [Select]
this addEventHandler ["HIT",{(_this select 0) setDamage (0.91 * damage (_this select 0));}];
In tests with this setting a M1A1 took 6 M136 rockets up the rear before it exploded as opposed to 2 before the Eventhandler. For the tank to take more damage decrease the setdamage value from 0.91 to something like 0.90/0.89 etc etc, if you set it much lower then this the tank will take forever to die.

You will have to play around with different values for different types of armor I guess.

http://www.ofpec.com/forum/index.php?topic=29789.0

Turk.
Title: Re: How to strengthen tanks armor
Post by: HedgeHog on 03 Oct 2008, 00:14:07
Thank you (Or should I say Tank You? ahah! :D)


I'll try as soon as possible! :)