Chernarus Mission System
http://opendayz.net/threads/release-dayzchernarus-mission-system.12169/
Sarge AI
https://github.com/Swiss-Sarge/SAR_AI-1.5.0
So I like the chernarus mission system's controlled scheduling of missions. A mission pops up with loot, AI is spawned, the map is marked, and players are notified. The best part is that once the objectives are met the mission system will clear it all out and spawn a new mission. The bad part...the AI are dumb...very very dumb.
Sarge AI has better AI, im not a fan of the dynamic spawning. No real need for roaming AI and then there is the load on the server with 400 AI running around the map constantly spawning and despawning.
Solution...put the SAR AI into the mission system
Ive gotten the AI spawning, they are staying in the predefined area for the most part...sometimes they wander but usually thats when a player pisses them off. The problem I am having at the moment is that I cannot seem to get the same mission to run twice. The mission system calls for a random mission, and if the same one is chosen, regardless of new coords, the AI attempt to spawn and SAR AI debug recognizes them as spawning...but they do not actually join the mission. I tried deleting the markers (deletemarker 'xxxxx'
but that hasnt helped.
I'm thinking that it may have something to do with the groups as to why they are not spawning. How does Sar AI create its groups and what are the names? Would setting a trigger to detect when the group is dead which would delete the group be a good approach? Any thoughts?
Mission Finder
Mission File
I'm also having an issue with the AI not recognizing all players as hostile. I have the SAR AI set to <200000 humanity but they seem to just ignore certain players all together. Even if they are being shot. I do not have factions.sqf set up in the init file.
http://opendayz.net/threads/release-dayzchernarus-mission-system.12169/
Sarge AI
https://github.com/Swiss-Sarge/SAR_AI-1.5.0
So I like the chernarus mission system's controlled scheduling of missions. A mission pops up with loot, AI is spawned, the map is marked, and players are notified. The best part is that once the objectives are met the mission system will clear it all out and spawn a new mission. The bad part...the AI are dumb...very very dumb.
Sarge AI has better AI, im not a fan of the dynamic spawning. No real need for roaming AI and then there is the load on the server with 400 AI running around the map constantly spawning and despawning.
Solution...put the SAR AI into the mission system
Ive gotten the AI spawning, they are staying in the predefined area for the most part...sometimes they wander but usually thats when a player pisses them off. The problem I am having at the moment is that I cannot seem to get the same mission to run twice. The mission system calls for a random mission, and if the same one is chosen, regardless of new coords, the AI attempt to spawn and SAR AI debug recognizes them as spawning...but they do not actually join the mission. I tried deleting the markers (deletemarker 'xxxxx'
I'm thinking that it may have something to do with the groups as to why they are not spawning. How does Sar AI create its groups and what are the names? Would setting a trigger to detect when the group is dead which would delete the group be a good approach? Any thoughts?
Mission Finder
//By Craig
//Chooses the next sidemission
if(!isServer) exitWith {};
private ["_numb","_element","_num","_firstRun"];
if(isNil {ReAccur}) then { ReAccur = ["SM3","SM4","SM5","SM6"];};
if(isNil {SMCarray}) then { SMCarray = [];};
if (count SMarray == 0) then
{
_element = ReAccur call BIS_fnc_selectRandom;
} else {
_numb = count SMarray;
_num = floor (random _numb);
_element = SMarray select _num;
_Earray = [_element];
};
[] execVM format ["\z\addons\dayz_server\missions\major\%1.sqf",_element];
//Chooses the next sidemission
if(!isServer) exitWith {};
private ["_numb","_element","_num","_firstRun"];
if(isNil {ReAccur}) then { ReAccur = ["SM3","SM4","SM5","SM6"];};
if(isNil {SMCarray}) then { SMCarray = [];};
if (count SMarray == 0) then
{
_element = ReAccur call BIS_fnc_selectRandom;
} else {
_numb = count SMarray;
_num = floor (random _numb);
_element = SMarray select _num;
_Earray = [_element];
};
[] execVM format ["\z\addons\dayz_server\missions\major\%1.sqf",_element];
Mission File
//Weapons Cache by lazyink (Full credit for original code to TheSzerdi & TAW_Tonic)
private ["_coords","_MainMarker","_wait"];
[] execVM "\z\addons\dayz_server\Missions\SMGoMajor.sqf";
WaitUntil {MissionGo == 1};
_coords = [getMarkerPos "center",0,5500,100,0,20,0] call BIS_fnc_findSafePos;
[nil,nil,rTitleText,"Soldiers have discovered a weapons cache! Check your map for the location!", "PLAIN",10] call RE;
Ccoords = _coords;
publicVariable "Ccoords";
[] execVM "debug\addmarkers.sqf";
_hummer = createVehicle ["Pickup_PK_TK_GUE_EP1",[(_coords select 0) + 10, (_coords select 1) - 20,0],[], 0, "CAN_COLLIDE"];
_hummer1 = createVehicle ["UAZ_Unarmed_TK_EP1",[(_coords select 0) + 20, (_coords select 1) - 10,0],[], 0, "CAN_COLLIDE"];
_hummer2 = createVehicle ["SUV_Camo",[(_coords select 0) + 30, (_coords select 1) + 10,10],[], 0, "CAN_COLLIDE"];
_hummer setVariable ["Sarge",1,true];
_hummer1 setVariable ["Sarge",1,true];
_hummer2 setVariable ["Sarge",1,true];
_crate = createVehicle ["USVehicleBox",_coords,[], 0, "CAN_COLLIDE"];
[_crate] execVM "\z\addons\dayz_server\missions\misc\fillBoxes.sqf";
_crate setVariable ["Sarge",1,true];
//set markers
_this = createMarker ["SAR_marker_sm1", [(_coords select 0) + 1, (_coords select 1) + 1]];
_this setMarkerShape "RECTANGLE";
_this setMarkeralpha 0;
_this setMarkerType "Flag";
_this setMarkerBrush "Solid";
_this setMarkerSize [250, 250];
_this setMarkerDir 120.050;
SAR_marker_sm1 = _this;
_this = createMarker ["SAR_marker_sm1v", [(_coords select 0) + 50, (_coords select 1) + 1]];
_this setMarkerShape "RECTANGLE";
_this setMarkeralpha 0;
_this setMarkerType "Flag";
_this setMarkerBrush "Solid";
_this setMarkerSize [350, 350];
_this setMarkerDir 120.050;
SAR_marker_sm1v = _this;
//spawn troops
[SAR_marker_sm1,1,3,5,"fortify",false] call SAR_AI;
[SAR_marker_sm1,1,0,4,"patrol",false] call SAR_AI;
[SAR_marker_sm1,1,0,4,"patrol",false] call SAR_AI;
[SAR_marker_sm1v,3,["Pickup_PK_GUE"],[[1,0,2]],false] call SAR_AI_land;
/*
_aispawn = [_coords,80,6,6,1] execVM "\z\addons\dayz_server\missions\add_unit_server.sqf";//AI Guards
sleep 5;
_aispawn = [_coords,80,6,6,1] execVM "\z\addons\dayz_server\missions\add_unit_server.sqf";//AI Guards
sleep 5;
_aispawn = [_coords,40,4,4,1] execVM "\z\addons\dayz_server\missions\add_unit_server.sqf";//AI Guards
sleep 5;
_aispawn = [_coords,40,4,4,1] execVM "\z\addons\dayz_server\missions\add_unit_server.sqf";//AI Guards
sleep 5;
*/
waitUntil{{isPlayer _x && _x distance _hummer < 10 } count playableunits > 0};
[nil,nil,rTitleText,"The weapons cache is under survivor control!", "PLAIN",6] call RE;
[] execVM "debug\remmarkers.sqf";
MissionGo = 0;
Ccoords = 0;
publicVariable "Ccoords";
deletemarker 'SAR_marker_sm1';
deletemarker 'SAR_marker_sm1v';
SM1 = 1;
[0] execVM "\z\addons\dayz_server\missions\major\SMfinder.sqf";
private ["_coords","_MainMarker","_wait"];
[] execVM "\z\addons\dayz_server\Missions\SMGoMajor.sqf";
WaitUntil {MissionGo == 1};
_coords = [getMarkerPos "center",0,5500,100,0,20,0] call BIS_fnc_findSafePos;
[nil,nil,rTitleText,"Soldiers have discovered a weapons cache! Check your map for the location!", "PLAIN",10] call RE;
Ccoords = _coords;
publicVariable "Ccoords";
[] execVM "debug\addmarkers.sqf";
_hummer = createVehicle ["Pickup_PK_TK_GUE_EP1",[(_coords select 0) + 10, (_coords select 1) - 20,0],[], 0, "CAN_COLLIDE"];
_hummer1 = createVehicle ["UAZ_Unarmed_TK_EP1",[(_coords select 0) + 20, (_coords select 1) - 10,0],[], 0, "CAN_COLLIDE"];
_hummer2 = createVehicle ["SUV_Camo",[(_coords select 0) + 30, (_coords select 1) + 10,10],[], 0, "CAN_COLLIDE"];
_hummer setVariable ["Sarge",1,true];
_hummer1 setVariable ["Sarge",1,true];
_hummer2 setVariable ["Sarge",1,true];
_crate = createVehicle ["USVehicleBox",_coords,[], 0, "CAN_COLLIDE"];
[_crate] execVM "\z\addons\dayz_server\missions\misc\fillBoxes.sqf";
_crate setVariable ["Sarge",1,true];
//set markers
_this = createMarker ["SAR_marker_sm1", [(_coords select 0) + 1, (_coords select 1) + 1]];
_this setMarkerShape "RECTANGLE";
_this setMarkeralpha 0;
_this setMarkerType "Flag";
_this setMarkerBrush "Solid";
_this setMarkerSize [250, 250];
_this setMarkerDir 120.050;
SAR_marker_sm1 = _this;
_this = createMarker ["SAR_marker_sm1v", [(_coords select 0) + 50, (_coords select 1) + 1]];
_this setMarkerShape "RECTANGLE";
_this setMarkeralpha 0;
_this setMarkerType "Flag";
_this setMarkerBrush "Solid";
_this setMarkerSize [350, 350];
_this setMarkerDir 120.050;
SAR_marker_sm1v = _this;
//spawn troops
[SAR_marker_sm1,1,3,5,"fortify",false] call SAR_AI;
[SAR_marker_sm1,1,0,4,"patrol",false] call SAR_AI;
[SAR_marker_sm1,1,0,4,"patrol",false] call SAR_AI;
[SAR_marker_sm1v,3,["Pickup_PK_GUE"],[[1,0,2]],false] call SAR_AI_land;
/*
_aispawn = [_coords,80,6,6,1] execVM "\z\addons\dayz_server\missions\add_unit_server.sqf";//AI Guards
sleep 5;
_aispawn = [_coords,80,6,6,1] execVM "\z\addons\dayz_server\missions\add_unit_server.sqf";//AI Guards
sleep 5;
_aispawn = [_coords,40,4,4,1] execVM "\z\addons\dayz_server\missions\add_unit_server.sqf";//AI Guards
sleep 5;
_aispawn = [_coords,40,4,4,1] execVM "\z\addons\dayz_server\missions\add_unit_server.sqf";//AI Guards
sleep 5;
*/
waitUntil{{isPlayer _x && _x distance _hummer < 10 } count playableunits > 0};
[nil,nil,rTitleText,"The weapons cache is under survivor control!", "PLAIN",6] call RE;
[] execVM "debug\remmarkers.sqf";
MissionGo = 0;
Ccoords = 0;
publicVariable "Ccoords";
deletemarker 'SAR_marker_sm1';
deletemarker 'SAR_marker_sm1v';
SM1 = 1;
[0] execVM "\z\addons\dayz_server\missions\major\SMfinder.sqf";