Jump to content

thevisad

Member
  • Posts

    7
  • Joined

  • Last visited

Posts posted by thevisad

  1. If you really want to get fancy, use this block from Unleashed for the zed movement, in conjunction with your mod. I ripped out our agro, speed and targeting controls. 

    _timeN = time;
    
    if (speed _agent < 0.1) then {_countr = _countr + 1} else {_countr = 0};
    _target = _agent call zombie_findTargetAgent;
    _targetPosition = getPosATL _target;
    _agentPosition = getPosATL _agent;
    
    _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];
    _agent moveTo _targetPos;
    
    //Zombie Speed Assignment
    
    if (_isrunner) then {
    	_agent forceSpeed 8;
    } else {
    	_agent forceSpeed 2;
    };
    
    if (_losCheck == 2) then {
    	_losCheck = 0;
    	_cantSee = [_agent,_target] call dayz_losCheck;
    };
    
  2. You're missing the issue, second hand zombies where used for debugging and are not normally the process in which they are handled. It was toggled by sending the variable debug, causing _this to be more then 2. You have now added a third option to _this, triggering second hand zombies to occur. Now the debug script is running and the zombies all target and move towards the player. Spawn in a city, go into a building and stand, within minutes you will have zombies coming towards your position. Setting them to forcespeed of 2 only slows the transition down. As it shows in the below code example, it is told that if it is a second hand zombie, then move to this location. 

     

    The loiter behavior remains the same thevisad (server standard). Within that file, down near the bottom, all loitering zombies are set with a forcespeed of 2. This puts them back into the loiter behavior, and not just wandering around at some silly fast speed.

    if (_secondHand) then {
        diag_log ("Zombie " + str(_agent) + " Loiter " + " distance: " + str(_newDest distance _myDest));
        _agent doMove (getPosATL player);
        _agent moveTo (getPosATL player);
    };
  3. _position = _this select 0;
    _agent = _this select 1;
    _secondHand = false;
    _isrunner = _this select 2;
    
    if (count _this > 2) then {
    	_secondHand = true;
    	//diag_log ("Second Hand Zombie Initialized: " + str(_this));
    };
    

    You have now made this a secondhand zombie, which means if you did not correct the the movement in Loiter, then all zombies will move towards the player that created them. 

    
    if (_secondHand) then {
    	diag_log ("Zombie " + str(_agent) + " Loiter " + " distance: " + str(_newDest distance _myDest));
    	_agent doMove (getPosATL player);
    	_agent moveTo (getPosATL player);
    };
×
×
  • Create New...