System is done (i think)

This commit is contained in:
icomrade
2016-02-28 15:28:59 -05:00
parent c034f43d0b
commit a83909b918
15 changed files with 3945 additions and 2051 deletions

View File

@@ -51,6 +51,12 @@ PVDZ_obj_Publish IS PVDZE_obj_Publish
PVCDZ_obj_HideBody IS PVDZE_obj_HideBody PVCDZ_obj_HideBody IS PVDZE_obj_HideBody
******REPLACE ALL PVCDZ_ AND PVDZ_ with PVCDZE/PVDZE_ ******REPLACE ALL PVCDZ_ AND PVDZ_ with PVCDZE/PVDZE_
trap_monitor.fsm is no more!
dayzPlayerLogin VARIABLE IS NO MORE!
dayzPlayerLogin2 = []; VARIABLE IS NO MORE! USE PVCDZ_plr_Login2
dayz_authed VARIABLE IS NO MORE???
dayz_gui = [] spawn { IS NO MORE????
PVDZ_drg_RaLW IS norrnRaLW PVDZ_drg_RaLW IS norrnRaLW
PVDZ_drg_RLact IS norrnRLact PVDZ_drg_RLact IS norrnRLact
NEW FNC PVDZE_hlt_Bleed -- THATS AN L change it to an I NEW FNC PVDZE_hlt_Bleed -- THATS AN L change it to an I
@@ -62,3 +68,5 @@ PVDZ_plr_Death BECOMES PVDZE_plr_Died
PVDZ_plr_Login1 BECOMES PVDZE_plr_Login PVDZ_plr_Login1 BECOMES PVDZE_plr_Login
PVDZ_obj_Destroy BECOMES PVDZE_obj_Delete //WHO RENAMED THESE VARIABLES IN DAYZ VANILLA, THE COMPILE IT CALLS IS STILL NAMED server_deleteObj WHY CHANGE IT TO DESTROY!!!!??? PVDZ_obj_Destroy BECOMES PVDZE_obj_Delete //WHO RENAMED THESE VARIABLES IN DAYZ VANILLA, THE COMPILE IT CALLS IS STILL NAMED server_deleteObj WHY CHANGE IT TO DESTROY!!!!???
dayzSetDate BECOMES PVDZE_plr_SetDate dayzSetDate BECOMES PVDZE_plr_SetDate
PVDZ_serverStoreVar BECOMES PVDZE_serverStoreVar

View File

@@ -1,44 +1,68 @@
private ["_type","_inVehicle","_dateNow","_maxWildZombies","_age","_radius","_position","_markerstr","_markerstr1","_markerstr2","_markerstr3","_nearByObj","_handle","_looted","_cleared","_zombied","_config","_canLoot","_dis","_players","_nearby","_nearbyCount","_onTheMove","_soundLimit"]; private ["_isWreck","_maxControlledZombies","_looted","_zombied","_doNothing","_spawnZedRadius","_serverTime","_age","_nearbyBuildings","_position","_spawnableObjects","_speed","_radius","_maxlocalspawned","_maxWeaponHolders","_currentWeaponHolders","_maxtoCreate","_inVehicle","_isAir","_isLand","_isSea","_Controlledzeddivided","_totalcrew","_nearby","_type","_config","_canSpawn","_dis","_checkLoot","_islocal","_bPos","_zombiesNum"];
//_t1 = diag_tickTime;
_type = _this select 0;
_inVehicle = (vehicle player != player);
_onTheMove = (speed (vehicle player) > 10);
_dateNow = (DateToNumber date);
_maxWildZombies = 3;
_age = -1; _age = -1;
_radius = 200; //_nearbyBuildings = [];
_position = [player] call FNC_GetPos; _position = [player] call FNC_GetPos;
_spawnableObjects = ["building", "CrashSite", "IC_Fireplace1", "IC_DomeTent", "IC_Tent"];
_speed = speed (vehicle player);
_radius = 300; //150*0.707; Pointless Processing (106.5)
_spawnZedRadius = 20;
dayz_spawnZombies = 0; /*
dayz_CurrentZombies = 0; //Tick Time
PVDZ_getTickTime = player;
publicVariableServer "PVDZ_getTickTime";
*/
// experiment with adding fly sounds locally for both zombies && players. //Total Counts
_soundLimit = 2; _maxlocalspawned = round(dayz_spawnZombies);
{ _maxControlledZombies = round(dayz_maxLocalZombies);
if (!alive _x) then { _maxWeaponHolders = round(dayz_maxMaxWeaponHolders);
if (!(_x isKindOf "zZombie_Base")) then { _currentWeaponHolders = round(dayz_currentWeaponHolders);
[player,"flysound",1,true] call dayz_zombieSpeak;
_soundLimit = _soundLimit - 1;
};
};
if (_soundLimit == 0) exitWith {};
} count (nearestObjects [player, ["CAManBase"], 8]);
_players = _position nearEntities ["CAManBase",_radius+200]; //Limits (Land,Sea,Air)
dayz_maxGlobalZombies = dayz_maxGlobalZombiesInit; _inVehicle = (vehicle player != player);
{ /*
if(isPlayer _x) then { _isAir = vehicle player iskindof "Air";
dayz_maxGlobalZombies = dayz_maxGlobalZombies + dayz_maxGlobalZombiesIncrease; _isLand = vehicle player iskindof "Land";
_isSea = vehicle player iskindof "Sea";
if (_isLand) then { } else { };
if (_isAir) then { } else { };
if (_isSea) then { } else { };
*/
_doNothing = false;
if (_inVehicle) then {
_Controlledzeddivided = 0;
//exit if too fast
if (_speed > 25) exitwith {_doNothing = true;};
//Crew can spawn zeds.
_totalcrew = count (crew (vehicle player));
if (_totalcrew > 1) then {
_Controlledzeddivided = 2;
//Dont allow driver to spawn if we have other crew members.
if (player == driver (vehicle player)) exitwith {_doNothing = true;};
} else { } else {
if (_x isKindOf "zZombie_Base") then { _Controlledzeddivided = 4;
if (local _x) then {
dayz_spawnZombies = dayz_spawnZombies + 1;
}; };
dayz_CurrentZombies = dayz_CurrentZombies + 1;
if (_Controlledzeddivided > 0) then {
_maxControlledZombies = round(_maxControlledZombies / _Controlledzeddivided);
r_player_divideinvehicle = _Controlledzeddivided;
}; };
}; };
} count _players;
if (_doNothing) exitwith {};
//Logging
diag_log (format["%1 Local.Agents: %2/%3, NearBy.Agents: %8/%9, Global.Agents: %6/%7, W.holders: %10/%11, (radius:%4m %5fps).","SpawnCheck",
_maxlocalspawned, _maxControlledZombies, _radius, round diag_fpsmin,dayz_currentGlobalZombies,
dayz_maxGlobalZeds, dayz_CurrentNearByZombies, dayz_maxNearByZombies, _currentWeaponHolders,_maxWeaponHolders]);
_nearby = nearestObjects [_position, _spawnableObjects,_radius];
_maxlocalspawned = _maxlocalspawned max floor(_maxControlledZombies*.8);
if (_maxlocalspawned > 0) then { _spawnZedRadius = _spawnZedRadius * 3; };
if ("ItemMap_Debug" in items player) then { if ("ItemMap_Debug" in items player) then {
deleteMarkerLocal "MaxZeds"; deleteMarkerLocal "MaxZeds";
@@ -83,68 +107,73 @@ diag_log ("GlobalZombies: " +str(dayz_CurrentZombies) + "/" +str(dayz_maxGlobalZ
diag_log ("dayz_maxCurrentZeds: " +str(dayz_maxCurrentZeds) + "/" +str(dayz_maxZeds)); diag_log ("dayz_maxCurrentZeds: " +str(dayz_maxCurrentZeds) + "/" +str(dayz_maxZeds));
}; };
//Spawn Zeds & loot in buildings
_nearby = _position nearObjects ["building",_radius];
_nearbyCount = count _nearby;
if (_nearbyCount < 1) exitwith
{
if ((dayz_spawnZombies < _maxWildZombies) && !_inVehicle) then {
[_position] call wild_spawnZombies;
};
};
{ {
_type = typeOf _x; _type = typeOf _x;
_config = configFile >> "CfgBuildingLoot" >> _type; _config = configFile >> "CfgLoot" >> "Buildings" >> _type;
if (DZE_MissionLootTable) then { _canSpawn = isClass (_config);
_config = missionConfigFile >> "CfgBuildingLoot" >> _type;
};
_canLoot = isClass (_config);
if(_canLoot) then {
if (_canSpawn) then {
_dis = _x distance player; _dis = _x distance player;
_checkLoot = (count (getArray (_config >> "lootPos"))) > 0;
_islocal = _x getVariable ["", false]; // object created locally via TownGenerator. See stream_locationFill.sqf
//Make sure wrecks always spawn Zeds
_isWreck = _x isKindOf "CrashSite";
//Loot //Loot
if ((_dis < 120) && (_dis > 30) && !_inVehicle) then { if (getNumber(_config >> "lootChance") > 0) then {
_looted = (_x getVariable ["looted",-0.1]); if (_currentWeaponHolders < _maxWeaponHolders) then {
_cleared = (_x getVariable ["cleared",true]); //Baisc loot check
_dateNow = (DateToNumber date); if ((_dis < 125) and (_dis > 30) and !_inVehicle and _checkLoot) then {
_age = (_dateNow - _looted) * 525948; _serverTime = serverTime;
//diag_log ("SPAWN LOOT: " + _type + " Building is " + str(_age) + " old" ); _looted = (_x getVariable ["looted",_serverTime]);
if ((_age > DZE_LootSpawnTimer) && (!_cleared)) then { _age = _serverTime - _looted;
_nearByObj = nearestObjects [(getPosATL _x), ["WeaponHolder","WeaponHolderBase"],((sizeOf _type)+5)]; if ((_age == 0) or (_age > 900)) then {
{deleteVehicle _x} count _nearByObj; _x setVariable ["looted",_serverTime,!_islocal];
_x setVariable ["cleared",true,true];
_x setVariable ["looted",_dateNow,true];
};
if ((_age > DZE_LootSpawnTimer) && (_cleared)) then {
//Register
_x setVariable ["looted",_dateNow,true];
//cleanup
_x call building_spawnLoot; _x call building_spawnLoot;
if (!(_x in dayz_buildingBubbleMonitor)) then {
dayz_buildingBubbleMonitor set [count dayz_buildingBubbleMonitor, _x];
};
//diag_log [ diag_tickTime, "new loot at",_x,"age:", _age, "serverTime:", _serverTime];
}/*
else {
diag_log [ diag_tickTime, "won't spawn loot at",_x,"age:", _age, "serverTime:", _serverTime];
}*/;
};
}; };
}; };
// do not spawn zeds if player is moving faster then 10kmh
if (!_onTheMove) then {
//Zeds //Zeds
if ((time - dayz_spawnWait) > dayz_spawnDelay) then { if (getNumber(_config >> "zombieChance") > 0) then {
if (dayz_maxCurrentZeds < dayz_maxZeds) then { if (_dis > _spawnZedRadius) then {
if (dayz_CurrentZombies < dayz_maxGlobalZombies) then { _serverTime = serverTime;
if (dayz_spawnZombies < dayz_maxLocalZombies) then { _zombied = (_x getVariable ["zombieSpawn",_serverTime]);
_zombied = (_x getVariable ["zombieSpawn",-0.1]); _age = _serverTime - _zombied;
_dateNow = (DateToNumber date); if ((_age == 0) or (_age > 300)) then {
_age = (_dateNow - _zombied) * 525948; if (!_isWreck) then {
if (_age > 3) then { if ((dayz_spawnZombies < _maxControlledZombies) and (dayz_CurrentNearByZombies < dayz_maxNearByZombies) and (dayz_currentGlobalZombies < dayz_maxGlobalZeds)) then {
_x setVariable ["zombieSpawn",_dateNow,true]; _bPos = getPosATL _x;
_zombiesNum = {alive _x} count (_bPos nearEntities ["zZombie_Base",(((sizeOf _type) * 2) + 10)]);
if (_zombiesNum == 0) then {
_x setVariable ["zombieSpawn",_serverTime,!_islocal];
if (!(_x in dayz_buildingBubbleMonitor)) then {
//add active zed to var
dayz_buildingBubbleMonitor set [count dayz_buildingBubbleMonitor, _x];
};
//start spawn
[_x] call building_spawnZombies; [_x] call building_spawnZombies;
}; };
} else { //diag_log (format["%1 building. %2", __FILE__, _x]);
dayz_spawnWait = time;
}; };
} else {
_bPos = getPosATL _x;
_zombiesNum = {alive _x} count (_bPos nearEntities ["zZombie_Base",(((sizeOf _type) * 2) + 30)]);
//Should be a wreck
if (_zombiesNum == 0) then { [_x,_isWreck] call building_spawnZombies; };
}; };
}; };
}; };

View File

@@ -0,0 +1,31 @@
// (c) facoptere@gmail.com, licensed to DayZMod for the community
// These RE commands will be cancelled once init.sqf is exec'ed on client or server
#ifndef REMOVED_LIB
#define REMOVED_LIB [ "addAction", "addEventhandler", "addMagazine", "addMagazineCargo", "addWeapon", \
"addWeaponCargo", "addWPCur", "animate", "callVar", "clearMagazineCargo", "clearWeaponCargo", "createDiaryRecord", \
"createMarkerLocal", "createSimpleTask", "createTaskSet", "debugLog", "deleteWP", "enablesimulation", "endMission", \
"execfsm", "fadeMusic", "fadeSound", "failMission", "globalChat", "globalRadio", "groupChat", "groupRadio", \
"hideObject", "hint", "hintC", "kbAddTopic", "kbreact", "kbRemoveTopic", "kbtell", "land", "move", "moveIn", \
"playAction", "playActionnow", "playmovenow", "playMusic", "playsound", "removeAction", \
"removeAllWeapons", "setCaptive", "setCurrentTask", "setCurrentTaskArrays", "setDate", "setDir", "setGroupID", \
"setMarkerPosLocal", "setObjectTexture", "setSimpleTaskDescription", "setTaskState", "setWPdesc", "setWPtype", \
"showCommandingMenu", "sideChat", "sideRadio", "skiptime", "spawn", "switchAction", "switchCamera", "taskHint", \
"titleCut", "Hangender"]
#endif
// Allowed commands
#ifndef TRACED_LIB
#define TRACED_LIB [ "execVM", "JIPexec", "JIPrequest", "say", "playmove", "switchmove", "titleText" ]
// uncomment following line to log all incoming allowed RE
#define RESEC_VERBOSE
#endif
// Special logic for execVM, only these whitelisted scripts will be spawned
#ifndef WHITELISTED_EXECVM
#define WHITELISTED_EXECVM [ ""ca\Modules\Functions\init.sqf"" ]
// uncomment and put in the array above if you want your server be able to kick players (not used in DayZ for now)
//""ca\Modules\MP\data\scriptCommands\endMission.sqf""
#endif
#define Stringify(macro) #macro

View File

@@ -6,12 +6,14 @@ item1[] = {"wait",2,250,-25.000000,300.000000,75.000000,350.000000,0.000000,"wai
item2[] = {"End",1,250,100.000000,225.000000,200.000000,275.000000,0.000000,"End"}; item2[] = {"End",1,250,100.000000,225.000000,200.000000,275.000000,0.000000,"End"};
item3[] = {"Not_Alive",4,218,-150.000000,300.000000,-50.000000,350.000000,4.000000,"Not" \n "Alive"}; item3[] = {"Not_Alive",4,218,-150.000000,300.000000,-50.000000,350.000000,4.000000,"Not" \n "Alive"};
item4[] = {"Loiter",2,250,-150.000000,225.000000,-50.000000,275.000000,0.000000,"Loiter"}; item4[] = {"Loiter",2,250,-150.000000,225.000000,-50.000000,275.000000,0.000000,"Loiter"};
item5[] = {"In_Position",4,4314,-250.000000,275.000000,-150.000000,325.000000,2.000000,"In Position"}; item5[] = {"In_Position",4,218,-350.000000,225.000000,-250.000000,275.000000,2.000000,"In Position"};
item6[] = {"preloaded",4,218,-150.000000,150.000000,-50.000000,200.000000,0.000000,"preloaded"}; item6[] = {"preloaded",4,218,-150.000000,150.000000,-50.000000,200.000000,0.000000,"preloaded"};
item7[] = {"time_up",4,218,-25.000000,225.000000,75.000000,275.000000,0.000000,"time" \n "up"}; item7[] = {"time_up",4,218,-25.000000,225.000000,75.000000,275.000000,0.000000,"time" \n "up"};
item8[] = {"player_check",4,218,-250.000000,175.000000,-150.000000,225.000000,1.000000,"player" \n "check"}; item8[] = {"player_check",4,218,-250.000000,175.000000,-150.000000,225.000000,1.000000,"player" \n "check"};
item9[] = {"player_check",4,218,100.000000,300.000000,200.000000,350.000000,1.000000,"player" \n "check"}; item9[] = {"player_check",4,218,100.000000,300.000000,200.000000,350.000000,1.000000,"player" \n "check"};
item10[] = {"tamed",4,218,-25.000000,150.000000,75.000000,200.000000,3.000000,"tamed"}; item10[] = {"tamed",4,218,-25.000000,150.000000,75.000000,200.000000,3.000000,"tamed"};
item11[] = {"moveToCompleted",4,218,-250.000000,275.000000,-150.000000,325.000000,0.000000,"moveToCompleted "};
item12[] = {"Failed_to_move",4,4314,-300.000000,250.000000,-200.000000,300.000000,0.000000,"Failed to move"};
link0[] = {0,6}; link0[] = {0,6};
link1[] = {1,7}; link1[] = {1,7};
link2[] = {1,9}; link2[] = {1,9};
@@ -21,14 +23,18 @@ link5[] = {4,5};
link6[] = {4,7}; link6[] = {4,7};
link7[] = {4,8}; link7[] = {4,8};
link8[] = {4,10}; link8[] = {4,10};
link9[] = {5,4}; link9[] = {4,11};
link10[] = {6,4}; link10[] = {4,12};
link11[] = {7,2}; link11[] = {5,4};
link12[] = {8,4}; link12[] = {6,4};
link13[] = {9,1}; link13[] = {7,2};
link14[] = {10,2}; link14[] = {8,4};
globals[] = {25.000000,1,0,0,0,640,480,1,89,6316128,1,-299.424194,296.746490,405.380127,-436.653168,303,855,1}; link15[] = {9,1};
window[] = {0,-1,-1,-1,-1,1157,156,1364,156,1,321}; link16[] = {10,2};
link17[] = {11,4};
link18[] = {12,4};
globals[] = {25.000000,1,0,0,0,640,480,1,91,6316128,1,-478.843109,117.327553,583.704590,115.127663,813,1030,1};
window[] = {2,-1,-1,-1,-1,806,26,1234,26,3,831};
*//*%FSM</HEAD>*/ *//*%FSM</HEAD>*/
class FSM class FSM
{ {
@@ -43,7 +49,7 @@ class FSM
"_agent = _this select 1;" \n "_agent = _this select 1;" \n
"" \n "" \n
"_isSomeone = true;" \n "_isSomeone = true;" \n
"_timeA = time;" \n "_timeA = diag_tickTime;" \n
"_isTamed = false;"/*%FSM</STATEINIT""">*/; "_isTamed = false;"/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/; precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links class Links
@@ -65,7 +71,7 @@ class FSM
class wait class wait
{ {
name = "wait"; name = "wait";
init = /*%FSM<STATEINIT""">*/"_entityTime = time;"/*%FSM</STATEINIT""">*/; init = /*%FSM<STATEINIT""">*/"_entityTime = diag_tickTime;"/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/; precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links class Links
{ {
@@ -75,14 +81,14 @@ class FSM
priority = 1.000000; priority = 1.000000;
to="wait"; to="wait";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/; precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"(time - _entityTime) > 30"/*%FSM</CONDITION""">*/; condition=/*%FSM<CONDITION""">*/"(diag_tickTime - _entityTime) > 30"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"_entityTime = time;" \n action=/*%FSM<ACTION""">*/"_entityTime = diag_tickTime;" \n
"" \n "" \n
"_list = (getposATL _agent) nearEntities [[""CAManBase"",""AllVehicles""],300];" \n "_list = (getposATL _agent) nearEntities [[""CAManBase"",""AllVehicles""],300];" \n
"_isSomeone = ({isPlayer _x} count _list) > 0;" \n "_isSomeone = ({isPlayer _x} count _list) > 0;" \n
"" \n "" \n
"if (_isSomeone) then {" \n "if (_isSomeone) then {" \n
" _timeA = time;" \n " _timeA = diag_tickTime;" \n
"};"/*%FSM</ACTION""">*/; "};"/*%FSM</ACTION""">*/;
}; };
/*%FSM</LINK>*/ /*%FSM</LINK>*/
@@ -92,7 +98,7 @@ class FSM
priority = 0.000000; priority = 0.000000;
to="End"; to="End";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/; precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"(time - _timeA) > 120 && !_isSomeone"/*%FSM</CONDITION""">*/; condition=/*%FSM<CONDITION""">*/"(diag_tickTime - _timeA) > 120 and !_isSomeone"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/; action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
}; };
/*%FSM</LINK>*/ /*%FSM</LINK>*/
@@ -123,7 +129,7 @@ class FSM
init = /*%FSM<STATEINIT""">*/"_isAlive = alive _agent;" \n init = /*%FSM<STATEINIT""">*/"_isAlive = alive _agent;" \n
"" \n "" \n
"//_agent forceSpeed 2;" \n "//_agent forceSpeed 2;" \n
"_entityTime = time;"/*%FSM</STATEINIT""">*/; "_entityTime = diag_tickTime;"/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/; precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links class Links
{ {
@@ -134,7 +140,7 @@ class FSM
to="wait"; to="wait";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/; precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"!_isAlive"/*%FSM</CONDITION""">*/; condition=/*%FSM<CONDITION""">*/"!_isAlive"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"_timeA = time;"/*%FSM</ACTION""">*/; action=/*%FSM<ACTION""">*/"_timeA = diag_tickTime;"/*%FSM</ACTION""">*/;
}; };
/*%FSM</LINK>*/ /*%FSM</LINK>*/
/*%FSM<LINK "tamed">*/ /*%FSM<LINK "tamed">*/
@@ -154,7 +160,8 @@ class FSM
to="Loiter"; to="Loiter";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/; precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"_agent distance _pos < 3"/*%FSM</CONDITION""">*/; condition=/*%FSM<CONDITION""">*/"_agent distance _pos < 3"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"_pos = [_pos,10,90,4,0,5,0] call BIS_fnc_findSafePos;" \n action=/*%FSM<ACTION""">*/"//_pos = [_pos,10,90,4,0,5,0] call BIS_fnc_findSafePos;" \n
"_pos = [_pos,10,90,1] call fn_selectRandomLocation;" \n
"_agent moveTo _pos;"/*%FSM</ACTION""">*/; "_agent moveTo _pos;"/*%FSM</ACTION""">*/;
}; };
/*%FSM</LINK>*/ /*%FSM</LINK>*/
@@ -164,24 +171,48 @@ class FSM
priority = 1.000000; priority = 1.000000;
to="Loiter"; to="Loiter";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/; precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"(time - _entityTime) > 30"/*%FSM</CONDITION""">*/; condition=/*%FSM<CONDITION""">*/"(diag_tickTime - _entityTime) > 30"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"_entityTime = time;" \n action=/*%FSM<ACTION""">*/"_entityTime = diag_tickTime;" \n
"" \n "" \n
"_list = (getposATL _agent) nearEntities [[""CAManBase"",""AllVehicles""],300];" \n "_list = (getposATL _agent) nearEntities [[""CAManBase"",""AllVehicles""],300];" \n
"_isSomeone = ({isPlayer _x} count _list) > 0;" \n "_isSomeone = ({isPlayer _x} count _list) > 0;" \n
"" \n "" \n
"if (_isSomeone) then {" \n "if (_isSomeone) then {" \n
" _timeA = time;" \n " _timeA = diag_tickTime;" \n
"};"/*%FSM</ACTION""">*/; "};"/*%FSM</ACTION""">*/;
}; };
/*%FSM</LINK>*/ /*%FSM</LINK>*/
/*%FSM<LINK "moveToCompleted">*/
class moveToCompleted
{
priority = 0.000000;
to="Loiter";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"moveToCompleted _agent;" \n
""/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"_pos = [_pos,10,90,1] call fn_selectRandomLocation;" \n
"_agent moveTo _pos;"/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "Failed_to_move">*/
class Failed_to_move
{
priority = 0.000000;
to="Loiter";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"moveToFailed _agent;"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"_pos = [_pos,10,90,1] call fn_selectRandomLocation;" \n
"_agent moveTo _pos;" \n
""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "time_up">*/ /*%FSM<LINK "time_up">*/
class time_up class time_up
{ {
priority = 0.000000; priority = 0.000000;
to="End"; to="End";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/; precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"(time - _timeA) > 120 && !_isSomeone"/*%FSM</CONDITION""">*/; condition=/*%FSM<CONDITION""">*/"(diag_tickTime - _timeA) > 120 and !_isSomeone"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/; action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
}; };
/*%FSM</LINK>*/ /*%FSM</LINK>*/

View File

@@ -1,23 +1,37 @@
private["_firePlace","_ok","_mags","_serial","_qty","_countr"]; private["_firePlace","_ok","_mags","_serial","_qty","_countr"];
_firePlace = _this; _firePlace = _this;
while {alive _firePlace} do { while {alive _firePlace} do {
while {inflamed _firePlace && alive _fireplace} do { while {inflamed _firePlace and alive _fireplace} do {
//Use Wood //Use Wood
_ok = false; _ok = false;
_mags = getMagazineCargo _firePlace; _mags = getMagazineCargo _firePlace;
clearMagazineCargoGlobal _firePlace; clearMagazineCargoGlobal _firePlace;
clearWeaponCargoGlobal _firePlace;
_serial = (_mags select 0) find "PartWoodPile"; _fuel = ["PartWoodPile","ItemLog","ItemPlank"];
_serial = -1;
{
private ["_find"];
_find = ((_mags select 0) find _x);
if (_find >= 0) exitwith { _serial = _find; };
} count _fuel;
_qty = 0; _qty = 0;
_classname = "";
if (_serial >= 0) then { if (_serial >= 0) then {
_classname = (_mags select 0) select _serial;
_qty = (_mags select 1) select _serial; _qty = (_mags select 1) select _serial;
}; };
_ok = false; _ok = false;
if (_qty > 0) then { if (_qty > 0) then {
_qty = _qty - 1; _qty = _qty - 1;
_ok = true; _ok = true;
if (_qty > 0) then { if (_qty > 0) then {
_firePlace addMagazineCargoGlobal ["PartWoodPile",_qty]; _firePlace addMagazineCargoGlobal [_classname,_qty];
}; };
}; };
if (_ok) then { if (_ok) then {
@@ -33,7 +47,7 @@ while {alive _firePlace} do {
_firePlace inflame false; _firePlace inflame false;
}; };
}; };
while {!inflamed _firePlace && alive _fireplace} do { while {!inflamed _firePlace and alive _fireplace} do {
//Wait //Wait
uiSleep 1; uiSleep 1;
}; };

View File

@@ -0,0 +1,362 @@
/*%FSM<COMPILE "C:\Program Files (x86)\Bohemia Interactive\Tools\FSM Editor Personal Edition\scriptedFSM.cfg, DayZ Zombie Combat Agent">*/
/*%FSM<HEAD>*/
/*
item0[] = {"init",0,250,-150.000000,-250.000000,-50.000000,-200.000000,0.000000,"init"};
item1[] = {"End",1,250,175.000000,-250.000000,275.000000,-200.000000,0.000000,"End"};
item2[] = {"Attack",4,218,-150.000000,425.000000,-50.000000,475.000000,0.000000,"Attack"};
item3[] = {"Not_Alive",4,218,50.000000,300.000000,150.000000,350.000000,5.000000,"Not" \n "Alive"};
item4[] = {"Nobody_Near",4,218,50.000000,350.000000,150.000000,400.000000,4.000000,"Nobody" \n "Near"};
item5[] = {"",7,210,-29.000042,321.000000,-20.999958,329.000000,0.000000,""};
item6[] = {"",7,210,-29.000042,370.999939,-20.999958,379.000061,0.000000,""};
item7[] = {"true",8,218,-150.000000,-175.000000,-50.000000,-125.000000,0.000000,"true"};
item8[] = {"Begin",2,250,-150.000000,-100.000000,-50.000000,-50.000000,0.000000,"Begin"};
item9[] = {"Has_Target",4,218,-150.000000,125.000000,-50.000000,175.000000,1.000000,"Has" \n "Target"};
item10[] = {"Chase",2,250,-150.000000,300.000000,-50.000000,350.000000,0.000000,"Chase"};
item11[] = {"",7,210,221.000000,371.000000,229.000000,379.000000,0.000000,""};
item12[] = {"moveToCompleted",4,218,-25.000000,200.000000,75.000000,250.000000,0.000000,"moveToCompleted"};
item13[] = {"",7,210,221.000000,233.500000,229.000000,241.500000,0.000000,""};
item14[] = {"",7,210,221.000000,321.000000,229.000000,329.000000,0.000000,""};
item15[] = {"is_Dedicated",4,218,50.000000,-250.000000,150.000000,-200.000000,5.000000,"is" \n "Dedicated"};
item16[] = {"Cleanup_",2,250,175.000000,150.000000,275.000000,200.000000,0.000000,"Cleanup?"};
item17[] = {"nobody_around",4,218,175.000000,-75.000000,275.000000,-25.000000,0.000000,"nobody" \n "around"};
item18[] = {"someone_here",4,218,300.000000,150.000000,400.000000,200.000000,0.000000,"someone" \n "here"};
item19[] = {"wait",2,250,300.000000,75.000000,400.000000,125.000000,0.000000,"wait"};
item20[] = {"time_up",4,218,300.000000,-75.000000,400.000000,-25.000000,0.000000,"time" \n "up"};
item21[] = {"",7,210,346.000000,8.500000,354.000000,16.500000,0.000000,""};
item22[] = {"",7,210,221.000000,8.500000,229.000000,16.500000,0.000000,""};
item23[] = {"Time_Check",4,218,425.000000,75.000000,525.000000,125.000000,0.000000,"Time" \n "Check"};
item24[] = {"",7,210,346.000000,-166.500000,354.000000,-158.500000,0.000000,""};
item25[] = {"",7,210,221.000000,-166.500000,229.000000,-158.500000,0.000000,""};
item26[] = {"deleted",4,218,425.000000,-75.000000,525.000000,-25.000000,0.000000,"deleted"};
item27[] = {"",7,210,471.000000,-166.500000,479.000000,-158.500000,0.000000,""};
item28[] = {"",7,210,471.000000,8.500000,479.000000,16.500000,0.000000,""};
item29[] = {"Time_Check",4,4314,-275.000000,300.000000,-175.000000,350.000000,0.000000,"Time Check"};
item30[] = {"____FAKE____",9,1200,0.000000,0.000000,0.000000,0.000000,0.000000,"____FAKE____"};
link0[] = {0,7};
link1[] = {0,15};
link2[] = {2,10};
link3[] = {3,14};
link4[] = {4,11};
link5[] = {5,3};
link6[] = {5,6};
link7[] = {6,4};
link8[] = {7,8};
link9[] = {8,9};
link10[] = {9,10};
link11[] = {10,2};
link12[] = {10,5};
link13[] = {10,29};
link14[] = {11,14};
link15[] = {13,16};
link16[] = {14,13};
link17[] = {15,1};
link18[] = {16,18};
link19[] = {16,22};
link20[] = {17,25};
link21[] = {18,19};
link22[] = {19,21};
link23[] = {19,23};
link24[] = {20,24};
link25[] = {21,20};
link26[] = {21,22};
link27[] = {21,28};
link28[] = {22,17};
link29[] = {23,19};
link30[] = {24,25};
link31[] = {25,1};
link32[] = {26,27};
link33[] = {27,24};
link34[] = {28,26};
link35[] = {29,10};
link36[] = {12,30};
link37[] = {30,12};
globals[] = {25.000000,1,0,0,0,640,480,1,163,6316128,1,-438.144928,688.129517,520.129150,-284.928619,838,1030,1};
window[] = {2,-1,-1,-1,-1,910,130,1338,130,3,856};
*//*%FSM</HEAD>*/
class FSM
{
fsmName = "DayZ Zombie Combat Agent";
class States
{
/*%FSM<STATE "init">*/
class init
{
name = "init";
init = /*%FSM<STATEINIT""">*/"_position = _this select 0;" \n
"_agent = _this select 1;" \n
"_target = _this select 2;" \n
"" \n
"" \n
"diag_log (""Agent Initialized: "" + str(_this));"/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "is_Dedicated">*/
class is_Dedicated
{
priority = 5.000000;
to="End";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"isDedicated"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "true">*/
class true
{
priority = 0.000000;
to="Begin";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"dayz_clientPreload and !(isNull _agent)"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
};
};
/*%FSM</STATE>*/
/*%FSM<STATE "End">*/
class End
{
name = "End";
init = /*%FSM<STATEINIT""">*/"if (!isDedicated) then {" \n
" if (!isNull _agent) then {" \n
" deleteVehicle _agent;" \n
" };" \n
"} else {" \n
" [_agent] call zombie_findOwner;" \n
"};"/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
};
};
/*%FSM</STATE>*/
/*%FSM<STATE "Begin">*/
class Begin
{
name = "Begin";
init = /*%FSM<STATEINIT""">*/"_array = [];" \n
"" \n
"_bodyStay = 60;" \n
"" \n
"_timeN = time;" \n
"" \n
" _id = _agent addeventhandler [""HandleDamage"",{_this call local_zombieDamage}];" \n
"" \n
"//hint ""run local zombie"";" \n
"_isSomeone = true;" \n
"" \n
"_targetPos = [];" \n
"_countr = 0;" \n
"" \n
"//Spawn roaming script (individual to unit)" \n
"_entityTime = time;" \n
""/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "Has_Target">*/
class Has_Target
{
priority = 1.000000;
to="Chase";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"!(isNull _target)"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"_countr = 0;" \n
"_losCheck = 0;" \n
"_cantSee = false;" \n
"_agent forceSpeed 6;" \n
"_targetPos = getPosATL _target;"/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
};
};
/*%FSM</STATE>*/
/*%FSM<STATE "Chase">*/
class Chase
{
name = "Chase";
init = /*%FSM<STATEINIT""">*/"_timeN = diag_tickTime;" \n
"_timeP = diag_tickTime;" \n
"" \n
"_isAlive = alive _agent;" \n
"_targetPos = getPosATL _target;" \n
"_agent moveTo _targetPos;" \n
"" \n
"_list = (getposATL _agent) nearEntities [[""CAManBase"",""AllVehicles""],dayz_canDelete];" \n
"_isSomeone = ({isPlayer _x} count _list) > 0;" \n
"" \n
"if (_agent distance _target > 10) then {" \n
" _agent setUnitPos ""middle"";" \n
"};" \n
"" \n
" "/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "Not_Alive">*/
class Not_Alive
{
priority = 5.000000;
to="Cleanup_";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"!_isAlive"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"diag_log (""Not Alive"");" \n
"dayz_swarmSpawnZombies = dayz_swarmSpawnZombies - 1;"/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "Nobody_Near">*/
class Nobody_Near
{
priority = 4.000000;
to="Cleanup_";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"!_isSomeone"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"dayz_swarmSpawnZombies = dayz_swarmSpawnZombies - 1;"/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "Time_Check">*/
class Time_Check
{
priority = 0.000000;
to="Chase";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"(diag_tickTime - _timeP) > 3"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "Attack">*/
class Attack
{
priority = 0.000000;
to="Chase";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"_agent distance _target < 3 AND (diag_tickTime - _timeN) > 1"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"_vehicle = (vehicle player);" \n
"_hpList = _vehicle call vehicle_getHitpoints;" \n
"_hp = _hpList call BIS_fnc_selectRandom;" \n
"_wound = getText(configFile >> ""cfgVehicles"" >> (typeOf _vehicle) >> ""HitPoints"" >> _hp >> ""name"");" \n
"" \n
"[_agent, _wound] spawn player_zombieSwarmAttack;"/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
};
};
/*%FSM</STATE>*/
/*%FSM<STATE "Cleanup_">*/
class Cleanup_
{
name = "Cleanup_";
init = /*%FSM<STATEINIT""">*/"_waitStart = time;" \n
"" \n
"_list = (getposATL _agent) nearEntities [[""CAManBase"",""AllVehicles""],dayz_canDelete];" \n
"_isSomeone = ({isPlayer _x} count _list) > 0;"/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "nobody_around">*/
class nobody_around
{
priority = 0.000000;
to="End";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"!_isSomeone"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"dayz_spawnZombies = dayz_spawnZombies - 1;"/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "someone_here">*/
class someone_here
{
priority = 0.000000;
to="wait";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"_isSomeone"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
};
};
/*%FSM</STATE>*/
/*%FSM<STATE "wait">*/
class wait
{
name = "wait";
init = /*%FSM<STATEINIT""">*/"_list = (getposATL _agent) nearEntities [[""CAManBase"",""AllVehicles""],dayz_canDelete];" \n
"_isSomeone = ({isPlayer _x} count _list) > 0;" \n
"" \n
"_timeN = time;"/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "time_up">*/
class time_up
{
priority = 0.000000;
to="End";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"(time - _waitStart) > 300"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "nobody_around">*/
class nobody_around
{
priority = 0.000000;
to="End";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"!_isSomeone"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"dayz_spawnZombies = dayz_spawnZombies - 1;"/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "deleted">*/
class deleted
{
priority = 0.000000;
to="End";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"isNull _agent;"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "Time_Check">*/
class Time_Check
{
priority = 0.000000;
to="wait";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"(time - _timeN) > 30"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
};
};
/*%FSM</STATE>*/
/*%FSM<STATE "____FAKE____">*/
class ____FAKE____
{
name = "____FAKE____";
init = /*%FSM<STATEINIT""">*/""/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "moveToCompleted">*/
class moveToCompleted
{
priority = 0.000000;
to="____FAKE____";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"moveToCompleted _agent;"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
};
};
/*%FSM</STATE>*/
};
initState="init";
finalStates[] =
{
"End"
};
};
/*%FSM</COMPILE>*/

View File

@@ -1,3 +1,7 @@
/*
written by Bohemia Interactive
modified with permission by DayZ Mod Team
*/
disableSerialization; disableSerialization;
private ["_control","_display","_temp","_event","_data","_x","_stopTheKey","_keyLeft","_i","_index","_size","_indices","_lbcontrol"]; private ["_control","_display","_temp","_event","_data","_x","_stopTheKey","_keyLeft","_i","_index","_size","_indices","_lbcontrol"];
private ["_key","_keyRight","_keyTop","_keyBottom","_secondColumn","_activateControl","_output","_doFilter"]; private ["_key","_keyRight","_keyTop","_keyBottom","_secondColumn","_activateControl","_output","_doFilter"];
@@ -11,6 +15,8 @@ private ["_event","_data","_display","_control","_primaryWeaponControl","_IDCsAr
IGUI_GEAR_filterPistols = (_activeFilter select 5); IGUI_GEAR_filterPistols = (_activeFilter select 5);
IGUI_GEAR_filterPistolAmmo = (_activeFilter select 6); */ IGUI_GEAR_filterPistolAmmo = (_activeFilter select 6); */
_doFilter = false;
_filterSets = [ _filterSets = [
//Primary Weapon, Secondary weapon, Ammo, Binocular, Inventory, Pistols, Pistols Ammo //Primary Weapon, Secondary weapon, Ammo, Binocular, Inventory, Pistols, Pistols Ammo
[false,false,false,false,false,false,false], [false,false,false,false,false,false,false],
@@ -30,22 +36,19 @@ _icons = [
_event = _this select 1; _event = _this select 1;
_data = _this select 0; _data = _this select 0;
//diag_log [diag_ticktime, __FILE__, _this];
_dofilter = false; _display = nil;
/*-------------------------------------------*/ /*-------------------------------------------*/
if(typeName(_data select 0) == "DISPLAY")then if (typeName(_data select 0) == "DISPLAY") then {
{
_display = (_data select 0); _display = (_data select 0);
}; };
if(typeName(_data select 0) == "CONTROL")then if (typeName(_data select 0) == "CONTROL") then {
{
_control = (_data select 0); _control = (_data select 0);
_display = ctrlParent _control; _display = ctrlParent _control;
}; };
/*-------------------------------------------*/ /*-------------------------------------------*/
_lbSelectedItem = { _lbSelectedItem = {
private ["_index","_selectedItem","_n"]; private ["_index","_selectedItem","_n"];
@@ -60,11 +63,11 @@ _lbSelectedItem = {
_n = _n + 1; _n = _n + 1;
}; };
_selectedItem; _selectedItem
}; };
_arrowsEnable = { _arrowsEnable = {
private ["_index","_selectedItem"]; private ["_index","_selectedItemCountLeft"];
_lbcontrol = _display displayctrl _lbIDC; _lbcontrol = _display displayctrl _lbIDC;
@@ -80,14 +83,14 @@ _isWeapon = {
private ["_item","_return"]; private ["_item","_return"];
_item = _this select 0; _item = _this select 0;
_return = (str(configfile >> "cfgWeapons" >> _item) != ""); _return = (str(configfile >> "cfgWeapons" >> _item) != "");
_return; _return
}; };
_isMagazine = { _isMagazine = {
private ["_item","_return"]; private ["_item","_return"];
_item = _this select 0; _item = _this select 0;
_return = (str(configfile >> "cfgMagazines" >> _item) != ""); _return = (str(configfile >> "cfgMagazines" >> _item) != "");
_return; _return
}; };
@@ -117,6 +120,7 @@ _IDCsArray = [
]; ];
/*
_showAllIDCs = { _showAllIDCs = {
private ["_slotArray","_j","_i"]; private ["_slotArray","_j","_i"];
for [{_i=0},{_i<count(_IDCsArray)}, {_i = _i + 1} ] do { for [{_i=0},{_i<count(_IDCsArray)}, {_i = _i + 1} ] do {
@@ -129,21 +133,21 @@ for [{_i=0},{_i<count(_IDCsArray)}, {_i = _i + 1} ] do {
}; };
}; };
}; };
*/
_higlightIDCs = { _higlightIDCs = {
private ["_slotArray","_j","_i"]; private ["_slotArray","_j","_i"];
for [{_i=0},{_i<count(_IDCsArray)}, {_i = _i + 1} ] do { for [{_i=0},{_i<count(_IDCsArray)}, {_i = _i + 1} ] do {
_slotArray = _IDCsArray select _i; _slotArray = _IDCsArray select _i;
for [{_j=0},{_j<count(_slotArray)}, {_j = _j + 1} ] do { for [{_j=0},{_j<count(_slotArray)}, {_j = _j + 1} ] do {
if (_selectedItemSlotIDCs find (_slotArray select _j)>-1 ) then { if (_selectedItemSlotIDCs find (_slotArray select _j)>-1 ) then {
_itemSlot = _display displayctrl (_slotArray select _j); _itemSlot = _display displayctrl (_slotArray select _j);
_itemSlot ctrlSetFade 0.0; //_itemSlot ctrlSetFade 0.0;
_itemSlot ctrlCommit 0.3; //_itemSlot ctrlCommit 0.3;
} else { } else {
_itemSlot = _display displayctrl (_slotArray select _j); _itemSlot = _display displayctrl (_slotArray select _j);
_itemSlot ctrlSetFade 0.5; //_itemSlot ctrlSetFade 0.5;
_itemSlot ctrlCommit 0.3; //_itemSlot ctrlCommit 0.3;
}; };
}; };
}; };
@@ -160,19 +164,21 @@ _returnSlotIDCs = {
_flags = (_this select 0); _flags = (_this select 0);
_outputArray = []; _outputArray = [];
_sum = 0; _sum = 0;
for [{_i=0},{_i<count(_IDCsArray)}, {_i = _i + 1} ] do
{ for [{_i=0},{_i<count(_IDCsArray)}, {_i = _i + 1} ] do {
_sum = _sum + (_flags select _i); _sum = _sum + (_flags select _i);
if ((_flags select _i) == 1) then { if ((_flags select _i) == 1) then {
_outputArray = _outputArray + (_IDCsArray select _i); _outputArray = _outputArray + (_IDCsArray select _i);
};
};
};
};
if (_sum == 0) then { if (_sum == 0) then {
_outputArray = (_IDCsArray select 2); _outputArray = (_IDCsArray select 2);
}; };
_outputArray;
_outputArray
}; };
/*
_isPrimaryWeapon = { _isPrimaryWeapon = {
_flags = (_this select 0); _flags = (_this select 0);
if ( (_flags select 0) == 1) then { if ( (_flags select 0) == 1) then {
@@ -190,24 +196,28 @@ _isSecondaryWeapon = {
false; false;
}; };
}; };
*/
_itemSlot = { _itemSlot = {
private ["_item", "_return"]; private ["_item", "_return"];
_item = _this select 0; _item = _this select 0;
_return = 0; _return = 0;
if ([_item] call _isWeapon) then { if ([_item] call _isWeapon) then {
_return = getNumber(configfile >> "cfgWeapons" >> _item >> "type"); _return = getNumber(configfile >> "cfgWeapons" >> _item >> "type");
}; };
if ([_item] call _isMagazine) then { if ([_item] call _isMagazine) then {
_return = getNumber(configfile >> "cfgMagazines" >> _item >> "type"); _return = getNumber(configfile >> "cfgMagazines" >> _item >> "type");
}; };
_return;
_return
}; };
_highlightIDCs = { _highlightIDCs = {
_hlIDCs = _this select 0; _hlIDCs = _this select 0;
for [{_i=0},{_i<count(_hlIDCs)}, {_i = _i + 1} ] do { //for [{_i=0},{_i<count(_hlIDCs)}, {_i = _i + 1} ] do {
}; //};
}; };
_returnBitArray = { _returnBitArray = {
@@ -215,16 +225,19 @@ private ["_i","_bitArray","_valResult","_val","_n","_i"];
_val = _this select 0; _val = _this select 0;
_bitArray = [0,0,0,0,0 ,0,0,0,0,0 ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]; _bitArray = [0,0,0,0,0 ,0,0,0,0,0 ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
_n = 524288; _n = 524288;
for [{_i=19},{_i>=0}, {_i = _i - 1} ] do for [{_i=19},{_i>=0}, {_i = _i - 1} ] do
{ {
_valResult = _val mod _n; _valResult = _val mod _n;
if (_valResult != _val) then { if (_valResult != _val) then {
_bitArray set [_i, 1]; _bitArray set [_i, 1];
}; };
_n = _n / 2; _n = _n / 2;
_val = _valResult; _val = _valResult;
}; };
_bitArray _bitArray
}; };
@@ -236,11 +249,12 @@ _highlightGearSlots ={
_selectedItemSlotIDCs = [_selectedItemSlotFlags] call _returnSlotIDCs; _selectedItemSlotIDCs = [_selectedItemSlotFlags] call _returnSlotIDCs;
[_selectedItemSlotIDCs] call _higlightIDCs; [_selectedItemSlotIDCs] call _higlightIDCs;
}; };
/*
_weaponsLBSetFocus = { _weaponsLBSetFocus = {
_lbcontrol = _display displayctrl _lbIDC; _lbcontrol = _display displayctrl _lbIDC;
/** Temporary disabled to prevent bug news:hov5k4$f6f$1@new-server.localdomain **/ /** Temporary disabled to prevent bug news:hov5k4$f6f$1@new-server.localdomain **/
//ctrlSetFocus _lbcontrol; //ctrlSetFocus _lbcontrol;
}; }; */
_setFilterIcon = { _setFilterIcon = {
_ctrlIcon = _display displayctrl 148; _ctrlIcon = _display displayctrl 148;
_ctrlIcon ctrlSetText (_icons select IGUI_GEAR_activeFilter); _ctrlIcon ctrlSetText (_icons select IGUI_GEAR_activeFilter);
@@ -253,22 +267,26 @@ _keyActions = {
_keyTop = [200,327697,327684]; _keyTop = [200,327697,327684];
_keyBottom = [208,327701,327685]; _keyBottom = [208,327701,327685];
_key = _data select 1; _key = _data select 1;
if ((_keyLeft find _key)>=0) then { if ((_keyLeft find _key)>=0) then {
_control = _display displayctrl 146; _control = _display displayctrl 146;
ctrlActivate _control; ctrlActivate _control;
_output = true; _output = true;
}; };
if ((_keyRight find _key)>=0) then { if ((_keyRight find _key)>=0) then {
_control = _display displayctrl 147; _control = _display displayctrl 147;
ctrlActivate _control; ctrlActivate _control;
_output = true; _output = true;
}; };
/*
if((_keyTop find _key)>=0)then { if((_keyTop find _key)>=0)then {
}; };
if((_keyBottom find _key)>=0)then { if((_keyBottom find _key)>=0)then {
}; };*/
}; };
//_bitArray = [0,0,0,0,0 ,0,0,0,0,0 ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]; //_bitArray = [0,0,0,0,0 ,0,0,0,0,0 ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
/* /*
@@ -296,15 +314,16 @@ _setFilterGlobals = {
//1201 //1201
_highlightFilterIcons = { _highlightFilterIcons = {
for [{_i=0},{_i<6}, {_i = _i + 1} ] do for [{_i=0},{_i<6}, {_i = _i + 1} ] do {
{
_control = _display displayctrl (1200 + _i); _control = _display displayctrl (1200 + _i);
_control ctrlSetTextColor [0.6000,0.8392,0.4706,1.0]; _control ctrlSetTextColor [0.6000,0.8392,0.4706,1.0];
}; };
_control = _display displayctrl (1200 + _this); _control = _display displayctrl (1200 + _this);
_control ctrlSetTextColor [1,1,1,1]; _control ctrlSetTextColor [1,1,1,1];
}; };
_matchesFilter = { _matchesFilter = {
private ["_itemValue","_itemBitArray"]; private ["_itemValue","_itemBitArray"];
_output = false; _output = false;
@@ -312,14 +331,12 @@ _matchesFilter = {
_itemValue = _this select 0; _itemValue = _this select 0;
_itemBitArray = [_itemValue] call _returnBitArray; _itemBitArray = [_itemValue] call _returnBitArray;
if (_itemValue == 1 && IGUI_GEAR_filterPrimaryWeapon) then { if (_itemValue == 1 && IGUI_GEAR_filterPrimaryWeapon) then {
_output = true; _output = true;
}; };
if (_itemValue == 5 && IGUI_GEAR_filterPrimaryWeapon) then { if (_itemValue == 5 && IGUI_GEAR_filterPrimaryWeapon) then {
_output = true; _output = true;
}; };
if (_itemValue == 4 && IGUI_GEAR_filterSecondaryWeapon) then { if (_itemValue == 4 && IGUI_GEAR_filterSecondaryWeapon) then {
@@ -329,6 +346,7 @@ _matchesFilter = {
if (_itemValue == 2 && IGUI_GEAR_filterPistols) then { if (_itemValue == 2 && IGUI_GEAR_filterPistols) then {
_output = true; _output = true;
}; };
if (_itemValue == 16 && IGUI_GEAR_filterPistolAmmo) then { if (_itemValue == 16 && IGUI_GEAR_filterPistolAmmo) then {
_output = true; _output = true;
}; };
@@ -340,6 +358,7 @@ _matchesFilter = {
if (_itemValue == 512 && IGUI_GEAR_filterAmmo) then { if (_itemValue == 512 && IGUI_GEAR_filterAmmo) then {
_output = true; _output = true;
}; };
if (_itemValue == 256 && IGUI_GEAR_filterAmmo) then { if (_itemValue == 256 && IGUI_GEAR_filterAmmo) then {
_output = true; _output = true;
}; };
@@ -347,7 +366,8 @@ _matchesFilter = {
if (_itemValue == 4096 && IGUI_GEAR_filterBinocular) then { if (_itemValue == 4096 && IGUI_GEAR_filterBinocular) then {
_output = true; _output = true;
}; };
_output;
_output
}; };
_filterItems = { _filterItems = {
@@ -356,8 +376,8 @@ _filterItems = {
_lbcontrol = _display displayctrl _lbIDC; _lbcontrol = _display displayctrl _lbIDC;
_n = (lnbSize _lbcontrol) select 0; _n = (lnbSize _lbcontrol) select 0;
_j = 0; _j = 0;
for [{_i=_n},{_i>=0}, {_i = _i - 1} ] do
{ for [{_i=_n},{_i>=0}, {_i = _i - 1} ] do {
_item = _lbcontrol lnbData [_i,1]; _item = _lbcontrol lnbData [_i,1];
_itemType = [_item] call _itemSlot; _itemType = [_item] call _itemSlot;
@@ -366,7 +386,9 @@ _filterItems = {
_deleteIndexes set [(_j-1), _i]; _deleteIndexes set [(_j-1), _i];
}; };
}; };
LB_CTRL = _lbcontrol; LB_CTRL = _lbcontrol;
{ {
_lbcontrol lnbDeleteRow _x; _lbcontrol lnbDeleteRow _x;
} count _deleteIndexes; } count _deleteIndexes;
@@ -375,22 +397,24 @@ _filterItems = {
_itemPicture = { _itemPicture = {
private ["_item"]; private ["_item"];
_item = _this select 0; _item = _this select 0;
_return = ""; _return = "";
if ([_item] call _isWeapon) then { if ([_item] call _isWeapon) then {
_return = getText(configfile >> "cfgWeapons" >> _item >> "picture"); _return = getText(configfile >> "cfgWeapons" >> _item >> "picture");
}; };
if ([_item] call _isMagazine) then { if ([_item] call _isMagazine) then {
_return = getText(configfile >> "cfgMagazines" >> _item >> "picture"); _return = getText(configfile >> "cfgMagazines" >> _item >> "picture");
}; };
_return;
_return
}; };
_itemDescription = { _itemDescription = {
private ["_inputItem","_return"]; private ["_inputItem","_return"];
_inputItem = _this select 0; _inputItem = _this select 0;
_return = ""; _return = "";
if ([_inputItem] call _isWeapon) then { if ([_inputItem] call _isWeapon) then {
_name = getText(configfile >> "cfgWeapons" >> _inputItem >> "descriptionShort"); _name = getText(configfile >> "cfgWeapons" >> _inputItem >> "descriptionShort");
_return = (_name); _return = (_name);
@@ -400,13 +424,13 @@ _itemDescription = {
_name = getText(configfile >> "cfgMagazines" >> _inputItem >> "descriptionShort"); _name = getText(configfile >> "cfgMagazines" >> _inputItem >> "descriptionShort");
_return = (_name); _return = (_name);
}; };
_return;
_return
}; };
_itemName = { _itemName = {
private ["_item"]; private ["_item"];
_item = _this select 0; _item = _this select 0;
_return = ""; _return = "";
if ([_item] call _isWeapon) then { if ([_item] call _isWeapon) then {
@@ -419,8 +443,9 @@ _itemName = {
_return = ( _name); _return = ( _name);
}; };
_return; _return
}; };
_displayItemIcon = { _displayItemIcon = {
private ["_selectedItem","_itemPicturePath"]; private ["_selectedItem","_itemPicturePath"];
_selectedItem = [] call _lbSelectedItem; _selectedItem = [] call _lbSelectedItem;
@@ -434,7 +459,6 @@ _displayItemDescription = {
_selectedItemN = [] call _lbSelectedItem; _selectedItemN = [] call _lbSelectedItem;
_selectedItemDescription = [_selectedItemN] call _itemDescription; _selectedItemDescription = [_selectedItemN] call _itemDescription;
_descriptionControl = _display displayctrl 1106; _descriptionControl = _display displayctrl 1106;
_descriptionControl ctrlSetStructuredText parseText(_selectedItemDescription); _descriptionControl ctrlSetStructuredText parseText(_selectedItemDescription);
}; };
@@ -446,6 +470,16 @@ _displayItemName = {
_nameControl ctrlSetText _itemName; _nameControl ctrlSetText _itemName;
}; };
_updateOnBack = {
private ["_onBackCtrl"];
_onBackCtrl = _display displayCtrl 1209;
if (dayz_onBack != "") then {
_onBackCtrl ctrlSetText ([dayz_onBack] call _itemPicture);
} else {
_onBackCtrl ctrlSetText "";
};
};
_output = true; _output = true;
_lbIDC = 105; _lbIDC = 105;
@@ -453,15 +487,15 @@ _lbIDC = 105;
switch _event do { switch _event do {
case "initDialog": { case "initDialog": {
[] call _showAllIDCs; //[] call _showAllIDCs;
}; };
case "onLoad": { case "onLoad": {
[] call _weaponsLBSetFocus; //[] call _weaponsLBSetFocus;
[] call _arrowsEnable; [] call _arrowsEnable;
[] call _displayItemIcon; [] call _displayItemIcon;
[] call _displayItemName; [] call _displayItemName;
[] call _displayItemDescription; [] call _displayItemDescription;
[] call _showAllIDCs; //[] call _showAllIDCs;
//[] call _arrowsEnable; //[] call _arrowsEnable;
//[] call _highlightGearSlots; //[] call _highlightGearSlots;
}; };
@@ -469,32 +503,38 @@ switch _event do {
//used for buyUnits //used for buyUnits
case "filter": { case "filter": {
IGUI_GEAR_activeFilter = IGUI_GEAR_activeFilter + 1; IGUI_GEAR_activeFilter = IGUI_GEAR_activeFilter + 1;
if (IGUI_GEAR_activeFilter > ((count _filterSets)-1 )) then { if (IGUI_GEAR_activeFilter > ((count _filterSets)-1 )) then {
IGUI_GEAR_activeFilter = 0; IGUI_GEAR_activeFilter = 0;
}; };
_doFilter = true; _doFilter = true;
}; };
//changing IGUI_GEAR_activeFilter, but not filter picture (used for buyGear) //changing IGUI_GEAR_activeFilter, but not filter picture (used for buyGear)
case "filterNotSet": { case "filterNotSet": {
IGUI_GEAR_activeFilter = IGUI_GEAR_activeFilter + 1; IGUI_GEAR_activeFilter = IGUI_GEAR_activeFilter + 1;
if (IGUI_GEAR_activeFilter > ((count _filterSets)-1 )) then { if (IGUI_GEAR_activeFilter > ((count _filterSets)-1 )) then {
IGUI_GEAR_activeFilter = 0; IGUI_GEAR_activeFilter = 0;
}; };
//_doFilter = true; //_doFilter = true;
}; };
case "filter_left": { case "filter_left": {
IGUI_GEAR_activeFilter = IGUI_GEAR_activeFilter - 1; IGUI_GEAR_activeFilter = IGUI_GEAR_activeFilter - 1;
if (IGUI_GEAR_activeFilter < 0) then { if (IGUI_GEAR_activeFilter < 0) then {
IGUI_GEAR_activeFilter = ((count _filterSets)-1 ); IGUI_GEAR_activeFilter = ((count _filterSets)-1 );
}; };
_doFilter = true; _doFilter = true;
}; };
case "onFocus": { case "onFocus": {
[] call _weaponsLBSetFocus; //[] call _weaponsLBSetFocus;
//[] call _arrowsEnable; //[] call _arrowsEnable;
}; };
@@ -509,11 +549,9 @@ switch _event do {
[] call _highlightGearSlots; [] call _highlightGearSlots;
}; };
case "onKillFocus": { case "onKillFocus": {
[] call _weaponsLBSetFocus; //[] call _weaponsLBSetFocus;
};
default {
}; };
default {};
}; };
/* Filter removed, moving to engine */ /* Filter removed, moving to engine */
@@ -525,4 +563,3 @@ if _doFilter then {
_output; _output;
false;

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
if (isServer) then { /*if (isServer) then {
waitUntil{dayz_preloadFinished}; waitUntil{dayz_preloadFinished};
}; };
_id = [] execFSM "\z\addons\dayz_code\system\player_monitor.fsm"; _id = [] execFSM "\z\addons\dayz_code\system\player_monitor.fsm";*/
if (DZE_R3F_WEIGHT) then { if (DZE_R3F_WEIGHT) then {
_void = [] execVM "\z\addons\dayz_code\external\R3F_Realism\R3F_Realism_Init.sqf"; _void = [] execVM "\z\addons\dayz_code\external\R3F_Realism\R3F_Realism_Init.sqf";
}; };

View File

@@ -1,3 +1,10 @@
// moved to dayz_code/system/scheduler/sched_playerActions.sqf
// moved to dayz_code/system/scheduler/sched_spawncheck.sqf
// moved to dayz_code/system/scheduler/sched_newDay.sqf
/*
private ["_handle","_cursor","_delMe","_first","_town","_day","_world","_nearestCity"]; private ["_handle","_cursor","_delMe","_first","_town","_day","_world","_nearestCity"];
_timer = diag_tickTime; _timer = diag_tickTime;
_timer1 = diag_tickTime; _timer1 = diag_tickTime;
@@ -73,3 +80,4 @@ while {true} do {
//wait //wait
uiSleep 0.001; uiSleep 0.001;
}; };
*/

View File

@@ -1,37 +1,154 @@
private ["_refObj","_size","_vel","_speed","_hunger","_thirst","_result","_factor","_distance","_lastTemp","_rnd","_listTalk","_id","_messTimer","_combatdisplay","_combatcontrol","_timeleft","_inVehicle","_lastUpdate","_foodVal","_thirstVal","_lowBlood","_startcombattimer","_combattimeout","_isPZombie","_outsideMap","_radsound","_bloodloss","_radTimer","_currentBlood","_wpnType","_dayzMags"]; private ["_hunger","_thirst","_timeOut","_result","_randomSpot","_distance","_mylastPos","_lastTemp","_rnd","_listTalk","_messTimer","_PlayerNearby","_ZedsNearby","_saveTime"];
disableSerialization; disableSerialization;
_timeOut = 0;
_messTimer = 0; _messTimer = 0;
_radTimer = 0;
_lastTemp = dayz_temperatur; _lastTemp = dayz_temperatur;
_debug = getMarkerpos "respawn_west";
_isPZombie = player isKindOf "PZombie_VB"; _isPZombie = player isKindOf "PZombie_VB";
_timer = diag_tickTime;
_timer1 = diag_tickTime;
_spawnCheck = diag_tickTime;
_timer2 = diag_Ticktime;
_timer5 = diag_Ticktime;
_timer10 = diag_Ticktime;
_timer30 = diag_Ticktime;
_timer150 = diag_ticktime;
_forceHumanity = false;
_runonce = false;
_timerMonitor = diag_ticktime;
player setVariable ["temperature",dayz_temperatur,true]; player setVariable ["temperature",dayz_temperatur,true];
player setVariable["friendlies",DZE_Friends,true]; player setVariable["friendlies",DZE_Friends,true];
dayz_myLoad = (((count dayz_myBackpackMags) * 0.2) + (count dayz_myBackpackWpns)) + (((count dayz_myMagazines) * 0.1) + (count dayz_myWeapons * 0.5)); dayz_myLoad = (((count dayz_myBackpackMags) * 0.2) + (count dayz_myBackpackWpns)) + (((count dayz_myMagazines) * 0.1) + (count dayz_myWeapons * 0.5));
while {true} do { [player,0] call player_humanityChange;
//player addMagazine "Hatchet_swing";
//player addWeapon "MeleeHatchet";
while {1 == 1} do {
_start = diag_tickTime;
//Initialize //Initialize
_refObj = vehicle player; _refObj = vehicle player;
_factor = 0.6; _factor = 0.6;
_inVehicle = (_refObj != player); _inVehicle = (_refObj != player);
// _size = (sizeOf typeOf _refObj) * _factor; _size = (sizeOf typeOf _refObj) * 0.6;
_vel = velocity player; _vel = velocity player;
_speed = (round((_vel distance [0,0,0]) * 3.5)) min 18; _speed = round((_vel distance [0,0,0]) * 3.5);
_saveTime = (playersNumber west * 2) + 10;
// dayz_areaAffect = _size; //reset rating always
if (((rating player) > 0) or ((rating player) < 0)) then {
player setUnitRank "PRIVATE";
};
dayz_myLoad = (((count dayz_myBackpackMags) * 0.2) + (count dayz_myBackpackWpns)) + (((count dayz_myMagazines) * 0.1) + (count dayz_myWeapons * 0.5));
//reset position
_randomSpot = true;
_tempPos = getPosATL player;
_distance = _debug distance _tempPos;
if (_distance < 2000) then {
_randomSpot = false;
};
_distance = [0,0,0] distance _tempPos;
if (_distance < 500) then {
_randomSpot = false;
};
if (!isNil "_mylastPos") then {
_distance = _mylastPos distance _tempPos;
if (_distance > 400) then {
_randomSpot = false;
};
};
if (_randomSpot) then {
_mylastPos = _tempPos;
};
if (!isNil "_mylastPos") then {
dayz_mylastPos = _mylastPos;
};
dayz_areaAffect = _size;
if (_speed > 0.1) then {
_timeOut = _timeOut + 1;
};
if (_timeOut > 150) then {
_humanity = player getVariable ["humanity",0];
if (_humanity < 1 or _forceHumanity) then {
if (vehicle player != player) then {
[player, round(_timeOut / 10)] call player_humanityChange;
_forceHumanity = false;
} else {
_humanity = _humanity + round(_timeOut / 10);
player setVariable["humanity",_humanity,true];
_forceHumanity = true;
};
};
_timeOut = 0;
};
/*
if ((Dayz_loginCompleted) && (diag_tickTime < 25)) then {
[player,0] call player_humanityChange;
diag_log ("Running");
_timer10 = diag_Ticktime;
};
*/
//reset OpenTarget variable if the timer has run out.
if (OpenTarget_Time > 0 && {diag_tickTime - OpenTarget_Time >= dayz_OpenTarget_TimerTicks}) then
{
player setVariable ["OpenTarget",false,true];
};
if ((diag_tickTime - _timer150) > 60) then {
//Digest Food.
if (r_player_foodstack > 0) then { r_player_foodstack = r_player_foodstack - 1; };
_timer150 = diag_ticktime;
};
if ((diag_tickTime - _timer) > 300) then {
//Other Counters
dayz_currentGlobalAnimals = count entities "CAAnimalBase";
dayz_currentGlobalZombies = count entities "zZombie_Base";
//Animals
//[] call player_animalCheck;
_timer = diag_tickTime;
};
//Every 30 seconds force the client to update the server of all medical Values
if ((diag_tickTime - _timer30) > 30) then {
[] spawn {
_medical = player call player_sumMedical;
PVDZ_playerMedicalSync = [player,_medical];
publicVariableServer "PVDZ_playerMedicalSync";
};
_timer30 = diag_tickTime;
};
//Record Check //Record Check
_lastUpdate = time - dayZ_lastPlayerUpdate; _lastUpdate = diag_ticktime - dayZ_lastPlayerUpdate;
if (_lastUpdate > 8) then { if (_lastUpdate > 8) then {
//POSITION? //POSITION?
_distance = dayz_myPosition distance _refObj; _distance = dayz_myPosition distance player;
if (_distance > 10) then { if (_distance > 10) then {
//Player has moved //Player has moved
dayz_myPosition = getPosATL _refObj; dayz_myPosition = getPosATL player;
// Check for radiation // Check for radiation
DZE_InRadiationZone = false; DZE_InRadiationZone = false;
@@ -41,39 +158,74 @@ while {true} do {
if((_outsideMap || DZE_Quarantine) && !r_player_dead && !isNull (findDisplay 46)) then { if((_outsideMap || DZE_Quarantine) && !r_player_dead && !isNull (findDisplay 46)) then {
DZE_InRadiationZone = true; DZE_InRadiationZone = true;
}; };
player setVariable["posForceUpdate",true,true]; player setVariable["posForceUpdate",true,true];
dayz_unsaved = true; dayz_unsaved = true;
dayZ_lastPlayerUpdate = time; dayZ_lastPlayerUpdate = diag_ticktime;
}; };
}; };
//Hunger _hunger = (abs((((r_player_bloodTotal - r_player_blood) / r_player_bloodTotal) * 5) + _speed + dayz_myLoad) * 3);
_hunger = +((((r_player_bloodTotal - r_player_blood) / r_player_bloodTotal) * 5) + _speed + dayz_myLoad) * 3; if (diag_ticktime - dayz_panicCooldown < 120) then {
if (time - dayz_panicCooldown < 120) then {
_hunger = _hunger * 2; _hunger = _hunger * 2;
}; };
dayz_hunger = dayz_hunger + (_hunger / 60); dayz_hunger = dayz_hunger + (_hunger / 60); //60 Updated to 80
dayz_hunger = (dayz_hunger min SleepFood) max 0;
if (dayz_hunger >= SleepFood) then {
if (r_player_blood < 10) then {
_id = [player,"starve"] spawn player_death;
};
};
//Thirst //Thirst
_thirst = 2; _thirst = 2;
if (_refObj == player) then {
_thirst = (_speed + 4) * 3;
};
if (!_inVehicle) then { if (!_inVehicle) then {
_thirst = (_speed + 4) * 3; _thirst = (_speed + 4) * 3;
}; };
dayz_thirst = dayz_thirst + (_thirst / 60) * (dayz_temperatur / dayz_temperaturnormal); //TeeChange Temperatur effects added Max Effects: -25% && + 16.6% waterloss dayz_thirst = dayz_thirst + (_thirst / 85) * (dayz_temperatur / dayz_temperaturnormal); //TeeChange Temperatur effects added Max Effects: -25% and + 16.6% waterloss
dayz_thirst = (dayz_thirst min SleepWater) max 0;
if (dayz_thirst >= SleepWater) then {
if (r_player_blood < 10) then {
_id = [player,"dehyd"] spawn player_death;
};
};
//diag_log format ["playerSpawn2 %1/%2",dayz_hunger,dayz_thirst];
//Calories
if (dayz_nutrition > 0) then {
_Nutrition = dayz_nutrition;
_hunger = (abs((((r_player_bloodTotal - r_player_blood) / r_player_bloodTotal) * 5) + _speed + dayz_myLoad) * 3);
_thirst = 2; if (_refObj == player) then {_thirst = (_speed + 4) * 3;};
_NutritionLoss = _Nutrition - (((_thirst / 1000) + (_hunger / 1000)) * (dayz_temperatur / dayz_temperaturnormal));
r_player_Nutrition = [_NutritionLoss];
} else {
r_player_Nutrition = [0];
};
dayz_nutrition = r_player_Nutrition select 0;
//Temperatur //Temperatur
2 call player_temp_calculation; //2 = sleep time of this loop //TeeChange 2 call player_temp_calculation; //2 = sleep time of this loop //TeeChange
if ((_lastTemp - dayz_temperatur) > 0.75 || (_lastTemp - dayz_temperatur) < -0.75 ) then { if ((_lastTemp - dayz_temperatur) > 0.75 or (_lastTemp - dayz_temperatur) < -0.75 ) then {
player setVariable ["temperature",dayz_temperatur,true]; player setVariable ["temperature",dayz_temperatur,false];
PVDZ_serverStoreVar = [player,"temperature",dayz_temperatur];
publicVariableServer "PVDZ_serverStoreVar";
_lastTemp = dayz_temperatur; _lastTemp = dayz_temperatur;
}; };
dayz_temperatur = (dayz_temperatur min dayz_temperaturmax) max dayz_temperaturmin;
//can get nearby infection //can get nearby infection
if (!r_player_infected && !_isPZombie) then { if (!r_player_infected && !_isPZombie) then {
// Infectionriskstart // Infectionriskstart
if (dayz_temperatur < ((80 / 100) * (dayz_temperaturnormal - dayz_temperaturmin) + dayz_temperaturmin)) then { //TeeChange if (dayz_temperatur < ((80 / 100) * (dayz_temperaturnormal - dayz_temperaturmin) + dayz_temperaturmin)) then { //TeeChange
_listTalk = (getPosATL _refObj) nearEntities ["CAManBase",8]; private "_listTalk";
_listTalk = _mylastPos nearEntities ["CAManBase",8]; //
{ {
if (_x getVariable["USEC_infected",false]) then { if (_x getVariable["USEC_infected",false]) then {
_rnd = (random 1) * (((dayz_temperaturnormal - dayz_temperatur) * (100 /(dayz_temperaturnormal - dayz_temperaturmin)))/ 50); //TeeChange _rnd = (random 1) * (((dayz_temperaturnormal - dayz_temperatur) * (100 /(dayz_temperaturnormal - dayz_temperaturmin)))/ 50); //TeeChange
@@ -99,46 +251,14 @@ while {true} do {
}; };
}; };
//If has infection reduce blood cough && add shake //If has infection reduce blood cough and add shake
if (r_player_infected) then { if (r_player_infected) then {
if !(player getVariable["USEC_infected",false]) then { if !(player getVariable["USEC_infected",false]) then {
player setVariable["USEC_infected",true,true]; player setVariable["USEC_infected",true,true];
}; };
_rnd = ceil (random 8); if (r_player_blood < 3) then {
[player,"cough",_rnd,false,9] call dayz_zombieSpeak; _id = [player,"sick"] spawn player_death;
if (_rnd < 3) then {
addCamShake [2, 1, 25];
};
if (r_player_blood > 3000) then {
r_player_blood = r_player_blood - 3;
};
};
//Pain Shake Effects
if (r_player_inpain && !r_player_unconscious) then {
playSound "breath_1";
addCamShake [2, 1, 25];
};
//Hunger Effect
_foodVal = dayz_statusArray select 0;
_thirstVal = dayz_statusArray select 1;
if (_thirstVal <= 0) then {
_result = r_player_blood - 10;
if (_result < 0) then {
_id = [player,"dehyd"] spawn player_death;
} else {
r_player_blood = _result;
};
};
if (_foodVal <= 0) then {
_result = r_player_blood - 10;
if (_result < 0) then {
_id = [player,"starve"] spawn player_death;
} else {
r_player_blood = _result;
}; };
}; };
@@ -172,91 +292,181 @@ while {true} do {
_radTimer = 0; _radTimer = 0;
}; };
// Health uptick when healty not thirsty || hungry // Regen some blood if player is well fed and resting
if (_foodVal >= 0.9 && _thirstVal >= 0.9) then { // Attention: regen _result must not trigger the "up" arrow of the blood icon
if (!r_player_infected && !r_player_inpain && !r_player_injured && !DZE_InRadiationZone) then { if (r_player_blood < 12000 and dayz_hunger < SleepFood
_result = r_player_blood + 10; and dayz_thirst < SleepWater and !r_player_injured
if (_result >= r_player_bloodTotal) then { and !r_player_infected and !(r_player_Sepsis select 0)
r_player_blood = r_player_bloodTotal; and !r_player_unconscious) then {
} else { _result = (1-(dayz_hunger + dayz_thirst)/(SleepWater + SleepFood));
r_player_blood = _result; switch (1==1) do {
case (_result < 0.25) : {}; // not well fed
case ((toArray(animationState player) select 5) == 112) : { // prone
_result = _result * (1 + 10 * (12000 - r_player_blood) / 12000);
};
case (speed player < 1) : { // still
_result = _result * (1 + 4 * sqrt((12000 - r_player_blood) / 12000));
};
default { // moving
}; };
}; };
r_player_bloodregen = r_player_bloodregen + _result;
}; };
//Record low blood if (r_player_blood > 12000) then {
r_player_blood = 12000;
};
//Record low bloow
_lowBlood = player getVariable ["USEC_lowBlood", false]; _lowBlood = player getVariable ["USEC_lowBlood", false];
if ((r_player_blood < r_player_bloodTotal) && !_lowBlood) then { if ((r_player_blood < r_player_bloodTotal) and !_lowBlood) then {
player setVariable["USEC_lowBlood",true,true]; player setVariable["USEC_lowBlood",true,true];
}; };
//Broadcast Hunger/Thirst //Broadcast Hunger/Thirst
_messTimer = _messTimer + 1; _messTimer = _messTimer + 1;
if (_messTimer > 15) then { if (_messTimer > 60) then {
_messTimer = 0; _messTimer = 0;
player setVariable ["messing",[dayz_hunger,dayz_thirst],true]; player setVariable ["messing",[dayz_hunger,dayz_thirst,dayz_nutrition],false];
};
// Update blood only if PVAR does not match GVAR. PVDZ_serverStoreVar = [player,"messing",[dayz_hunger,dayz_thirst,dayz_nutrition]];
_currentBlood = player getVariable ["USEC_BloodQty", 12000]; publicVariableServer "PVDZ_serverStoreVar";
if (_currentBlood != r_player_blood) then {
player setVariable["USEC_BloodQty",r_player_blood,true];
}; };
//Save Checker //Save Checker
if (dayz_unsaved) then { if (dayz_unsaved or ((diag_ticktime - dayz_lastSave) > 300)) then {
if ((time - dayz_lastSave) > DZE_SaveTime) then { if ((diag_ticktime - dayz_lastSave) > _saveTime) then {
_dayzMags = if (!isNil "dayz_Magazines" && {typeName dayz_Magazines == "ARRAY"} && {count dayz_Magazines > 0}) then {dayz_Magazines} else {magazines player};
PVDZE_plr_Save = [player,_dayzMags,false,false]; PVDZ_plr_Save = [player,nil,false,dayz_playerAchievements];
publicVariableServer "PVDZE_plr_Save"; publicVariableServer "PVDZ_plr_Save";
PVDZ_serverStoreVar = [player,"Achievements",dayz_playerAchievements];
publicVariableServer "PVDZ_serverStoreVar";
player setVariable ["Achievements",dayz_playerAchievements,false];
if (isServer) then {
PVDZ_plr_Save call server_playerSync;
};
dayz_unsaved = false; dayz_unsaved = false;
dayz_lastSave = time; dayz_lastSave = diag_ticktime;
dayz_Magazines = [];
}; };
}; };
// If in combat, display counter && restrict logout // sort out pickup actions
_isOK = (pickupInit and !canPickup) or (!pickupInit and canPickup);
if (_isOK) then {
if (pickupInit and !canPickup) then {
canPickup = true;
pickupInit = false;
};
} else {
// reset
canPickup = false;
pickupInit = true;
};
_PlayerNearby = false;
_ZedsNearby = false;
if ({isPlayer _x} count (player nearEntities ["AllVehicles", 5]) > 1) then {
_PlayerNearby = true;
};
if (count (player nearEntities ["zZombie_Base", 10]) > 0) then {
_ZedsNearby = true;
};
_startcombattimer = player getVariable["startcombattimer", 0]; _startcombattimer = player getVariable["startcombattimer", 0];
if (_startcombattimer == 1) then { if (_startcombattimer == 1 || _PlayerNearby) then {
player setVariable["combattimeout", time + 30, true]; player setVariable["combattimeout", diag_tickTime + 30, false];
player setVariable["startcombattimer", 0]; player setVariable["startcombattimer", 0, false];
dayz_combat = 1; } else {
if (_ZedsNearby) then {
player setVariable["combattimeout", diag_tickTime + 10, false];
player setVariable["startcombattimer", 0, false];
}; };
};
//setGroupIconsVisible [false,false];
//clearGroupIcons group player;
_combattimeout = player getVariable["combattimeout",0]; sleep 2;
if (_combattimeout > 0) then {
_timeleft = _combattimeout - time; _myPos = player getVariable["lastPos",[]];
if (_timeleft > 0) then { if (count _myPos > 0) then {
//hintSilent format["In Combat: %1",round(_timeleft)]; player setVariable["lastPos",_mylastPos, true];
} else { player setVariable["lastPos",[]];
//hintSilent "Not in Combat";
player setVariable["combattimeout", 0, true];
dayz_combat = 0;
_combatdisplay = uiNamespace getVariable 'DAYZ_GUI_display';
_combatcontrol = _combatdisplay displayCtrl 1307;
_combatcontrol ctrlShow true;
};
} else {
//hintSilent "Not in Combat";
dayz_combat = 0;
_combatdisplay = uiNamespace getVariable 'DAYZ_GUI_display';
_combatcontrol = _combatdisplay displayCtrl 1307;
_combatcontrol ctrlShow true;
}; };
//Melee Weapons ammo fix //Melee Weapons ammo fix
if(isNil {login_ammochecked}) then { if(isNil {login_ammochecked}) then {
login_ammochecked = true; login_ammochecked = true;
_wpnType = primaryWeapon player; _wpnType = primaryWeapon player;
_ismelee = (gettext (configFile >> "CfgWeapons" >> _wpnType >> "melee")); _ismelee = (getNumber (configFile >> "CfgWeapons" >> _wpnType >> "melee") == 1);
if (_ismelee == "true") then { if (_ismelee) then {
call dayz_meleeMagazineCheck; call dayz_meleeMagazineCheck;
}; };
}; };
// Blood Effects if ((diag_tickTime - _timer1) > 10) then {
"colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, (r_player_blood/r_player_bloodTotal)], [1, 1, 1, 0.0]]; _position = getPosATL player;
"colorCorrections" ppEffectCommit 0; _zeds = _position nearEntities ["zZombie_Base",200];
dayz_spawnZombies = 0;
uiSleep 2; dayz_CurrentNearByZombies = 0;
//Current amounts
{
if (alive _x) then {
if (local _x) then {
dayz_spawnZombies = dayz_spawnZombies + 1;
};
dayz_CurrentNearByZombies = dayz_CurrentNearByZombies + 1;
};
} count _zeds;
//dayz_spawnZombies = {alive _x AND local _x} count (_position nearEntities ["zZombie_Base",400]);
//dayz_CurrentNearByZombies = {alive _x} count (_position nearEntities ["zZombie_Base",400]);
dayz_currentWeaponHolders = count (_position nearObjects ["ReammoBox",200]);
//Remove empty cardborad box's << this needs to be changed moved (action menu or close button)
{
//get contents
_weapons = getWeaponCargo _x;
diag_log (str(_weapons));
_magazines = getMagazineCargo _x;
diag_log (str(_magazines));
_backpacks = getBackpackCargo _x;
diag_log (str(_backpacks));
if ((count (_weapons select 0) < 1) and (count (_magazines select 0) < 1) and (count (_backpacks select 0) < 1)) then {
//remove vehicle, Need to ask server to remove.
PVDZ_obj_Delete = [_x,player];
diag_log (str(PVDZ_obj_Delete));
publicVariableServer "PVDZ_obj_Delete";
};
} count (_position nearObjects ["CardboardBox",10]);
_timer1 = diag_tickTime;
};
//Two primary guns pickup exploit fix
if ((primaryWeapon player != "") && (!(primaryWeapon player in MeleeWeapons)) && (dayz_onBack != "") && (!(dayz_onBack in MeleeWeapons)) && (isNull (findDisplay 106)) &&
(animationState player != "amovpknlmstpslowwrfldnon_amovpknlmstpsraswrfldnon" OR animationState player != "amovpercmstpslowwrfldnon_amovpercmstpsraswrfldnon" OR animationState player != "amovpercmstpslowwrfldnon_amovpercmstpsraswrfldnon")) then {
cutText [localize "str_player_ammo_2primary","PLAIN DOWN"];
player playActionNow "stop";
player action ["dropWeapon", player, primaryWeapon player];
//sleep 3;
//["gear"] call player_switchWeapon;
//sleep 1;
};
//Crowbar ammo fix
//"MeleeCrowbar" call dayz_meleeMagazineCheck;
_stop = diag_tickTime;
/*
if ((diag_tickTime - _timerMonitor) > 60) then {
diag_log format ["Loop Monitor - Spawn2: %1, DA: %2, UA: %3, SA: %4",(_stop - _start),(diag_tickTime - (player getVariable "damageActions")),(diag_tickTime - (player getVariable "upgradeActions")),(diag_tickTime - (player getVariable "selfActions"))];
_timerMonitor = diag_ticktime;
};
*/
}; };

View File

@@ -0,0 +1,26 @@
private["_display","_control1","_control2"];
disableSerialization;
//diag_log "DEBUG: loadscreen guard started.";
_timeoutStart=diag_ticktime;
while {true} do {
if (diag_ticktime - _timeoutStart >= 120) exitWith {
1 cutText [localize "str_player_login_timeout", "PLAIN DOWN"];
sleep 5;
endMission "END1";
};
if ((!isNil "Dayz_loginCompleted") and {(Dayz_loginCompleted)}) exitWith {
//diag_log [ __FILE__, __LINE__, "End loop"];
};
_display = uiNameSpace getVariable "BIS_loadingScreen";
if ((!isNil "_display") and {(dayz_loadScreenMsg != "" )}) then {
_control1 = _display displayctrl 8400;
_control1 ctrlSetText dayz_loadScreenMsg;
};
_control2 = _display displayctrl 102;
_control2 ctrlSetText format["%1",floor(diag_ticktime - _timeoutStart)];
sleep 0.2;
//diag_log [ __FILE__, __LINE__, "Looping..."];
};

View File

@@ -1,2 +1,2 @@
waitUntil{!isnil "bis_fnc_init"}; //waitUntil{!isnil "bis_fnc_init"};
execVM "\z\addons\dayz_server\system\server_monitor.sqf"; //execVM "\z\addons\dayz_server\system\server_monitor.sqf";

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,575 @@
/*%FSM<COMPILE "C:\Program Files (x86)\Bohemia Interactive\Tools\FSM Editor Personal Edition\scriptedFSM.cfg, DayZ Zombie Wild Agent">*/
/*%FSM<HEAD>*/
/*
item0[] = {"init",0,250,-325.000000,-275.000000,-225.000000,-225.000000,0.000000,"init"};
item1[] = {"End",1,250,175.000000,-275.000000,275.000000,-225.000000,0.000000,"End"};
item2[] = {"Not_Alive",4,218,50.000000,300.000000,150.000000,350.000000,5.000000,"Not" \n "Alive"};
item3[] = {"loiter",4,218,-325.000000,0.000000,-225.000000,50.000000,0.000000,"loiter"};
item4[] = {"Loiter",2,4346,-325.000000,125.000000,-225.000000,175.000000,0.000000,"Loiter"};
item5[] = {"",7,210,-29.000042,321.000000,-20.999960,329.000000,0.000000,""};
item6[] = {"true",8,218,-325.000000,-175.000000,-225.000000,-125.000000,0.000000,"true"};
item7[] = {"Begin",2,250,-325.000000,-100.000000,-225.000000,-50.000000,0.000000,"Begin"};
item8[] = {"Has_Target",4,218,-150.000000,225.000000,-50.000000,275.000000,1.000000,"Has" \n "Target"};
item9[] = {"Chase",2,250,-150.000000,300.000000,-50.000000,350.000000,0.000000,"Chase"};
item10[] = {"",7,210,-29.000006,146.000000,-20.999996,154.000000,0.000000,""};
item11[] = {"",7,210,-29.000006,196.000000,-20.999996,204.000000,0.000000,""};
item12[] = {"",7,210,-104.000000,196.000000,-95.999992,204.000000,0.000000,""};
item13[] = {"Time_Check",4,218,-250.000000,50.000000,-150.000000,100.000000,0.000000,"Time" \n "Check"};
item14[] = {"Time_Check",4,218,-275.000000,300.000000,-175.000000,350.000000,0.000000,"Time" \n "Check"};
item15[] = {"No_Target",4,218,-275.000000,375.000000,-175.000000,425.000000,3.000000,"No" \n "Target"};
item16[] = {"",7,210,-479.000000,396.000000,-471.000000,404.000000,0.000000,""};
item17[] = {"",7,210,-479.000000,146.000000,-471.000000,154.000000,0.000000,""};
item18[] = {"",7,210,221.000000,321.000000,229.000000,329.000000,0.000000,""};
item19[] = {"Cleanup_",2,250,175.000000,200.000000,275.000000,250.000000,0.000000,"Cleanup?"};
item20[] = {"",7,210,-104.000023,396.000000,-95.999992,404.000000,0.000000,""};
item21[] = {"cant_see",4,218,-275.000000,450.000000,-175.000000,500.000000,2.000000,"cant" \n "see"};
item22[] = {"Finish_Move",2,250,-275.000000,525.000000,-175.000000,575.000000,0.000000,"Finish" \n "Move"};
item23[] = {"finished",4,218,-400.000000,525.000000,-300.000000,575.000000,1.000000,"finished"};
item24[] = {"",7,210,-479.000000,546.000000,-471.000000,554.000000,0.000000,""};
item25[] = {"time_up",4,218,175.000000,-25.000000,275.000000,25.000000,0.000000,"time" \n "up"};
item26[] = {"",7,210,271.000000,96.000000,279.000000,104.000008,0.000000,""};
item27[] = {"",7,210,221.000000,96.000008,229.000000,103.999977,0.000000,""};
item28[] = {"",7,210,271.000000,-79.000000,279.000000,-71.000000,0.000000,""};
item29[] = {"",7,210,221.000000,-79.000000,229.000000,-71.000000,0.000000,""};
item30[] = {"too_long",4,218,-400.000000,600.000000,-300.000000,650.000000,0.000000,"too long"};
item31[] = {"",7,210,-229.000000,621.000000,-221.000000,629.000000,0.000000,""};
item32[] = {"",7,210,-479.000000,621.000000,-471.000000,629.000000,0.000000,""};
item33[] = {"Reset_Targeting",2,250,-525.000000,325.000000,-425.000000,375.000000,0.000000,"Reset" \n "Targeting"};
item34[] = {"true",8,218,-525.000000,200.000000,-425.000000,250.000000,0.000000,"true"};
item35[] = {"deleted",4,218,225.000000,0.000000,325.000000,50.000000,0.000000,"deleted"};
item36[] = {"",7,210,-104.000000,471.000000,-95.999992,479.000000,0.000000,""};
item37[] = {"moveToCompleted",4,218,-400.000000,50.000000,-300.000000,100.000000,1.000000,"moveToCompleted "};
item38[] = {"Failed_to_move",4,218,-550.000000,-75.000000,-450.000000,-25.000000,2.000000,"Failed to move"};
item39[] = {"Second_Hand",4,218,-200.000000,-275.000000,-100.000000,-225.000000,0.000000,"Second Hand"};
item40[] = {"End_1",1,250,-75.000000,-275.000000,25.000000,-225.000000,0.000000,"End"};
item41[] = {"",7,210,-4.000000,-79.000000,4.000000,-71.000000,0.000000,""};
item42[] = {"",7,210,-4.000000,146.000000,4.000000,154.000000,0.000000,""};
item43[] = {"isLocal",4,218,25.000000,125.000000,125.000000,175.000000,5.000000,"isLocal"};
item44[] = {"",7,210,71.000000,-254.000000,79.000000,-246.000000,0.000000,""};
item45[] = {"____FAKE____",9,1800,0.000000,0.000000,0.000000,0.000000,0.000000,"____FAKE____"};
link0[] = {0,6};
link1[] = {0,39};
link2[] = {2,18};
link3[] = {3,4};
link4[] = {4,10};
link5[] = {4,13};
link6[] = {4,37};
link7[] = {5,2};
link8[] = {6,7};
link9[] = {7,3};
link10[] = {7,41};
link11[] = {8,9};
link12[] = {9,5};
link13[] = {9,14};
link14[] = {9,20};
link15[] = {10,11};
link16[] = {10,42};
link17[] = {11,5};
link18[] = {11,12};
link19[] = {12,8};
link20[] = {13,4};
link21[] = {14,9};
link22[] = {15,16};
link23[] = {16,33};
link24[] = {17,4};
link25[] = {18,19};
link26[] = {19,27};
link27[] = {20,15};
link28[] = {20,36};
link29[] = {21,22};
link30[] = {22,23};
link31[] = {22,31};
link32[] = {23,24};
link33[] = {24,16};
link34[] = {25,29};
link35[] = {26,35};
link36[] = {27,25};
link37[] = {27,26};
link38[] = {28,29};
link39[] = {29,1};
link40[] = {30,32};
link41[] = {31,30};
link42[] = {32,24};
link43[] = {33,34};
link44[] = {34,17};
link45[] = {35,28};
link46[] = {36,21};
link47[] = {37,4};
link48[] = {39,40};
link49[] = {41,42};
link50[] = {42,43};
link51[] = {43,44};
link52[] = {44,40};
link53[] = {38,45};
link54[] = {45,38};
globals[] = {25.000000,1,0,0,0,640,480,1,128,6316128,1,-571.718994,323.614502,673.426392,-311.286346,581,1030,1};
window[] = {2,-1,-1,-1,-1,831,52,1260,52,3,599};
*//*%FSM</HEAD>*/
class FSM
{
fsmName = "DayZ Zombie Wild Agent";
class States
{
/*%FSM<STATE "init">*/
class init
{
name = "init";
init = /*%FSM<STATEINIT""">*/"_position = _this select 0;" \n
"_agent = _this select 1;" \n
"" \n
"_secondHand = false;" \n
"" \n
"" \n
"if (count _this > 2) then {" \n
" //_secondHand = true;" \n
" diag_log (""Second Hand Zombie Initialized: "" + str(_this));" \n
"};" \n
"" \n
"" \n
"diag_log (""Agent Initialized: "" + str(_this));"/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "Second_Hand">*/
class Second_Hand
{
priority = 0.000000;
to="End_1";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"count _this > 2"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"diag_log (""Second Hand"");"/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "true">*/
class true
{
priority = 0.000000;
to="Begin";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"!(isNull _agent)"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
};
};
/*%FSM</STATE>*/
/*%FSM<STATE "End">*/
class End
{
name = "End";
init = /*%FSM<STATEINIT""">*/"if (!isNull _agent) then {" \n
" deleteVehicle _agent;" \n
"};"/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
};
};
/*%FSM</STATE>*/
/*%FSM<STATE "Loiter">*/
class Loiter
{
name = "Loiter";
init = /*%FSM<STATEINIT""">*/"_isAlive = alive _agent;" \n
"_isLocal = local _agent;" \n
"" \n
"_target = _agent call compile preprocessFileLineNumbers ""\z\addons\dayz_code\compile\zombie_findTargetAgent.sqf"";" \n
"" \n
"_agent moveTo _pos;" \n
"_agent forceSpeed 2;" \n
"" \n
"//if (_runonce) then {" \n
"// _agent moveTo _pos;" \n
"// _runonce = false;" \n
"//};" \n
"" \n
"_timeN = diag_tickTime;" \n
"" \n
"diag_log format [""Agent: %1, Distance: %2, Location: %3"",_agent,(_agent distance _pos),_pos];" \n
"" \n
"if (!_isLocal) then {" \n
"diag_log (""State ID: 6"");" \n
"diag_log (str(_pos));" \n
"diag_log (str(_this));" \n
"diag_log (str(_agent));" \n
"};"/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "Not_Alive">*/
class Not_Alive
{
priority = 5.000000;
to="Cleanup_";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"!_isAlive"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "isLocal">*/
class isLocal
{
priority = 5.000000;
to="End_1";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"!_isLocal"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "Has_Target">*/
class Has_Target
{
priority = 1.000000;
to="Chase";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"!(isNull _target)"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"//Leader cries out" \n
"" \n
"if (!_hasMoved) then {" \n
" _agent setVariable[""doLoiter"",true,true];" \n
"};" \n
"_countr = 0;" \n
"_losCheck = 0;" \n
"_advLosCheck = 0;" \n
"_cantSee = false;"/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "moveToCompleted">*/
class moveToCompleted
{
priority = 1.000000;
to="Loiter";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"moveToCompleted _agent"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"//_pos = [_position,20,100,1,0,10,0] call BIS_fnc_findSafePos;" \n
"_pos = [_position,20,100,1] call fn_selectRandomLocation;" \n
"" \n
"" \n
"if (!_isLocal) then {" \n
"diag_log (""State ID: 49"");" \n
"};"/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "Time_Check">*/
class Time_Check
{
priority = 0.000000;
to="Loiter";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"(diag_tickTime - _timeN) > 30"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"_pos = [_position,20,100,1] call fn_selectRandomLocation;"/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
};
};
/*%FSM</STATE>*/
/*%FSM<STATE "Begin">*/
class Begin
{
name = "Begin";
init = /*%FSM<STATEINIT""">*/"//_doLoiter = _agent getVariable[""doLoiter"",true];" \n
"" \n
"_array = [];" \n
"" \n
"_isLocal = local _agent;" \n
"" \n
"_runonce = true;" \n
"" \n
"_bodyStay = 60;" \n
"" \n
"_hasMoved = true;" \n
"" \n
"_agent disableAI ""FSM"";" \n
"_newDest = getPosATL _agent;" \n
"_timeN = time;" \n
"" \n
" _id = _agent addeventhandler [""HandleDamage"",{_this call local_zombieDamage}];" \n
"" \n
"_target = objNull;" \n
"_targetPos = [];" \n
"_countr = 0;" \n
"" \n
"//Spawn roaming script (individual to unit)" \n
"_entityTime = diag_tickTime;" \n
"_timeR = diag_tickTime;" \n
"" \n
"" \n
"diag_log (""State ID: 10"");" \n
""/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "isLocal">*/
class isLocal
{
priority = 5.000000;
to="End_1";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"!_isLocal"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "loiter">*/
class loiter
{
priority = 0.000000;
to="Loiter";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"_hasMoved"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"//_pos = [_position,20,100,1,0,10,0] call BIS_fnc_findSafePos;" \n
"_pos = [_position,20,100,1] call fn_selectRandomLocation;" \n
""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
};
};
/*%FSM</STATE>*/
/*%FSM<STATE "Chase">*/
class Chase
{
name = "Chase";
init = /*%FSM<STATEINIT""">*/"_timeN = diag_tickTime;" \n
"" \n
"if (speed _agent < 0.1) then {_countr = _countr + 1} else {_countr = 0};" \n
"_target = _agent call zombie_findTargetAgent;" \n
"_isAlive = alive _agent;" \n
"_targetPos = getPosATL _target;" \n
"" \n
"//Move to target" \n
"if (_agent distance _target > 2.2) then {" \n
" _agent moveTo _targetPos;" \n
" _agent forceSpeed 6;" \n
"};" \n
"" \n
"//Check if LOS" \n
"if (_losCheck == 5) then {" \n
" _losCheck = 0;" \n
" _cantSee = [_agent,_target] call dayz_losCheck;" \n
"};" \n
"" \n
"if (_cantSee) then {" \n
" _advLosCheck = _advLosCheck +1;" \n
"};" \n
""/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "Not_Alive">*/
class Not_Alive
{
priority = 5.000000;
to="Cleanup_";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"!_isAlive"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "No_Target">*/
class No_Target
{
priority = 3.000000;
to="Reset_Targeting";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"(isNull _target)"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "cant_see">*/
class cant_see
{
priority = 2.000000;
to="Finish_Move";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"_advLosCheck > 5"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "Time_Check">*/
class Time_Check
{
priority = 0.000000;
to="Chase";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"(diag_tickTime - _timeN) > 1"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"// reset stance to favorite one" \n
"if (_agent distance _target > 5) then {" \n
" _agent setUnitPos (_agent getVariable [""stance"", ""UP""]);" \n
"};" \n
"" \n
"//LOS Tick" \n
"_losCheck = _losCheck + 1;" \n
"" \n
"if (_agent distance _target <= 2.2) then {" \n
" _dir = [_agent,_target] call BIS_Fnc_dirTo;" \n
" _agent setDir _dir;" \n
"" \n
"// _agentPos = getPosATL _agent;" \n
"// _agent moveTo _agentPos;" \n
" _agent forceSpeed 0;" \n
"" \n
" if (speed _agent == 0) then {" \n
" _losCheck = _losCheck + 1;" \n
" };" \n
"};" \n
"" \n
"if (_agent distance _target > 2.2 AND _agent distance _target < 5) then {" \n
" //Stand up" \n
" _agent setUnitPos ""UP"";" \n
"};"/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
};
};
/*%FSM</STATE>*/
/*%FSM<STATE "Cleanup_">*/
class Cleanup_
{
name = "Cleanup_";
init = /*%FSM<STATEINIT""">*/"_waitStart = diag_tickTime;"/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "deleted">*/
class deleted
{
priority = 0.000000;
to="End";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"isNull _agent;"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "time_up">*/
class time_up
{
priority = 0.000000;
to="End";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"(diag_tickTime - _waitStart) > 300"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
};
};
/*%FSM</STATE>*/
/*%FSM<STATE "Finish_Move">*/
class Finish_Move
{
name = "Finish_Move";
init = /*%FSM<STATEINIT""">*/"_timeN = diag_tickTime;" \n
""/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "finished">*/
class finished
{
priority = 1.000000;
to="Reset_Targeting";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"_agent distance _targetPos < 3"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "too_long">*/
class too_long
{
priority = 0.000000;
to="Reset_Targeting";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"(diag_tickTime - _timeN) > 10"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
};
};
/*%FSM</STATE>*/
/*%FSM<STATE "Reset_Targeting">*/
class Reset_Targeting
{
name = "Reset_Targeting";
init = /*%FSM<STATEINIT""">*/"// reset stance to favorite one" \n
"_agent setUnitPos (_agent getVariable [""stance"", ""UP""]);" \n
"" \n
"if (!isNull _target) then {" \n
" _targetPos = getPosATL _target;" \n
" _agent setVariable [""myDest"",_targetPos];" \n
" _agent moveTo _targetPos;" \n
"};" \n
"" \n
"//Local" \n
"_agent setVariable [""localtargets"",[],false];" \n
"" \n
"//Remote" \n
"_remotetargets = [];" \n
"_remotetargets = _agent getVariable [""remotetargets"",[]];" \n
"" \n
"//Clear remote on reset" \n
"if (count _remotetargets > 0) then" \n
"{" \n
" _agent setVariable [""remotetargets"",[],true];" \n
"};" \n
"" \n
"//Clear Target" \n
"_target = objNull;"/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "true">*/
class true
{
priority = 0.000000;
to="Loiter";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
};
};
/*%FSM</STATE>*/
/*%FSM<STATE "End_1">*/
class End_1
{
name = "End_1";
init = /*%FSM<STATEINIT""">*/""/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/"diag_log (""End State"");"/*%FSM</STATEPRECONDITION""">*/;
class Links
{
};
};
/*%FSM</STATE>*/
/*%FSM<STATE "____FAKE____">*/
class ____FAKE____
{
name = "____FAKE____";
init = /*%FSM<STATEINIT""">*/""/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "Failed_to_move">*/
class Failed_to_move
{
priority = 2.000000;
to="____FAKE____";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"moveToFailed _agent"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"//_pos = [_position,20,100,1,0,10,0] call BIS_fnc_findSafePos;" \n
"" \n
"if (!_isLocal) then {" \n
"diag_log (""State ID: 50"");" \n
"};"/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
};
};
/*%FSM</STATE>*/
};
initState="init";
finalStates[] =
{
"End",
"End_1"
};
};
/*%FSM</COMPILE>*/