Jump to content

drax18

Member
  • Posts

    1
  • Joined

  • Last visited

Posts posted by drax18

  1. So guys i did this. Correct me if i am wrong please :)

    every file is in good place(custom/dayz_code etc ...)

    in compiles.sqf i changed these to:
     

    zombie_loiter             = compile preprocessFileLineNumbers "custom\dayz_code\compile\zombie_loiter.sqf";        

    zombie_generate         = compile preprocessFileLineNumbers "custom\dayz_code\compile\zombie_generate.sqf";        
    wild_spawnZombies         = compile preprocessFileLineNumbers "custom\dayz_code\compile\wild_spawnZombies.sqf";

    in zombie_generate.sqf:
     

    on the top: private ["_position","_unitTypes","_radius","_method","_agent","_isrunner"];


    //Disable simulation
            PVDZE_Server_Simulation = [_agent, false];
            publicVariableServer "PVDZE_Server_Simulation";

            // Make AI Companions fire at zeds
            _agent addRating -1000000;
            // Set zombie initial walkspeed - McK 11/18/14
            _agent forceSpeed 2;
            // Create random runners - McK 11/18/14
            _rnd = random(1);
            if (_rnd > .8) then {
                _isrunner = true;
            } else {
                _isrunner = false;
            };

            //Start behavior
            _id = [_position,_agent,_isrunner] execFSM "custom\dayz_code\system\zombie_agent.fsm";
        };

    in wildspawn_zombies.sqf:
     

    on the top: private ["_unitTypes","_isrunner","_lootType","_lootTypeCfg","_loot_count","_index","_weights","_loot","_array","_player","_doLoiter","_agent","_type","_radius","_method","_position","_isAlive","_myDest","_newDest","_rnd","_id"];

     

    // Slow zombie down.
    _agent forceSpeed 2; 
    // Create random runners 
    _rnd = random(1);
    if (_rnd > .8) then {
        _isrunner = true;
    } else {
        _isrunner = false;
    };

    //Start behavior
    _id = [_position,_agent,_isrunner] execFSM "custom\dayz_code\system\zombie_agent.fsm";

     

    i used fsm editor 

    init box:
     

    _position = _this select 0;

    _agent = _this select 1;
    _secondHand = false;
    _isrunner = _this select 2;

    if (count _this > 3) then {
        _secondHand = true;
        //diag_log ("Second Hand Zombie Initialized: " + str(_this));
    };

    chase box:
     

    _timeN = time;

    if (speed _agent < 0.1then {_countr = _countr + 1else {_countr = 0};
    _target = _agent call zombie_findTargetAgent;
    _targetPosition = getPosATL _target;
    _agentPosition = getPosATL _agent;
    _targetdistance = _agent distance _target;

    //target distance calculation coding provided by the Unleashed Project.

    if ( _targetdistance < 2.2 ) then
    {_r = 1;};
    if (_targetdistance > 2.2 AND _targetdistance < 10then
    {_r = 6;};
    if ( _targetdistance > 10 AND _targetdistance < 25 ) then
    {_r = 8;};
    if ( _targetdistance > 25 ) then
    {_r = 15;};

    _xt = _targetPosition select 0;
    _yt = _targetPosition select 1;
    _xa = _agentPosition select 0;
    _ya = _agentPosition select 1;
    _dx = _xa - _xt;
    _dy = _ya - _yt;
    _dir = _dy atan2 _dx;
    _dx = _dx - _r * cos _dir;
    _dy = _dy - _r * sin _dir;
    _targetPos = [_xt + _dx, _yt + _dy, 0];

    //Move to target
    _agent moveTo _targetPos;

    //The following code is provided by McKeighan to give random zombies speed.

    //flag turns zombie into second hand z once loiter state is re initiated.
    _isaggro = true;

    //this flag is set in the zombie_generate.sqf / wildzombie_generate.sqf

    if (_isrunner) then {
        _agent forceSpeed 8;
    else {
        _agent forceSpeed 2;
    };

    if (_losCheck == 2then {
        _losCheck = 0;
        _cantSee = [_agent,_target] call dayz_losCheck;
    };

     

     

    Is it correct ? Because they are looks like an idiot, and just wandering around, + 1-2 zombies are start to chase and thats all
×
×
  • Create New...