How to add Humanity to ai kills + or - based on players humanity

You need to add this to DZAI/DZAI_settings_override.sqf:
DZAI_humanityGain = 10;
Where 10 is whatever number you want, positive or negative.

You can check DZAI/init/dzai_config.sqf for other defaults and add your own values to DZAI/DZAI_settings_override.sqf to override as needed.
 
private ["_unit","_player","_humanity","_banditkills"];
_unit = _this select 0;
_player = _this select 1;

//If the killer is a player, lets handle the humanity

if (isPlayer _player) then {
private ["_banditkills","_humanity"];

//diag_log text format ["[DZMS]: Debug: Unit killed by %1 at %2", _player, mapGridPosition _unit];

//Lets grab some info
_humanity = _player getVariable ["humanity",0];
_banditkills = _player getVariable ["banditKills",0];

//If the player gets humanity per config, lets give it
if (DZMSMissHumanity) then {
_player setVariable ["humanity",(_humanity + DZMSCntHumanity),true];
};

//If this counts as a bandit kill, lets give it
if (DZMSCntBanditKls) then {
_player setVariable ["banditKills",(_banditkills + 1),true];
};

//Lets inform the nearby AI of roughly the players position
//This makes the AI turn and react instead of laying around
{
if (((position _x) distance (position _unit)) <= 300) then {
_x reveal [_player, 4.0];
}
} forEach allUnits;



wondering how to add this to dzai its from a good mission system
 
These features are already in DZAI. The humanity is configured as already stated and finding the killer of an AI is enabled by default (DZAI_findKiller option).
 
Back
Top