Login  Register

Re: RELEASE: HM Celle SP (ROLLING UPDATES IN THE COMMENTS)

Posted by DayZ_SP on Dec 28, 2012; 4:42pm
URL: http://kodabar-dayz-daizy-single-player-forum.163.s1.nabble.com/WIP-DaiZy-RSPB-Celle-1-7-5-1-60-lootable-player-skins-190-new-weapons-and-more-tp1807p1825.html

If you want Expert Level AI, copy this to the "fn_setSkills.sqf" (erase what is already there):

/*
        Usage: [_unit] call fnc_setSkill;
*/
        // private[""];
        _unit = _this select 0;

    _unit setSkill ["aimingAccuracy",1];
    _unit setSkill ["aimingShake",0];
    _unit setSkill ["aimingSpeed",1];
    _unit setSkill ["endurance",1];
    _unit setSkill ["spotDistance",1];
    _unit setSkill ["spotTime",1];
    _unit setSkill ["courage",1];'
    _unit setSkill ["reloadSpeed",1];
    _unit setSkill ["commanding",1];
    _unit setSkill ["general",1];
Then add it to the AI Bandit, or AI Survivor script:

[_unit] call fn_setSkills;

================================================================================

This makes the AI the best they can be supposedly, but they still aren't that good if you get the drop on them form behind, or are just an avid ArmA 2 player.

An alternative one that supposedly randomizes their skills is this:

*
        Usage: [_unit] call fnc_setSkills;
*/

        private ["_p","_aimingAccuracy", "_aimingShake", "_aimingSpeed", "_endurance", "_spotDistance", "_spotTime", "_courage", "_reloadSpeed", "_commanding", "_general"];
        _p = 2;
        SkillsArray = [];

        while {_p <= 24} do {
                _aimingAccuracy = (0.65 + (random 0.95)); _Aiming = _Aiming + ((random (1 - _Aiming)) / 2);
                _aimingShake =    (0.65 + (random 0.95)); _aimingShake = _aimingShake + ((random (1 - _aimingShake)) / 2);
                _aimingSpeed =  (0.65 + (random 0.95)); _aimingSpeed = _aimingSpeed + ((random (1 - _aimingSpeed)) / 2);
                _endurance =  (0.65 + (random 0.95)); _Endurance = _Endurance + ((random (1 - _Endurance)) / 2);
                _spotDistance =   (0.65 + (random 0.95)); _SpotDistance = _SpotDistance + ((random (1 - _SpotDistance)) / 2);
                _spotTime =       (0.65 + (random 0.95)); _SpotTime = _SpotTime + ((random (1 - _SpotTime)) / 2);
                _courage =        (0.65 + (random 0.95)); _courage = _courage + ((random (1 - _courage)) / 2);
                _reloadSpeed =    (0.65 + (random 0.95)); _reloadSpeed = _reloadSpeed + ((random (1 -    _reloadSpeed)) / 2);
                _commanding =     (0.65 + (random 0.95)); _Command = _Command + ((random (1 - _Command)) / 2);
                _general  =       (0.65 + (random 0.95)); _general = _general + ((random (1 - _general)) / 2);
               
                SkillsArray = SkillsArray + [[_aimingAccuracy,_aimingShake,_aimingSpeed,_endurance,_spotDistance,_spotTime,_courage,_reloadSpeed,_commanding,_general]];

                _p = _p + 1;
        };

        if (isMultiplayer) then {
                publicVariable "SkillsArray";
        };
The example above is NOT randomized; You need to change the values (0.65; random 0.95) to be DIFFERENT values for each entry, so the formula will NOT return the same value for every entry.