Sarge AI mashed with ChernarusMission System.

duncacjb

New Member
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
//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];


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";
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.
 
Do the Ammo\Weapon\Supply crates spawn for you after you clear these missions?

Previously this block of code for me was:
_hummer setVariable ["Mission",1,true];
_hummer1 setVariable ["Mission",1,true];
_hummer2 setVariable ["Mission",1,true];

_crate = createVehicle ["USVehicleBox",_coords,[], 0, "CAN_COLLIDE"];
[_crate] execVM "\z\addons\dayz_server\missions\misc\fillBoxes.sqf";

_crate setVariable ["Mission",1,true];

And the crates DO NOT spawn at all (I use DZAI).

So Im hoping by changing to:
_hummer setVariable ["DZAI",1,true];
_hummer1 setVariable ["DZAI",1,true];
_hummer2 setVariable ["DZAI",1,true];

_crate = createVehicle ["USVehicleBox",_coords,[], 0, "CAN_COLLIDE"];
[_crate] execVM "\z\addons\dayz_server\missions\misc\fillBoxes.sqf";

_crate setVariable ["DZAI",1,true];

I'm hoping that ^^^ will make the crates spawn. I only ask because I see you have "Sarge" where I am using "DZAI".
 
do you know where i can find anny info about when i use sarge AI at epoch 1.0.2.4 my vendors dont load there stuff they sell it keeps loading and no list comes
 
Do the Ammo\Weapon\Supply crates spawn for you after you clear these missions?

Previously this block of code for me was:
_hummer setVariable ["Mission",1,true];
_hummer1 setVariable ["Mission",1,true];
_hummer2 setVariable ["Mission",1,true];

_crate = createVehicle ["USVehicleBox",_coords,[], 0, "CAN_COLLIDE"];
[_crate] execVM "\z\addons\dayz_server\missions\misc\fillBoxes.sqf";

_crate setVariable ["Mission",1,true];

And the crates DO NOT spawn at all (I use DZAI).

So Im hoping by changing to:
_hummer setVariable ["DZAI",1,true];
_hummer1 setVariable ["DZAI",1,true];
_hummer2 setVariable ["DZAI",1,true];

_crate = createVehicle ["USVehicleBox",_coords,[], 0, "CAN_COLLIDE"];
[_crate] execVM "\z\addons\dayz_server\missions\misc\fillBoxes.sqf";

_crate setVariable ["DZAI",1,true];

I'm hoping that ^^^ will make the crates spawn. I only ask because I see you have "Sarge" where I am using "DZAI".

I have not had a problem with the crates despawning or not appearing unless the crates are created in the same location as something else. you could try changing "Can_Collide" to a non colliding setting and that may help you.
 
do you know where i can find anny info about when i use sarge AI at epoch 1.0.2.4 my vendors dont load there stuff they sell it keeps loading and no list comes

i think i saw you post this on another link

there could be a couple of things...I know with 1.0.2.4 you have to manually update your database to reflect the changes..you can get that info and intructions at:
http://dayzepoch.com/wiki/index.php?title=Server_Installation_Instructions

Latest SQL
As we change pricing and add new items and/or missing items, use this SQL to keep up to date:
https://raw.github.com/vbawol/DayZ-Epoch/master/Server Files/mysql/epoch.sql
A webpage of all traders prices will be available.

if thats not the issue, then there could be a million possiblities...im not an expert when it comes to this language but i will help how ever i can!
 
So i solved the reason I started this thread...

Turns out, I needed to delete the marker used in order to get teh mission to repeat.

deletemarker 'markername';
 
Back
Top