Super Ai Cannot Find Script

Discussion in 'OpenDayZ' started by Futcher, Feb 9, 2015.

  1. Futcher

    Futcher New Member

    Joined:
    Feb 9, 2015
    Messages:
    3
    Likes Received:
    0
    Not sure if this is being posted in the right section.
    I need some help finding a script.
    It's a super Ai compound for Dayz Epoch.

    Its in this video i managed to find.


    Can anyone tell me what the script is? Or have a link for it?
    Or does anyone have an ai that's similar to this. We are wanting a super ai for our players to fight.

    Anything would be appreciated.

    Regards
     
  2. ShootingBlanks

    ShootingBlanks OpenDayZ Guru!

    Joined:
    Mar 31, 2013
    Messages:
    2,411
    Likes Received:
    336
    there is no secret to creating AI if you just want a group of AI in one area you could use Dzia or Wai spawns and then just set the numbers and the skill levels high... you don't even need to use the scripts you can just use a bunch of Create units and then the skills to 1
     
  3. Futcher

    Futcher New Member

    Joined:
    Feb 9, 2015
    Messages:
    3
    Likes Received:
    0
    Yeah I understand that, if you watched that video, the ai in it is incredibly tough and accurate.. he's alerted to basically anything.
    He can take around 15 as50 nato rounds to the head before he dies.
    Is there a way to make the ai take less damage regardless of the weapon? or just take more damage?
     
  4. ShootingBlanks

    ShootingBlanks OpenDayZ Guru!

    Joined:
    Mar 31, 2013
    Messages:
    2,411
    Likes Received:
    336
    yes,
    edit the damagehandler script. it would,be in dayz_code and you have to import it into your mission and point the compiles.sqf to the new one.

    unless the dzai has its own damagehandler .... look in the dzai,file,where they are created and see what damagehandler event is,given to the ai
     
  5. ShootingBlanks

    ShootingBlanks OpenDayZ Guru!

    Joined:
    Mar 31, 2013
    Messages:
    2,411
    Likes Received:
    336
    I was looking for something else and figured I would find this for you.
    DZAI has its own damagehandler for the AI.
    Code:
    DZAI_AI_handledamage = compile preprocessFileLineNumbers format ["%1\compile\fn_damageHandlerAI2.sqf",DZAI_directory];
    
    and that file looks like this so you can poke around and make some edits and see what happens. Of course you would then have to make sure you used the DZAI for your Super AI. And this would affect ALL the ai. If you want just one group to be SUPERAI then create a copy of this file and then assign just that damagehandler to the special ai

    Code:
    private["_unit","_hit","_damage","_source","_ammo","_unithealth","_scale","_blooddamage","_newbloodlevel","_headShots","_partdamage","_deathType","_headHit"];
    /*
        Damage Handler script modified for DZAI
        Simulates DayZ's player health system for individual AI units
       
    */
    _unit =         _this select 0;                //Object the event handler is assigned to. (the unit taking damage)
    _hit =             _this select 1;                //Name of the selection where the unit was damaged. "" for over-all structural damage, "?" for unknown selections. 
    _damage =         _this select 2;                //Resulting level of damage for the selection. (Received damage)
    _source =         _this select 3;                //The source unit that caused the damage. 
    _ammo =         _this select 4;                //Classname of the projectile that caused inflicted the damage. ("" for unknown, such as falling damage.) 
    
    if ((group _unit) == (group _source)) then {_damage = (_damage/10)};    //Reduce friendly fire and collision damage.
    //if (isNil {_unit getVariable "unithealth"}) then {_unit setVariable ["unithealth",[12000,0,false]]};    //Reset initial health stats if not found
    _unithealth = _unit getVariable "unithealth";         // Retrieve unit's health statistics
    
    _scale = 300;
    _deathType = "bled";
    _headHit = (_hit == "head_hit");
    if (_damage > 0.4) then {
        //Calculate locational damage
        call {
            if (_hit == "legs") exitWith {
                _partdamage = (_unithealth select 1) + (_damage/2);
                _unithealth set [1,_partdamage];    //Record leg damage internally
                if ((_partdamage >= 1) && {!(_unithealth select 2)}) then {
                    _nul = _unit spawn {_this setHit["legs",1]}; //Break legs when enough damage taken
                    [nil,_unit,rSAY,["z_fracture_1",40]] call RE;
                    _unithealth set [2,true];
                }; 
            };
            if (_headHit) exitWith {
                _scale = _scale + 500;
            };
        };
       
        //special death types
        call {
            if (_ammo isKindOf "GrenadeBase") exitWith {
                _scale = _scale + 200;
                if (_damage > 4) then {
                    _deathType = "explosion";
                    _scale = 12000;    //sufficient grenade damage causes instant death
                };
            };
            if ((_ammo isKindOf "B_127x107_Ball") or (_ammo isKindOf "B_127x99_Ball")) exitWith {
                _scale = _scale + 200;
                if (_damage > 4) then {
                    _deathType = "shotheavy";
                    _scale = 12000;    //sufficient high calibre damage causes instant death
                };
            };
        };
       
        //additional damage if attacker is a player
        if (isPlayer _source) then {
            _scale = _scale + 800;
            if (_headHit) then {
                _scale = _scale + 500;
                if (_damage > 1.5) then {
                    _deathType = "shothead";
                    _scale = 12000;    //sufficient head shot damage causes instant death
                };
            };
        };
        _blooddamage = (_damage * _scale);
        _newbloodlevel = (_unithealth select 0) - _blooddamage;
        _unithealth set [0,_newbloodlevel];
       
        //Uncomment the following line to report blood damage to rpt log
        //diag_log format ["DEBUG :: Unit %1 took %2 blood damage in part %3 by ammo %4 (Blood level: %5).",_unit,_blooddamage,_hit,_ammo,_newbloodlevel];
       
        if (_newbloodlevel < 0) then {
            _nul = [_unit,_source,_deathType] call DZAI_unitDeath;
            diag_log format ["DEBUG :: %1 was killed by %2 from %3m. Cause: %4.",_unit,_source,(_unit distance _source),_deathType];
        } else {
            if (!(_unit getVariable ["unconscious",false]) && {((_damage > 2) || {((_damage > 0.5) && (_hit == "head_hit"))})}) then {_nul = [_unit,_hit] spawn DZAI_unconscious; _unit setVariable ["unconscious",true];};
        };
    };
    
    0
    
    
     
  6. Futcher

    Futcher New Member

    Joined:
    Feb 9, 2015
    Messages:
    3
    Likes Received:
    0
    Mate thats awesome, thanks for the help.
    I'll get into using it.
     
  7. ShootingBlanks

    ShootingBlanks OpenDayZ Guru!

    Joined:
    Mar 31, 2013
    Messages:
    2,411
    Likes Received:
    336
    its NOT as awesome as you seem to think, i didnt edit that file. it wont take much to edit it though how you want.
    there is already a block for headshots and just have to change all the damage scales
     

Share This Page