SARGE AI Framework - Public Release

Status
Not open for further replies.
Hey stubbs, looking over your config file you seem to be missing a couple brackets and commas

check line 372 and line 380

at the end of those you need to add the bracket and in between each item you need a comma

for example line 372 the way you had it
Code:
SAR_leader_items = [["ItemSodaCoke",75],["FoodCanBakedBeans",60]]["ItemBloodbag",30]["ItemMorphine",40];

should look like
Code:
SAR_leader_items = [["ItemSodaCoke",75],["FoodCanBakedBeans",60],["ItemBloodbag",30],["ItemMorphine",40]];

you actually had the extra bracket but it was in the middle, do the same with line 380, and i think you should be good

Hey Sabbath,

Thanks so much, I figured I had missed something in the formatting, thanks so much again!
 
Hi Sarge, Amazing work,

I was wondering if you can help me with an error i found in the RPT log, everything seems to be working on the server, still testing at the minute, however i would like to clear this error if possible.

Error:

Code:
18:24:58 Error in expression <nipers}, {_i=_i+1}] do
{
_this = _group createunit [_sniperlist call BIS_fnc_sel>
18:24:58 Error position: <createunit [_sniperlist call BIS_fnc_sel>
18:24:58 Error Type Any, expected String
18:24:58 File mpmissions\__cur_mp.chernarus\addons\SARGE\SAR_setup_AI_patrol.sqf, line 142
18:24:58 Error in expression <nipers}, {_i=_i+1}] do
{
_this = _group createunit [_sniperlist call BIS_fnc_sel>
18:24:58 Error position: <createunit [_sniperlist call BIS_fnc_sel>
18:24:58 Error Type Any, expected String
18:24:58 File mpmissions\__cur_mp.chernarus\addons\SARGE\SAR_setup_AI_patrol.sqf, line 142
18:24:58 Error in expression <nipers}, {_i=_i+1}] do
{
_this = _group createunit [_sniperlist call BIS_fnc_sel>
18:24:58 Error position: <createunit [_sniperlist call BIS_fnc_sel>
18:24:58 Error Type Any, expected String
18:24:58 File mpmissions\__cur_mp.chernarus\addons\SARGE\SAR_setup_AI_patrol.sqf, line 142
18:24:58 Error in expression <flemen}, {_i=_i+1}] do
{
_this = _group createunit [_riflemenlist call BIS_fnc_s>
18:24:58 Error position: <createunit [_riflemenlist call BIS_fnc_s>
18:24:58 Error Type Any, expected String
18:24:58 File mpmissions\__cur_mp.chernarus\addons\SARGE\SAR_setup_AI_patrol.sqf, line 159
18:25:05 "3: Under fire by unkown target, moving to newpos"

And this is the segment from the addons\SARGE\SAR_setup_AI_patrol.sqf file
Code:
for [{_i=0}, {_i < _snipers}, {_i=_i+1}] do
{
    _this = _group createunit [_sniperlist call BIS_fnc_selectRandom, [(_rndpos select 0) - 30, _rndpos select 1, 0], [], 0.5, "FORM"];
 
    [_this,_sniper_weapon_names,_sniper_items,_sniper_tools] call SAR_unit_loadout;
 
    _this setVehicleInit "null = [this] execVM 'addons\SARGE\SAR_trace_entities.sqf';this setIdentity 'id_SAR';";
    _this addMPEventHandler ["MPkilled", {Null = _this execVM "addons\SARGE\SAR_aikilled.sqf";}];
    _this addMPEventHandler ["MPHit", {Null = _this execVM "addons\SARGE\SAR_aihit.sqf";}];
    [_this] joinSilent _group;
    // set skills
    {
        _this setskill [_x select 0,(_x select 1 +(floor(random 2) * (_x select 2)))];
    } foreach _sniperskills;
 
};
 
for [{_i=0}, {_i < _riflemen}, {_i=_i+1}] do
{
    _this = _group createunit [_riflemenlist call BIS_fnc_selectRandom, [(_rndpos select 0) + 30, _rndpos select 1, 0], [], 0.5, "FORM"];
 
    [_this,_soldier_weapon_names,_soldier_items,_soldier_tools] call SAR_unit_loadout;
 
    _this setVehicleInit "null = [this] execVM 'addons\SARGE\SAR_trace_entities.sqf';this setIdentity 'id_SAR_sold_man';"; 
    _this addMPEventHandler ["MPkilled", {Null = _this execVM "addons\SARGE\SAR_aikilled.sqf";}];
    _this addMPEventHandler ["MPHit", {Null = _this execVM "addons\SARGE\SAR_aihit.sqf";}]; 
    [_this] joinSilent _group;
 
    // set skills
    {
        _this setskill [_x select 0,(_x select 1 +(floor(random 2) * (_x select 2)))];
    } foreach _riflemanskills;
 
};

Thanks again for the release

Looks like you have an error in your sniper and rifleman skin definition in SAR_config.sqf.
 
I added some static AI to an area of my map, then warped myself there. I can't seem to find them. Are they not triggered if I spawn into the area they are supposed to be at if no one else is there? What log can I look at to see what the AI is doing?
 
Is it possible to add your own patrol path for the AI?

What I want to do:

Turn Skolyski island into a military base area. Put a few static patrols there. I also have the "excelsior bridge" added to my server, so I'm going to add a static fortify group at the end too.

Do a similar thing at NWAF

Put a few groups to spawn randomly around the map and patrol.

Now, just so I am understanding this right.... To do the static spawns I go to SAR_cfg_grps_chernarus.sqf.

I start at the "Marker Definition Section" and put in something like

Code:
//Skylisky Island Guards
this = createMarker ["Island_Guard1", [2519.3335, 13140.299]];
_this setMarkerShape "RECTANGLE";
_this setMarkeralpha 1;
_this setMarkerType "Flag";
_this setMarkerBrush "Solid";
_this setMarkerSize [100, 100];

Next Step: I don't want ANY heli patrols so...
Code:
//Heli Patrol NWAF
//[SAR_marker_helipatrol_nwaf,1,true] call SAR_AI_heli;
 
*Continue to // all the heli patrols*

Now, at the bottom there is the area set aside for the static troop spawns so I do....

Code:
[ISland_Guard1,1,1,2,"fortify",True] call SAR_AI;

This will create my first Static unit. 1 Leader 1 Sniper 2 Riflemen. This group will respawn. This group is set to fortify (See Question 2)

Q1: How do I configure the amount of time it takes the group to respawn. The one in SAR_config is commented to respawn only dynamic groups.
Q2: What does "Fortify" actually mean? Will the group patrol in a smaller area? Will they not move? Same thing with Ambush. Definitions somewhere? Google search got nada.
Q3: If I cannot set custom patrol paths, can I set how far away from spawn point the group will patrol? I've looked and looked and have not found this.

*Note* I set the humanity threshold for hostility to +250k so I assume all soldiers will attack all people now.
 
Ok i rechecked and tested the AI not shooting at you when you disembark a vehicle.

Scenarios:

a)
Me as bandit, getting into a heli WITHOUT having been spotted by any AI.
Flew over a static military AI group - they did NOT shoot at me, which is correct behaviour.
Landed and got out, moved in their field of view - got insta shot.

b)
Me as bandit, getting into a heli WITH having been spotted by any AI previously.
Flew over a static military AI group - they did NOT shoot at me, which is correct behaviour.
Landed and got out, moved in their field of view - got insta shot.

Seems to work here ...

sarge

I've not had the issue with a Heli.. also I am not bandit.. It is not the military A.I. popping off rounds at me, It is the Survivors.. Military always ignore me totally.. The bandits obviously shoot at me, the survivors shoot at me after getting out of a car/truck OR after tossing gear in my car/truck and walking back into spawn area. IF there are zeds there, they fire at them first, but if not they look at me for a second, then start shooting.

I walked into a hanger/garage with a Bus inside and 2 AI.. 1 Survivor 1 Sniper.. The survivor shot the Sniper, Jumped into the bus, Jumped back out and shot my mate that was with me... Totally ignoring me.. My mate had tried to place items in the Bus.. The AI again jumped back into the Bus and attempted to drive it out. I "in testing" tried to access the bus inventory when he stopped.. He jumped out and shot me.. I returned fire.. he died. I lost humanity.

I actually dont have an issue with it, as it adds more unpredicatability to the game, war stress and what not.. I just find it very odd that they only react to me occasionally.
 
I've not had the issue with a Heli.. also I am not bandit.. It is not the military A.I. popping off rounds at me, It is the Survivors.. Military always ignore me totally.. The bandits obviously shoot at me, the survivors shoot at me after getting out of a car/truck OR after tossing gear in my car/truck and walking back into spawn area. IF there are zeds there, they fire at them first, but if not they look at me for a second, then start shooting.

I walked into a hanger/garage with a Bus inside and 2 AI.. 1 Survivor 1 Sniper.. The survivor shot the Sniper, Jumped into the bus, Jumped back out and shot my mate that was with me... Totally ignoring me.. My mate had tried to place items in the Bus.. The AI again jumped back into the Bus and attempted to drive it out. I "in testing" tried to access the bus inventory when he stopped.. He jumped out and shot me.. I returned fire.. he died. I lost humanity.

I actually dont have an issue with it, as it adds more unpredicatability to the game, war stress and what not.. I just find it very odd that they only react to me occasionally.

can you post your sar_config? i think what you see as survivors are bandits in survivor skins ...
 
Is it possible to add your own patrol path for the AI?

What I want to do:

Turn Skolyski island into a military base area. Put a few static patrols there. I also have the "excelsior bridge" added to my server, so I'm going to add a static fortify group at the end too.

Do a similar thing at NWAF

Put a few groups to spawn randomly around the map and patrol.

Now, just so I am understanding this right.... To do the static spawns I go to SAR_cfg_grps_chernarus.sqf.

I start at the "Marker Definition Section" and put in something like

Code:
//Skylisky Island Guards
this = createMarker ["Island_Guard1", [2519.3335, 13140.299]];
_this setMarkerShape "RECTANGLE";
_this setMarkeralpha 1;
_this setMarkerType "Flag";
_this setMarkerBrush "Solid";
_this setMarkerSize [100, 100];

Next Step: I don't want ANY heli patrols so...
Code:
//Heli Patrol NWAF
//[SAR_marker_helipatrol_nwaf,1,true] call SAR_AI_heli;
 
*Continue to // all the heli patrols*

Now, at the bottom there is the area set aside for the static troop spawns so I do....

Code:
[ISland_Guard1,1,1,2,"fortify",True] call SAR_AI;

This will create my first Static unit. 1 Leader 1 Sniper 2 Riflemen. This group will respawn. This group is set to fortify (See Question 2)

Q1: How do I configure the amount of time it takes the group to respawn. The one in SAR_config is commented to respawn only dynamic groups.
Q2: What does "Fortify" actually mean? Will the group patrol in a smaller area? Will they not move? Same thing with Ambush. Definitions somewhere? Google search got nada.
Q3: If I cannot set custom patrol paths, can I set how far away from spawn point the group will patrol? I've looked and looked and have not found this.

*Note* I set the humanity threshold for hostility to +250k so I assume all soldiers will attack all people now.

First, change this:

Code:
//Skylisky Island Guards
this = createMarker ["Island_Guard1", [2519.3335, 13140.299]];
_this setMarkerShape "RECTANGLE";
_this setMarkeralpha 1;
_this setMarkerType "Flag";
_this setMarkerBrush "Solid";
_this setMarkerSize [100, 100];
Island_Guard1 = _this;
second, make the area smaller, so you can better control which building they fortify (you need to adjust this to fit your location):
_this setMarkerSize [20, 20];

regarding your questions:

1) this one sets the respawn times for dynamic AND static groups:
Code:
// time after which AI are respawned if configured
SAR_respawn_waittime = 30; // default 30 seconds

2) fortify means they look for potential slots in buildings and do NOT patrol. They will move out of the building to engage enemies though.

3) you can not define custom patrol paths, the waypoints for patrols are generated by the scripts. By defining the size of your area, you define how far they can go. The area that you define for them to spawn is an AREA, not a spawnpoint.

4) correct, if you set the humanity limit that high, all AI will attack all players.
 
