Hello guys,
I've this piece of code which just is a "damage reduction" script.
this addEventHandler ["HandleDamage", {
_unit = _this select 0;
_selection = _this select 1;
_damage = _this select 2;
if (_selection == "?") exitWith {};
_curDamage = damage _unit;
if (_selection != "") then {_curDamage = _unit getHit _selection};
_newDamage = _damage - _curDamage;
_damage - _newDamage * 0.80
}];
Now, how can i assign this script to be used on all the units? I mean even spawned ones with various methods (Zeus, Alive mod, other spawn scripts) ?
I read I've to put this in my mission's description.ext
class Extended_Init_EventHandlers {
class Man {
init = "_this call (compile preprocessFileLineNumbers 'my_script.sqf')";
};
};
and then just create the "my_script.sqf" file with the lines of code I want to put in all units' init (in this case the damage reduction script above-written).
But sadly this method didn't work for me.
Do you know how to assign a init to all spawned units? I'm so tired of manually edit all the unit xD
Thank you in advance.