Jump to content

McKeighan

Member
  • Posts

    59
  • Joined

  • Last visited

Reputation Activity

  1. Like
    McKeighan got a reaction from 31_D!4b10 in [Release] Random Speed Zombies (walking and running)   
    I will start by saying I am assuming everyone reading this knows how to make changes to their mission files and incorporate changes to dayz_code files with the mission files themselves. (using a custom subdirectory). If you need to be walked through this process... perhaps these changes aren't for you  ;)
     
    A quick note about speeds...
    Your speeds are set with something called "forcespeed" and can be 0,1,2, and anything bigger then 2. 0 is immobile, 1 is super slow movement (looks stupid), 2 is what you're used to seeing out of a loitering zombie, and >2 is running. There IS one number I've found that makes them run faster then players... But it's not scalar. I use 8 for our running zombies, and they run at the normal speed.... Anyway.


    Files that need to be altered  (and subsequently moved into your missions folder).
    compiles.sqf

    The lines you're looking for are similar to the following (around line 76 of the standard Epoch code).

     
    //Zombies zombie_findTargetAgent = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_findTargetAgent.sqf"; zombie_loiter = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_loiter.sqf"; //Server compile, used for loiter behaviour zombie_generate = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_generate.sqf"; //Server compile, used for loiter behaviour wild_spawnZombies = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\wild_spawnZombies.sqf"; //Server compile, used for loiter behaviour and should be updated like below (I've always found it easier to mimic the origional epoch code with my directory stucture in my custom area).
    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"; Next... Onto each file in turn.

    zombie_loiter.sqf - I've actually left it completely alone, but brought it into my mission file in case I need to tweak anything in the future. 

    zombie_generate.sqf - Here's where it gets interesting.

    You'll find this near the bottom of the file.
    //Disable simulation PVDZE_Server_Simulation = [_agent, false]; publicVariableServer "PVDZE_Server_Simulation"; //Start behavior _id = [_position,_agent] execFSM "\z\AddOns\dayz_code\system\zombie_agent.fsm"; }; you need to update it to the following.
     
    // Set zombie initial walkspeed _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"; }; you also should update the private variable call at the top of that file to include the _isrunner variable
    private ["_position","_unitTypes","_radius","_method","_agent","_isrunner"]; In the wildspawn_zombies.sqf, do simular updates.

     
    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"; as you may of surmised, you're not quite done... you also have to edit the zombie_agent.fsm file. 

    In the init step (red box at the top of the flowchart), change that coding to the following
     
    _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)); }; in the "chase" box, change the coding to the following.

     
    _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; _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 < 10) then {_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 == 2) then {     _losCheck = 0;     _cantSee = [_agent,_target] call dayz_losCheck; }; And that's it... You now have Zombies that determine their top speed as soon as they're spawned in, with a 20% chance to be fast.  If you want more to be faster, alter the _rnd check in the wildspawn and zombie generate sqf's.


    Clearly, you could do many other things then just do a random chance.

    Further development could lead to the following  (all of these are currently in development on my testbed...)
    Zombie Speed based on skin Zombie Speed based on type of building that spawned them Zombie Speed based on time of day (in game). Zombie Speed based on length of time the zombie has been "alive". Anyway, hope this makes sense to some of you that have been looking for this solution!
    - McK
  2. Like
    McKeighan reacted to calamity in Overwatch vehicles/heli/jets in dynamic spawn/traders   
    for battle eye kicks you need to read your createvehicle.log, find the kick usually the last couple lines and then go into createvehicle.txt and addthe filter for it like this
     
    like if you add the hmmwv with the grenade launcher  and when you fire it you get kicked
    open the creatvehicle log you woulld see  createvehicle restriction #0 "HMMWV_Mk19_USArmy"
    so go into createvehicle.txt and add an exception 
    5 "MK19" // this will kick for anything that has MK19 in it
     
    != //this means except
    so
     
    5 "MK19" !="HMMWV_Mk19_USArmy"
     
    will still kick for anything with MK19 in it except HMMWV_Mk19_USArmy
  3. Like
    McKeighan reacted to thevisad in [Release] Random Speed Zombies (walking and running)   
    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; };
  4. Like
    McKeighan got a reaction from thevisad in [Release] Random Speed Zombies (walking and running)   
    Ah gotcha.   Got a fix in mind....

    oh duh.

     
    if (count _this > 3) then {     _secondHand = true; right?
  5. Like
    McKeighan got a reaction from BetterDeadThanZed in [Release] Random Speed Zombies (walking and running)   
    I will start by saying I am assuming everyone reading this knows how to make changes to their mission files and incorporate changes to dayz_code files with the mission files themselves. (using a custom subdirectory). If you need to be walked through this process... perhaps these changes aren't for you  ;)
     
    A quick note about speeds...
    Your speeds are set with something called "forcespeed" and can be 0,1,2, and anything bigger then 2. 0 is immobile, 1 is super slow movement (looks stupid), 2 is what you're used to seeing out of a loitering zombie, and >2 is running. There IS one number I've found that makes them run faster then players... But it's not scalar. I use 8 for our running zombies, and they run at the normal speed.... Anyway.


    Files that need to be altered  (and subsequently moved into your missions folder).
    compiles.sqf

    The lines you're looking for are similar to the following (around line 76 of the standard Epoch code).

     
    //Zombies zombie_findTargetAgent = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_findTargetAgent.sqf"; zombie_loiter = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_loiter.sqf"; //Server compile, used for loiter behaviour zombie_generate = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_generate.sqf"; //Server compile, used for loiter behaviour wild_spawnZombies = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\wild_spawnZombies.sqf"; //Server compile, used for loiter behaviour and should be updated like below (I've always found it easier to mimic the origional epoch code with my directory stucture in my custom area).
    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"; Next... Onto each file in turn.

    zombie_loiter.sqf - I've actually left it completely alone, but brought it into my mission file in case I need to tweak anything in the future. 

    zombie_generate.sqf - Here's where it gets interesting.

    You'll find this near the bottom of the file.
    //Disable simulation PVDZE_Server_Simulation = [_agent, false]; publicVariableServer "PVDZE_Server_Simulation"; //Start behavior _id = [_position,_agent] execFSM "\z\AddOns\dayz_code\system\zombie_agent.fsm"; }; you need to update it to the following.
     
    // Set zombie initial walkspeed _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"; }; you also should update the private variable call at the top of that file to include the _isrunner variable
    private ["_position","_unitTypes","_radius","_method","_agent","_isrunner"]; In the wildspawn_zombies.sqf, do simular updates.

     
    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"; as you may of surmised, you're not quite done... you also have to edit the zombie_agent.fsm file. 

    In the init step (red box at the top of the flowchart), change that coding to the following
     
    _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)); }; in the "chase" box, change the coding to the following.

     
    _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; _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 < 10) then {_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 == 2) then {     _losCheck = 0;     _cantSee = [_agent,_target] call dayz_losCheck; }; And that's it... You now have Zombies that determine their top speed as soon as they're spawned in, with a 20% chance to be fast.  If you want more to be faster, alter the _rnd check in the wildspawn and zombie generate sqf's.


    Clearly, you could do many other things then just do a random chance.

    Further development could lead to the following  (all of these are currently in development on my testbed...)
    Zombie Speed based on skin Zombie Speed based on type of building that spawned them Zombie Speed based on time of day (in game). Zombie Speed based on length of time the zombie has been "alive". Anyway, hope this makes sense to some of you that have been looking for this solution!
    - McK
  6. Like
    McKeighan reacted to CordIAsis in Spawn Zombie Horde   
    I beleive zombies are agents, which don't get assigned to groups.
  7. Like
    McKeighan got a reaction from SmokeyBR in [Release] Random Speed Zombies (walking and running)   
    I will start by saying I am assuming everyone reading this knows how to make changes to their mission files and incorporate changes to dayz_code files with the mission files themselves. (using a custom subdirectory). If you need to be walked through this process... perhaps these changes aren't for you  ;)
     
    A quick note about speeds...
    Your speeds are set with something called "forcespeed" and can be 0,1,2, and anything bigger then 2. 0 is immobile, 1 is super slow movement (looks stupid), 2 is what you're used to seeing out of a loitering zombie, and >2 is running. There IS one number I've found that makes them run faster then players... But it's not scalar. I use 8 for our running zombies, and they run at the normal speed.... Anyway.


    Files that need to be altered  (and subsequently moved into your missions folder).
    compiles.sqf

    The lines you're looking for are similar to the following (around line 76 of the standard Epoch code).

     
    //Zombies zombie_findTargetAgent = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_findTargetAgent.sqf"; zombie_loiter = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_loiter.sqf"; //Server compile, used for loiter behaviour zombie_generate = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_generate.sqf"; //Server compile, used for loiter behaviour wild_spawnZombies = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\wild_spawnZombies.sqf"; //Server compile, used for loiter behaviour and should be updated like below (I've always found it easier to mimic the origional epoch code with my directory stucture in my custom area).
    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"; Next... Onto each file in turn.

    zombie_loiter.sqf - I've actually left it completely alone, but brought it into my mission file in case I need to tweak anything in the future. 

    zombie_generate.sqf - Here's where it gets interesting.

    You'll find this near the bottom of the file.
    //Disable simulation PVDZE_Server_Simulation = [_agent, false]; publicVariableServer "PVDZE_Server_Simulation"; //Start behavior _id = [_position,_agent] execFSM "\z\AddOns\dayz_code\system\zombie_agent.fsm"; }; you need to update it to the following.
     
    // Set zombie initial walkspeed _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"; }; you also should update the private variable call at the top of that file to include the _isrunner variable
    private ["_position","_unitTypes","_radius","_method","_agent","_isrunner"]; In the wildspawn_zombies.sqf, do simular updates.

     
    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"; as you may of surmised, you're not quite done... you also have to edit the zombie_agent.fsm file. 

    In the init step (red box at the top of the flowchart), change that coding to the following
     
    _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)); }; in the "chase" box, change the coding to the following.

     
    _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; _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 < 10) then {_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 == 2) then {     _losCheck = 0;     _cantSee = [_agent,_target] call dayz_losCheck; }; And that's it... You now have Zombies that determine their top speed as soon as they're spawned in, with a 20% chance to be fast.  If you want more to be faster, alter the _rnd check in the wildspawn and zombie generate sqf's.


    Clearly, you could do many other things then just do a random chance.

    Further development could lead to the following  (all of these are currently in development on my testbed...)
    Zombie Speed based on skin Zombie Speed based on type of building that spawned them Zombie Speed based on time of day (in game). Zombie Speed based on length of time the zombie has been "alive". Anyway, hope this makes sense to some of you that have been looking for this solution!
    - McK
  8. Like
    McKeighan reacted to CartoonrBOY in [Release] Random Speed Zombies (walking and running)   
    This is intriguing. Certainly worth looking at. I'd rather have more walkers during night-time and more runners during the day. I too think this is possible. Thanks muchly for the share...beans.
     
     
    Edit to speed assignment (untested).
     
    zombie_generate.sqf & wildspawn_zombies.sqf:
    // Slow zombie down. _agent forceSpeed 2; // Create random runners during daytime only _rnd = random(1); if(daytime > 6 || daytime < 18) then { if (_rnd > .8) then { _isrunner = true; } else { _isrunner = false; }; } else { _isrunner = false; };
  9. Like
    McKeighan got a reaction from CartoonrBOY in [Release] Random Speed Zombies (walking and running)   
    I will start by saying I am assuming everyone reading this knows how to make changes to their mission files and incorporate changes to dayz_code files with the mission files themselves. (using a custom subdirectory). If you need to be walked through this process... perhaps these changes aren't for you  ;)
     
    A quick note about speeds...
    Your speeds are set with something called "forcespeed" and can be 0,1,2, and anything bigger then 2. 0 is immobile, 1 is super slow movement (looks stupid), 2 is what you're used to seeing out of a loitering zombie, and >2 is running. There IS one number I've found that makes them run faster then players... But it's not scalar. I use 8 for our running zombies, and they run at the normal speed.... Anyway.


    Files that need to be altered  (and subsequently moved into your missions folder).
    compiles.sqf

    The lines you're looking for are similar to the following (around line 76 of the standard Epoch code).

     
    //Zombies zombie_findTargetAgent = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_findTargetAgent.sqf"; zombie_loiter = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_loiter.sqf"; //Server compile, used for loiter behaviour zombie_generate = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_generate.sqf"; //Server compile, used for loiter behaviour wild_spawnZombies = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\wild_spawnZombies.sqf"; //Server compile, used for loiter behaviour and should be updated like below (I've always found it easier to mimic the origional epoch code with my directory stucture in my custom area).
    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"; Next... Onto each file in turn.

    zombie_loiter.sqf - I've actually left it completely alone, but brought it into my mission file in case I need to tweak anything in the future. 

    zombie_generate.sqf - Here's where it gets interesting.

    You'll find this near the bottom of the file.
    //Disable simulation PVDZE_Server_Simulation = [_agent, false]; publicVariableServer "PVDZE_Server_Simulation"; //Start behavior _id = [_position,_agent] execFSM "\z\AddOns\dayz_code\system\zombie_agent.fsm"; }; you need to update it to the following.
     
    // Set zombie initial walkspeed _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"; }; you also should update the private variable call at the top of that file to include the _isrunner variable
    private ["_position","_unitTypes","_radius","_method","_agent","_isrunner"]; In the wildspawn_zombies.sqf, do simular updates.

     
    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"; as you may of surmised, you're not quite done... you also have to edit the zombie_agent.fsm file. 

    In the init step (red box at the top of the flowchart), change that coding to the following
     
    _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)); }; in the "chase" box, change the coding to the following.

     
    _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; _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 < 10) then {_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 == 2) then {     _losCheck = 0;     _cantSee = [_agent,_target] call dayz_losCheck; }; And that's it... You now have Zombies that determine their top speed as soon as they're spawned in, with a 20% chance to be fast.  If you want more to be faster, alter the _rnd check in the wildspawn and zombie generate sqf's.


    Clearly, you could do many other things then just do a random chance.

    Further development could lead to the following  (all of these are currently in development on my testbed...)
    Zombie Speed based on skin Zombie Speed based on type of building that spawned them Zombie Speed based on time of day (in game). Zombie Speed based on length of time the zombie has been "alive". Anyway, hope this makes sense to some of you that have been looking for this solution!
    - McK
  10. Like
    McKeighan got a reaction from GaspArt in [Release] Random Speed Zombies (walking and running)   
    I will start by saying I am assuming everyone reading this knows how to make changes to their mission files and incorporate changes to dayz_code files with the mission files themselves. (using a custom subdirectory). If you need to be walked through this process... perhaps these changes aren't for you  ;)
     
    A quick note about speeds...
    Your speeds are set with something called "forcespeed" and can be 0,1,2, and anything bigger then 2. 0 is immobile, 1 is super slow movement (looks stupid), 2 is what you're used to seeing out of a loitering zombie, and >2 is running. There IS one number I've found that makes them run faster then players... But it's not scalar. I use 8 for our running zombies, and they run at the normal speed.... Anyway.


    Files that need to be altered  (and subsequently moved into your missions folder).
    compiles.sqf

    The lines you're looking for are similar to the following (around line 76 of the standard Epoch code).

     
    //Zombies zombie_findTargetAgent = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_findTargetAgent.sqf"; zombie_loiter = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_loiter.sqf"; //Server compile, used for loiter behaviour zombie_generate = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_generate.sqf"; //Server compile, used for loiter behaviour wild_spawnZombies = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\wild_spawnZombies.sqf"; //Server compile, used for loiter behaviour and should be updated like below (I've always found it easier to mimic the origional epoch code with my directory stucture in my custom area).
    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"; Next... Onto each file in turn.

    zombie_loiter.sqf - I've actually left it completely alone, but brought it into my mission file in case I need to tweak anything in the future. 

    zombie_generate.sqf - Here's where it gets interesting.

    You'll find this near the bottom of the file.
    //Disable simulation PVDZE_Server_Simulation = [_agent, false]; publicVariableServer "PVDZE_Server_Simulation"; //Start behavior _id = [_position,_agent] execFSM "\z\AddOns\dayz_code\system\zombie_agent.fsm"; }; you need to update it to the following.
     
    // Set zombie initial walkspeed _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"; }; you also should update the private variable call at the top of that file to include the _isrunner variable
    private ["_position","_unitTypes","_radius","_method","_agent","_isrunner"]; In the wildspawn_zombies.sqf, do simular updates.

     
    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"; as you may of surmised, you're not quite done... you also have to edit the zombie_agent.fsm file. 

    In the init step (red box at the top of the flowchart), change that coding to the following
     
    _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)); }; in the "chase" box, change the coding to the following.

     
    _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; _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 < 10) then {_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 == 2) then {     _losCheck = 0;     _cantSee = [_agent,_target] call dayz_losCheck; }; And that's it... You now have Zombies that determine their top speed as soon as they're spawned in, with a 20% chance to be fast.  If you want more to be faster, alter the _rnd check in the wildspawn and zombie generate sqf's.


    Clearly, you could do many other things then just do a random chance.

    Further development could lead to the following  (all of these are currently in development on my testbed...)
    Zombie Speed based on skin Zombie Speed based on type of building that spawned them Zombie Speed based on time of day (in game). Zombie Speed based on length of time the zombie has been "alive". Anyway, hope this makes sense to some of you that have been looking for this solution!
    - McK
  11. Like
    McKeighan got a reaction from raymix in Scripting wish.   
    In a way I agree with Gagi2..... Understanding the code is a right of passage... A hurdle to separate those that can from those that barely can.

    That being said, it IS quite difficult when trying to learn a new way of doing something to have no reference point to what you're looking at.  (the setvector for instance).   If I'm trying to throw something together and get it figured out, I generally find some code here or on open dayz that has a similar thought to what i'm working on, and then private message the author directly to ask questions.  It not only acknowledges them for being someone that knows what the hell they're doing, but also allows them to help you understand more then a comment possibly ever could. (assuming of course, you're not annoying, keep your questions to a productive minimum, and don't proceed to claim any of what they helped you with as being your own.)

    (*In the kudo's bucket, Thanks to Raymix, Rimblock, and Zupa for helping steer my projects on the right path, whether you know it or not).
  12. Like
    McKeighan reacted to vbawol in Extortion and the joys of ARMA: Update v2   
    Arma has so much to offer and is a very flexible and fun game to play and mod. With this flexibility comes insecurity and a dark side.

    Yesterday I spoke with one of the "kids" that have been terrorizing our servers. He is demanding server files in exchange for stopping the attacks. I told him that the server files would have been released to more communities by now if we had something proven stable and secure. Something that this hack-a-thon is stopping us from doing. He offered up one exploit and then immediately started demanding that we give the server files in exchange. He then said that if we did not give them the server files in 24 hours the hacking would continue, and it has.
    Simply put, the current exploit they are using is a fault in ARMA and not an issue with our mod and will ultimately need to be fixed by BI.
    Please vote for this issue to get the attention it deserves: http://feedback.arma3.com/view.php?id=20994
     
    Until this issue is fixed by BI or another fix is found we will no longer be running any public servers. All servers run my me will only be accessible with a password obtained from me or Axle. We will have a few communities that will likely run whitelisted servers so look out for them to pop up on our servers page: http://epochmod.com/servers.php
     
    Now back to developing.
×
×
  • Create New...