Hi folks !, After reading every post in this thread I still cant get my AI working !. I wonder ... is this the area where I put the patrol pieces ? EX:
Code:
//---------------------------------------------------------------------------------
 
// add here if needed
// NWAF, 0 bandit groups, 2 soldier groups, 1 survivor groups - spawn probability ba,so,su - maximum group members ba,so,su
_check = [["max_grps","rnd_grps","max_p_grp"],[[0,2,1],[0,50,75],[0,2,4]],"SAR_area_1_4"] call SAR_AI_mon_upd;
// Kamenka, 0 bandit groups, 1 soldier groups, 2 survivor groups - spawn probability ba,so,su - maximum group members ba,so,su
_check = [["max_grps","rnd_grps","max_p_grp"],[[0,1,2],[0,100,100],[0,2,1]],"SAR_area_0_0"] call SAR_AI_mon_upd;
 
 
 
 
// ---- end of configuration area ----
 
Hi all, Im trying to stop the heli AI working if I delete where it says : "UH1H_DZ","Mi17_DZ" )in the SAR_config.sqf) below should that work plz or will it mess everything up.

Code:
define the type of heli(s) you want to use here for the heli patrols - make sure you include helis that have minimum 2 gunner positions, anything else might fail
SAR_heli_type=["UH1H_DZ","Mi17_DZ"];


