Add back Epoch animals in sched_animals

player_animalCheck is not used
This commit is contained in:
ebaydayz
2016-04-18 14:19:41 -04:00
parent 11741fa710
commit 464c26861c
4 changed files with 20 additions and 66 deletions

View File

@@ -1,58 +0,0 @@
private ["_type"];
_list = getposATL player nearEntities [["CAAnimalBase"],dayz_animalDistance];
if ((count _list < dayz_maxAnimals) and (dayz_currentGlobalAnimals < dayz_maxGlobalAnimals)) then {
//Find where animal likes
_amount = (dayz_maxAnimals - (count _list)) min (dayz_maxGlobalAnimals - dayz_currentGlobalAnimals);
for "_i" from 0 to _amount do {
_animalssupported = ["Chicken","Chicken","Chicken","Cow","Sheep","WildBoar","WildBoar","WildBoar","Goat","Rabbit","Rabbit","Dog"];
_type = (_animalssupported select floor(random(count _animalssupported)));
switch (_type) do {
case "Cow" : {
_animalssupported = ["Cow01","Cow02","Cow03","Cow04","Cow01_EP1"];
_type = (_animalssupported select (floor(random(count _animalssupported))));
};
case "Goat" : {
_animalssupported = ["Goat01_EP1","Goat02_EP1","Goat"];
_type = (_animalssupported select (floor(random(count _animalssupported))));
};
case "Sheep" : {
_animalssupported = ["Sheep","Sheep02_EP1","Sheep01_EP1"];
_type = (_animalssupported select (floor(random(count _animalssupported))));
};
case "Chicken" : {
_animalssupported = ["Hen","Cock"];
_type = (_animalssupported select (floor(random(count _animalssupported))));
};
case "Dog" : {
_animalssupported = ["DZ_Fin","DZ_Pastor"];
_type = (_animalssupported select (floor(random(count _animalssupported))));
};
};
_root = configFile >> "CfgVehicles" >> _type;
_favouritezones = getText ( _root >> "favouritezones");
//_randrefpoint = [position player, 10, dayz_animalDistance, 1, 0, 50, 0] call BIS_fnc_findSafePos;
_randrefpoint = getposATL player;
_PosList = selectbestplaces [_randrefpoint,dayz_animalDistance,_favouritezones,10,5];
_PosSelect = _PosList select (floor random (count _PosList));
_Pos = _PosSelect select 0;
_list = _Pos nearEntities [["CAAnimalBase","Man"],50];
if (player distance _Pos < dayz_animalDistance and NOT surfaceIsWater _Pos and (count _list <= 1)) then {
if (_type == "DZ_Pastor") then {
_agent = createAgent [_type, _Pos, [], 0, "NONE"];
} else {
_agent = createAgent [_type, _Pos, [], 0, "FORM"];
};
//Disable simulation
PVDZ_Server_Simulation = [_agent, false];
publicVariableServer "PVDZ_Server_Simulation";
_agent setpos _Pos;
_id = [_pos,_agent] execFSM "\z\addons\dayz_code\system\animal_agent.fsm";
};
uiSleep 1;
};
};

View File

@@ -25,7 +25,6 @@ if (!isDedicated) then {
fnc_usec_unconscious = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_unconscious.sqf"; fnc_usec_unconscious = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_unconscious.sqf";
player_temp_calculation = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_temperatur.sqf"; //Temperatur System //TeeChange player_temp_calculation = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_temperatur.sqf"; //Temperatur System //TeeChange
player_weaponFiredNear = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_weaponFiredNear.sqf"; player_weaponFiredNear = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_weaponFiredNear.sqf";
//player_animalCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_animalCheck.sqf";
player_spawnCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_spawnCheck.sqf"; player_spawnCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_spawnCheck.sqf";
//player_spawnLootCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_spawnlootCheck.sqf"; //player_spawnLootCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_spawnlootCheck.sqf";
//player_spawnZedCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_spawnzedCheck.sqf"; //player_spawnZedCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_spawnzedCheck.sqf";

View File

@@ -114,9 +114,6 @@ while {1 == 1} do {
}; };
if ((diag_tickTime - _timer) > 300) then { if ((diag_tickTime - _timer) > 300) then {
//Animals
//[] call player_animalCheck;
_timer = diag_tickTime; _timer = diag_tickTime;
}; };

