Jump to content
Sign in to follow this  
LSValmont

Reducing Vehicle Damage Taken via Script.

Recommended Posts

I found this script for Arma 2 and I was wondering if it would still work correctly for Arma 3.

 

I have tried it on several helicopters and they all seemed to go down just as fast as without it.

 

Script: 

if (!isServer) exitWith {};

_unit = _this select 0;

_unit setVariable ["selections", []];
_unit setVariable ["gethit", []];
_unit addEventHandler
[
"HandleDamage",
{
	_unit = _this select 0;
	_selections = _unit getVariable ["selections", []];
	_gethit = _unit getVariable ["gethit", []];
	_selection = _this select 1;
	if !(_selection in _selections) then
	{
		_selections set [count _selections, _selection];
		_gethit set [count _gethit, 0];
	};
	_i = _selections find _selection;
	_olddamage = _gethit select _i;
	_damage = _olddamage + ((_this select 2) - _olddamage) * 0.2;
	_gethit set [_i, _damage];
	_damage;
}
];

Run from Helicopter's Init:

null = [this] execVM "heliHP.sqf";

 

PS: The 0.2 is supposed to be the damage multiplier. So 0.2 means the Heli Part that is being damaged should be only be getting 20% of the total damage.

Share this post


Link to post
Share on other sites
7 hours ago, LSValmont said:

I found this script for Arma 2 and I was wondering if it would still work correctly for Arma 3.

 

I have tried it on several helicopters and they all seemed to go down just as fast as without it.

 

Script: 


if (!isServer) exitWith {};

_unit = _this select 0;

_unit setVariable ["selections", []];
_unit setVariable ["gethit", []];
_unit addEventHandler
[
"HandleDamage",
{
	_unit = _this select 0;
	_selections = _unit getVariable ["selections", []];
	_gethit = _unit getVariable ["gethit", []];
	_selection = _this select 1;
	if !(_selection in _selections) then
	{
		_selections set [count _selections, _selection];
		_gethit set [count _gethit, 0];
	};
	_i = _selections find _selection;
	_olddamage = _gethit select _i;
	_damage = _olddamage + ((_this select 2) - _olddamage) * 0.2;
	_gethit set [_i, _damage];
	_damage;
}
];

Run from Helicopter's Init:

null = [this] execVM "heliHP.sqf";

 

PS: The 0.2 is supposed to be the damage multiplier. So 0.2 means the Heli Part that is being damaged should be only be getting 20% of the total damage.

You can put this directly in a vehicles init for the effect to work

 

Quote

this addEventHandler ["HandleDamage",  

params ["_unit", "_selection", "_damage"]; 
(_damage * 0.5) 
}];

Vehicle should recieve 0.5 damage. Handlingdamage doesnt always work as perfectly as you might expect,particularly on veihicles.Remember there are many points of the vehicle were armour is thinner.

 

You should post in the mission editing an scripting section for better help.

  • Thanks 1

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  

×