Many thanks

robbie
 
Thank you sarge. excellent information.

Few others Qs tho.

Q1 Marker sizes in meters?

Q2 It looks like the AI will make patrol paths not on water automatic, so If I wanted to make them patrol the whole island thats possible no? Just set an area of the island and they should stay clear of the water.

Q3 If the path for the AI is clear, would they use my bridge and walk back and forth? I am guessing no as the bridge is made up of buildings. But Idk. Saw somewhere on the post you can set the axis of a marker. So set the marker right in the center of the bridge, make it roughly the same width and the same length and set the axis the same? It looks like they cant spawn on water either meaning they'd spawn on one of the shores.

Q4
Code:
SAR_dynamic_group_respawn = false;
 
// time after which AI are respawned if configured
SAR_respawn_waittime = 30; // default 30 seconds

Ok so Spawn wait time can be configured for the static units there. Does dynamic_group_respawn have to be true for this to happen? Or if left false does this make dynamic group respawn false while static respawns are controlled individually?

Q5 Whats the "ambush" tactic make happen? - Ive read this post and the most I can find is they find a road and wait. Skolisky has no roads though.

Sorry I couldn't make all 4 Qs yes/no :p One more post in a little while, the dynamic groups seem alot more confusing to me than the statics. I'm going to look through the code, read up on it, and then post what Im going to do to see if I'm going down the right path.

