DayZ Mission System

Hi, new question - and it's probably more a SargeAI question but i'll ask here anyway. So i've got the missions spawning AI using Sarge instead of add_unit_server, like this:

Code:
//set markers
_this = createMarker ["SAR_marker_sm11", [(_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_sm11 = _this;
 
//spawn troops
[SAR_marker_sm11,3,1,3,"patrol",false] call SAR_AI;
[SAR_marker_sm11,3,0,3,"patrol",false] call SAR_AI;

And it seems to work ok, but i'm still testing it. One of the minor missions, i think its SM1, has an exit conditional that only returns when all AI are dead. In the example above, does anyone know how to test if AI spawned in marker 'SAR_marker_sm11' are alive/dead?
 
Hi, new question - and it's probably more a SargeAI question but i'll ask here anyway. So i've got the missions spawning AI using Sarge instead of add_unit_server, like this:

Code:
//set markers
_this = createMarker ["SAR_marker_sm11", [(_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_sm11 = _this;
 
//spawn troops
[SAR_marker_sm11,3,1,3,"patrol",false] call SAR_AI;
[SAR_marker_sm11,3,0,3,"patrol",false] call SAR_AI;

And it seems to work ok, but i'm still testing it. One of the minor missions, i think its SM1, has an exit conditional that only returns when all AI are dead. In the example above, does anyone know how to test if AI spawned in marker 'SAR_marker_sm11' are alive/dead?

what the mission did before you changed it was spawn a group with the name sniperteam
Code:
SniperTeam = createGroup resistance;
publicVariable "SniperTeam";
then checks for the amount of alive units in that group if 0 then mission complete. You can check sarge AI's spawn script to see if the groups are spawned using a global or local variable
Code:
SniperTeam = createGroup resistance;//global
_SniperTeam = createGroup resistance;//Local
and if its global you can check how many units are alive in that group
 
Has anyone else noticed , since installing the mission system, Sarge's military AI seem to be hostile to most all players? Quite odd
 
Sarge seems to be ok on my server. Survivors and military will happily ignore me unless i start taking potshots at them. Depends on your humanity level though I think. Bandits will of course always be hostile.
 
what the mission did before you changed it was spawn a group with the name sniperteam
Code:
SniperTeam = createGroup resistance;
publicVariable "SniperTeam";
then checks for the amount of alive units in that group if 0 then mission complete. You can check sarge AI's spawn script to see if the groups are spawned using a global or local variable
Code:
SniperTeam = createGroup resistance;//global
_SniperTeam = createGroup resistance;//Local
and if its global you can check how many units are alive in that group

yeah its the sniperteam mission. i had a quick look through the sarge code but i couldn't see where it does the checks, but its got to be in there somewhere because with sarge you can configure a marker and a corresponding static group, and sarge will respawn them when they all die (if its configured that way). I think sarge uses a group called 'west'(?), but i dont think i can use that in the mission script because there are AI units spawning/despawning all over the map with that group, so that exit condition would probably still not return true.
 
Ive got over 700k humanity and they dont hesitate to kill me and other heroes. We definitely dont shoot at them first
have you loadet the faction.sqf in your unit.sqf?​
Could you elaborate? I never touched the faction.sqf cause im running sarge. Did i miss a step somewhere?
 
Ive got over 700k humanity and they dont hesitate to kill me and other heroes. We definitely dont shoot at them first

Could you elaborate? I never touched the faction.sqf cause im running sarge. Did i miss a step somewhere?


no i just thought you maybe used it. Have you checked this lines in Sarge_AI_init.sqf?
Code:
// side definitions
createCenter east;
createCenter resistance;
 
// unfriendly AI bandits
EAST setFriend [WEST, 0];
EAST setFriend [RESISTANCE, 0];
 
// Players
WEST setFriend [EAST, 0];
WEST setFriend [RESISTANCE, 1];
 
// friendly AI
RESISTANCE setFriend [EAST, 0];
RESISTANCE setFriend [WEST, 1];
 
SAR_AI_friendly_side = resistance;
SAR_AI_unfriendly_side = east;

Crystal:
in your clenaup.fsm there is this line at 268:
Code:
"    if (count units _x==0) then {" \nif ((count units _x==0) && !(_x getVariable[""SAR_protect"",false])) then {" \n

This isnt as it should be on Sarges Tutorial. Try to replace it with this line instead :)
Code:
      "    if ((count units _x==0) && !(_x getVariable[""SAR_protect"",false])) then {" \n
 
yeah its the sniperteam mission. i had a quick look through the sarge code but i couldn't see where it does the checks, but its got to be in there somewhere because with sarge you can configure a marker and a corresponding static group, and sarge will respawn them when they all die (if its configured that way). I think sarge uses a group called 'west'(?), but i dont think i can use that in the mission script because there are AI units spawning/despawning all over the map with that group, so that exit condition would probably still not return true.

in sm1 you can try changing
waitUntil{({alive _x} count (units SniperTeam)) < 1};
to
waitUntil{{isPlayer _x && _x distance _hummer < 10 } count playableunits > 0};
 
Hmm ill have to check but ive had sarge running a long time and only recently added missions. This only started after i added missions
 
in sm1 you can try changing
waitUntil{({alive _x} count (units SniperTeam)) < 1};
to
waitUntil{{isPlayer _x && _x distance _hummer < 10 } count playableunits > 0};
yeah but there arent any vehicles spawned in that mission, i think its the only mission which doesnt have any. i could add a vehicle i suppose, but then it just becomes like the other missions.
 
I'm getting this error for some reason.
Code:
Error in expression <;
};
 
if (_object getVariable "Mission" == 1) exitWith {};
 
if (!_parachuteWest)>
22:31:20  Error position: <== 1) exitWith {};
 
if (!_parachuteWest)>

EDIT*

I am also getting this as well
Code:
23:46:24 Error in expression < (vehicle _x getVariable ["Mission",0] != 1) && !(vehicle _x in _safety) && (ty>
23:46:24  Error position: <!= 1) && !(vehicle _x in _safety) && (ty>
23:46:24  Error Generic error in expression
23:46:24 "Deleting object HMMWV_DZ with invalid ID at pos [11029.1,3036.18,0.00137329]"
 
no i just thought you maybe used it. Have you checked this lines in Sarge_AI_init.sqf?
Code:
// side definitions
createCenter east;
createCenter resistance;
 
// unfriendly AI bandits
EAST setFriend [WEST, 0];
EAST setFriend [RESISTANCE, 0];
 
// Players
WEST setFriend [EAST, 0];
WEST setFriend [RESISTANCE, 1];
 
// friendly AI
RESISTANCE setFriend [EAST, 0];
RESISTANCE setFriend [WEST, 1];
 
SAR_AI_friendly_side = resistance;
SAR_AI_unfriendly_side = east;

This is mine. Looks the same.

Code:
// side definitions
createCenter east;
createCenter resistance;
 
// unfriendly AI bandits
EAST setFriend [WEST, 0];
EAST setFriend [RESISTANCE, 0];
 
// Players
WEST setFriend [EAST, 0];
WEST setFriend [RESISTANCE, 1];
 
// friendly AI
RESISTANCE setFriend [EAST, 0];
RESISTANCE setFriend [WEST, 1];
 
SAR_AI_friendly_side = resistance;
SAR_AI_unfriendly_side = east;
 
yea that's all fine. I tried to test it a little further, it seems they aren't ALWAYS hostile.. something is triggering it involving the missions. When I was near a mission and was killing the bandit AI, the military AI walking nearby got pissed. And for some reason other heroes were getting shot at my military base. Must be a little bug or glitch or something.
 
Back
Top