View File

@@ -45,10 +45,26 @@ sched_animals = {
//diag_log [ dayz_maxGlobalAnimals / (1 max count playableUnits), ceil(1.2*(dayz_maxGlobalAnimals - _global) / (1 max count playableUnits)) min (dayz_maxAnimals - _count), _global,dayz_maxAnimals, _count, dayz_maxGlobalAnimals, _global ]; //diag_log [ dayz_maxGlobalAnimals / (1 max count playableUnits), ceil(1.2*(dayz_maxGlobalAnimals - _global) / (1 max count playableUnits)) min (dayz_maxAnimals - _count), _global,dayz_maxAnimals, _count, dayz_maxGlobalAnimals, _global ];
for "_x" from 0 max (2 min (ceil(1.5*(dayz_maxGlobalAnimals - _global) / (1 max count playableUnits)) min (dayz_maxAnimals - _count))) to 1 step -1 do { for "_x" from 0 max (2 min (ceil(1.5*(dayz_maxGlobalAnimals - _global) / (1 max count playableUnits)) min (dayz_maxAnimals - _count))) to 1 step -1 do {
_animalssupported = ["hen","hen","hen","Cow","Sheep","WildBoar","WildBoar","WildBoar","Goat","Rabbit","Rabbit"]; _animalssupported = ["hen","hen","hen","Cow","Sheep","WildBoar","WildBoar","WildBoar","Goat","Rabbit","Rabbit","Dog"];
_type = _animalssupported select floor random count _animalssupported; _type = _animalssupported select floor random count _animalssupported;
if (_type == "Cow") then { if (_type == "Cow") then {
_animalssupported = ["Cow01","Cow02","Cow03","Cow04"]; _animalssupported = ["Cow01","Cow02","Cow03","Cow04","Cow01_EP1"];
_type = _animalssupported select floor random count _animalssupported;
};
if (_type == "Goat") then {
_animalssupported = ["Goat","Goat01_EP1","Goat02_EP1"];
_type = _animalssupported select floor random count _animalssupported;
};
if (_type == "Sheep") then {
_animalssupported = ["Sheep","Sheep01_EP1","Sheep02_EP1"];
_type = _animalssupported select floor random count _animalssupported;
};
if (_type == "hen") then {
_animalssupported = ["hen","Cock"];
_type = _animalssupported select floor random count _animalssupported;
};
if (_type == "Dog") then {
_animalssupported = ["DZ_Fin","DZ_Pastor"];
_type = _animalssupported select floor random count _animalssupported; _type = _animalssupported select floor random count _animalssupported;
}; };
_root = configFile >> "CfgVehicles" >> _type; _root = configFile >> "CfgVehicles" >> _type;
@@ -62,7 +78,7 @@ sched_animals = {
if (count _PosList > 0) then { if (count _PosList > 0) then {
_Pos = (_PosList select 0) select 0; _Pos = (_PosList select 0) select 0;
if ((!surfaceIsWater _Pos) AND {(0 == {alive _x} count (_Pos nearEntities [ AllPlayers, 200 ]))}) then { if ((!surfaceIsWater _Pos) AND {(0 == {alive _x} count (_Pos nearEntities [ AllPlayers, 200 ]))}) then {
_agent = createAgent [_type, _Pos, [], 0, "FORM"]; _agent = if (_type == "DZ_Pastor") then {createAgent [_type, _Pos, [], 0, "NONE"]} else {createAgent [_type, _Pos, [], 0, "FORM"]};
[_pos,_agent] execFSM "\z\addons\dayz_code\system\animal_agent.fsm"; [_pos,_agent] execFSM "\z\addons\dayz_code\system\animal_agent.fsm";
_agent setVariable [ "", true ]; _agent setVariable [ "", true ];
_count = _count + 1; _count = _count + 1;