Also: For a future update it would be VERY nice if you could define custom patrol paths for static units.
 
Hmmmm


Code:
SAR_rifleman_weapon_list = ["M16A2">
20:19:09  Error Missing [
20:19:09 File mpmissions\__cur_mp.chernarus\addons\SARGE\SAR_config.sqf, line 373
20:19:09 Error in expression <,["Binocular_Vector",5],["NVGoggles",5],];
 
 
SAR_rifleman_weapon_list = ["M16A2">
20:19:09  Error position: <];

what did I do wrong here?
 
Hi all, Im trying to stop the heli AI working if I delete where it says : "UH1H_DZ","Mi17_DZ" )in the SAR_config.sqf) below should that work plz or will it mess everything up.

Code:
define the type of heli(s) you want to use here for the heli patrols - make sure you include helis that have minimum 2 gunner positions, anything else might fail
SAR_heli_type=["UH1H_DZ","Mi17_DZ"];


Many thanks

robbie

comment out the static heli spawns in your grps_cfg.sqf file. That's the better way to do it.
 
Code:
// potential weapon list for leaders
SAR_leader_weapon_list = ["M4A1","M4A3_CCO_EP1","AK_47_M","M14_EP1"];
SAR_leader_pistol_list = [];  // do NOT populate, Arma still has a bug that renders AI unresponsive after switching to the sidearm
 
