General > Questions & Suggestions

AI skills

(1/1)

tarkka-ampuja24:
How to get AI different skills, or mostly random skills.
Those who move on foot may have different skills than those who fly or drive a vehicle.
Is it possible to do this? :-\


what I have done and works well, but could do better.

if (!isServer) exitWith {};

private ["_unit", "_skill", "_accuracy", "aimingShake", "_aimingSpeed", "_SpotDistance", "_SpotTime", "_courage", "_reloadSpeed", "_Commanding"];
_unit = _this;

if (["A3W_missionsDifficulty"] call isConfigOn) then
{
   _skill = 0.65; // Default skill for ARMA3 is 0.5
   _accuracy = 1; // Relative multiplier; absolute default accuracy for ARMA3 is 0.25
   _aimingShake = 0.5; // Affects how steadily the AI can hold a weapon
   _aimingSpeed = 0.5; // Affects how quickly the AI can rotate and stabilize its aim
   _SpotDistance = 0.5; // Affects the AI ability to spot targets within it's visual or audible range
   _SpotTime = 0.5; // Affects how quick the AI react to death, damage or observing an enemy
   _courage = 1; // Affects unit's subordinates' morale
   _reloadSpeed =  0.96; // Affects the delay between switching or reloading a weapon
   _Commanding = 1; // Affects how quickly recognized targets are shared with the group

}
else
{
   _skill = 0.65 + (random 0.35);
   _accuracy = 0.75 + (random 0.25);
   _aimingShake = 0.55 + (random 0.45);
   _aimingSpeed = 0.69 + (random 0.31);
   _SpotDistance = 0.89 + (random 0.11);
   _SpotTime = 0.65 + (random 0.35);
   _courage = 1;
   _reloadSpeed = 0.96 + (random 0.04);
   _Commanding = 1;
};

_unit allowFleeing 0;
_unit setSkill _skill;
_unit setSkill ["aimingAccuracy", (_unit skill "aimingAccuracy") * _accuracy];
_unit setSkill ["aimingShake", (_unit skill "aimingShake") * _aimingShake];
_unit setSkill ["aimingSpeed", (_unit skill "aimingSpeed") * _aimingSpeed];
_unit setSkill ["spotDistance", (_unit skill "spotDistance") * _SpotDistance];
_unit setSkill ["spotTime", (_unit skill "spotTime") * _SpotTime];
_unit setSkill ["courage", (unit skill "courage") * _courage];
_unit setSkill ["reloadSpeed", (unit skill "reloadSpeed") * _reloadSpeed];
_unit setSkill ["commanding", (unit skill "commanding") * _Commanding];

Navigation

[0] Message Index

Go to full version