// potential item list for leaders -> Item / Chance 1 - 100
SAR_leader_items = [["ItemSodaCoke",75],["FoodCanBakedBeans",60]];
SAR_leader_tools =  [["ItemMap",50],["ItemCompass",30],["Binocular_Vector",5],["NVGoggles",5],];
 
//potential weapon list for riflemen
SAR_rifleman_weapon_list = ["M16A2","M16A4_ACG","AK_74","M4A1"];
SAR_rifleman_pistol_list = [];  // do NOT populate, Arma still has a bug that renders AI unresponsive after switching to the sidearm
 
// potential item list for riflemen
SAR_rifleman_items = [["ItemSodaCoke",75],["FoodCanBakedBeans",60]];
SAR_rifleman_tools = [["ItemMap",50],["ItemCompass",30]];
 
//potential weapon list for snipers
SAR_sniper_weapon_list = ["M4A1_Aim","Huntingrifle"];
SAR_sniper_pistol_list = [];  // do NOT populate, Arma still has a bug that renders AI unresponsive after switching to the sidearm
 
// potential item list for snipers
SAR_sniper_items = [["ItemSodaCoke",75],["FoodCanBakedBeans",60],["Skin_Sniper1_DZ",10]];
SAR_sniper_tools = [["ItemMap",50],["ItemCompass",30]];

still not seeing the error, even though it says where it is

Edit: Moron Mode, Comma removed. DOH!
 
Thank you sarge. excellent information.

Few others Qs tho.

Q1 Marker sizes in meters?

Q2 It looks like the AI will make patrol paths not on water automatic, so If I wanted to make them patrol the whole island thats possible no? Just set an area of the island and they should stay clear of the water.

Q3 If the path for the AI is clear, would they use my bridge and walk back and forth? I am guessing no as the bridge is made up of buildings. But Idk. Saw somewhere on the post you can set the axis of a marker. So set the marker right in the center of the bridge, make it roughly the same width and the same length and set the axis the same? It looks like they cant spawn on water either meaning they'd spawn on one of the shores.

Q4
Code:
SAR_dynamic_group_respawn = false;
 
// time after which AI are respawned if configured
SAR_respawn_waittime = 30; // default 30 seconds

Ok so Spawn wait time can be configured for the static units there. Does dynamic_group_respawn have to be true for this to happen? Or if left false does this make dynamic group respawn false while static respawns are controlled individually?

Q5 Whats the "ambush" tactic make happen? - Ive read this post and the most I can find is they find a road and wait. Skolisky has no roads though.

Sorry I couldn't make all 4 Qs yes/no :p One more post in a little while, the dynamic groups seem alot more confusing to me than the statics. I'm going to look through the code, read up on it, and then post what Im going to do to see if I'm going down the right path.

Also: For a future update it would be VERY nice if you could define custom patrol paths for static units.


a) http://community.bistudio.com/wiki/setMarkerSize

b)correct. the waypoints are checked for being on land.

c) i would give that a try. define the marker in the 2d/3d editor, make it cover your bridge exactly and include some area on land. I am not sure if they will travel the bridge, you will need to try that.
d) spawn wait time applies to static and dynamic spawns. If you switch off dynamic respawn, static ones will still respawn after the set amount of time, IF set to respawn.
e) don't know about the behavior if there are no roads, why not simply try it out?

cheers, Sarge
 
Hmmmm


Code:
SAR_rifleman_weapon_list = ["M16A2">
20:19:09  Error Missing [
20:19:09 File mpmissions\__cur_mp.chernarus\addons\SARGE\SAR_config.sqf, line 373
20:19:09 Error in expression <,[CODE]"[Binocular_Vector",5],["NVGoggles",5]]
;


SAR_rifleman_weapon_list = ["M16A2">
20:19:09 Error position: <];
[/CODE]

what did I do wrong here?

Remove the comma like this:

Code:
"[Binocular_Vector",5],["NVGoggles",5]]
 
is there anyway to keep the heli's in the game that the AI are in. If you shoot them down and they do not explode you can repair them and go?
 
Status
Not open for further replies.
Back
Top