How to put AI in specific coordinates?

Chalk1990

Member
I want to be able to place a soldier group in a specific area to patrol/defend a camp, in that players/bandits can attack that camp to gain an objective, or reward.


How do I go about doing this?
 
Please watch the video showing how to instal Sarge's AI, it is explained briefly at the end of it ;) That would get you on track :)

( "Youtube Guide" to be more precise)
 
I can't get them to spawn. I'm running Fallujah, this is my entire SAR_cfg_grps_fallujah.sqf

Code:
// =========================================================================================================
//  SAR_AI - DayZ AI library
//  Version: 1.0.0
//  Author: Sarge ([email protected])
//
//        Wiki: to come
//        Forum: to come
//       
// ---------------------------------------------------------------------------------------------------------
//  Required:
//  UPSMon 
//  SHK_pos
// 
// ---------------------------------------------------------------------------------------------------------
//  area, group & spawn  cfg file for Fallujah
//  last modified: 5.3.2013
// ---------------------------------------------------------------------------------------------------------
 
/* reconfiguring the properties of the grid (keep in mind the grid has default settings, but these you should overwrite where needed).
 
IMPORTANT: The grid squares are named like : SAR_area_0_0
 
where the first 0 is the x counter, and the second 0 the y counter.
 
So to adress the bottom left square in the grid, you use SAR_area_0_0.
The square above that one would be: SAR_area_0_1
the square one to the right of the bottom left square is SAR_area_1_0
 
You want to change the number arrays in the below lines:
 
The order for these numbers is always [BANDIT, SURVIVOR, SOLDIER]
 
Lets take an example for Chernarus
 
// 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,75,100],[0,4,3]],"SAR_area_0_0"] call SAR_AI_mon_upd;
 
[[0,1,2],[0,75,100],[0,4,3]]
 
the first set of numbers : 0,1,2
stands for
0 bandit groups
1 soldier group
2 surivors groups
thats the max that can spawn in this grid
 
the second set of numbers : 0,75,100
that means:
0% probability to spawn bandit groups
75% for soldiers
100% for survivors
 
the last set of numbers : 0,4,3
thats the maximum number of ppl in the group (plus 1 leader)
0 bandits
max 4 (+1 leader) soldiers
max 3 (+1 leader) survivors
this number is randomized
 
 
*/
// --------------------------------------------------
// grid definition for the automatic spawn system
//
// examples see the chernarus file
// --------------------------------------------------
 
 
 
// ---------------------------------------------------------------
// Definition of area markers for static spawns
// ---------------------------------------------------------------
 
// Hangar East
_this = createMarker ["SAR_patrol_hangareast", [8294.14, 2050.6, 0];
_this setMarkerShape "RECTANGLE";
_this setMarkeralpha 0;
_this setMarkerType "Flag";
_this setMarkerBrush "Solid";
_this setMarkerSize [5, 5];
SAR_marker_hangareast = _this;
 
// Firehouse AF
_this = createMarker ["SAR_patrol_firehouse", [7892.68, 2067.22, 0]];
_this setMarkerShape "RECTANGLE";
_this setMarkeralpha 0;
_this setMarkerType "Flag";
_this setMarkerBrush "Solid";
_this setMarkerSize [5, 5];
SAR_marker_firehouse = _this;
 
// PVP FOB
_this = createMarker ["SAR_patrol_pvpfob", [4024.74, 3391.39, 0]];
_this setMarkerShape "RECTANGLE";
_this setMarkeralpha 0;
_this setMarkerType "Flag";
_this setMarkerBrush "Solid";
_this setMarkerSize [5, 5];
SAR_marker_pvpfob = _this;
 
// North AF
_this = createMarker ["SAR_patrol_naf", [2916.64, 6386.32, 0]];
_this setMarkerShape "RECTANGLE";
_this setMarkeralpha 0;
_this setMarkerType "Flag";
_this setMarkerBrush "Solid";
_this setMarkerSize [5, 5];
SAR_marker_naf = _this;
 
// South Bridge
_this = createMarker ["SAR_patrol_south", [4045.88, 681.813, 0]];
_this setMarkerShape "RECTANGLE";
_this setMarkeralpha 0;
_this setMarkerType "Flag";
_this setMarkerBrush "Solid";
_this setMarkerSize [5, 5];
SAR_marker_south = _this;
 
// Hospital
_this = createMarker ["SAR_patrol_hospital", [5532.57, 207.763, 0]];
_this setMarkerShape "RECTANGLE";
_this setMarkeralpha 0;
_this setMarkerType "Flag";
_this setMarkerBrush "Solid";
_this setMarkerSize [5, 5];
SAR_marker_hospital = _this;
 
 
 
// ----------------------------------------------------------------------------------------
// End of area marker definition section
// ----------------------------------------------------------------------------------------
 
diag_log format["SAR_AI: Area & Trigger definition finalized"];
diag_log format["SAR_AI: Static Spawning for Helicopter patrols started"];
 
//
// Static, predefined heli patrol areas with configurable units
//
// Parameters used:
//                  Areaname
//                  1,2,3 = soldier, survivors, bandits
//
 
// add if needed, see examples in the chernarus file
 
diag_log format["SAR_AI: Static Spawning for Helicopter patrols finished"];
 
//---------------------------------------------------------------------------------
// Static, predefined infantry patrols in defined areas with configurable units
//---------------------------------------------------------------------------------
// Example: [SAR_area_DEBUG,1,0,1,""] call SAR_AI;
//
// SAR_area_DEBUG = areaname (must have been defined further up)
// 1 = type of group (1 = soldiers, 2 = survivors, 3 = bandits)
// 0 = amount of snipers in the group
// 1 = amount of rifleman in the group
//
//
 
// Example entries:
// SARGE DEBUG - Debug group
// military, 0 snipers, 1 riflemen, patrol
//[SAR_area_DEBUG,1,0,1,""] call SAR_AI;
 
// military, 2 snipers, 4 riflemen, patrol
//[SAR_area_DEBUG,1,2,4,""] call SAR_AI;
 
// survivors, 1 snipers, 3 riflemen, patrolling the NWAF
//[SAR_marker_helipatrol_nwaf,2,1,3,""] call SAR_AI;
 
// bandits, 5 snipers, 2 riflemen, patrolling the NWAF
//[SAR_marker_helipatrol_nwaf,3,5,2,""] call SAR_AI;
//---------------------------------------------------------------------------------
 
// add here if needed
 
//Hangar East
[SAR_marker_hangareast,1,2,4,"fortify",true] call SAR_AI;
 
//Firehouse AF
[SAR_marker_firehouse,1,2,4,"fortify",true] call SAR_AI;
 
//PVP FOB
[SAR_marker_pvpfob,2,3,6,"fortify",true] call SAR_AI;
 
//North AF
[SAR_marker_naf,1,2,4,"fortify",true] call SAR_AI;
 
//South Bridge
[SAR_marker_south,3,1,4,"ambush",true] call SAR_AI;
 
//Hospital
[SAR_marker_hospital,1,1,4,"patrol",true] call SAR_AI;
 
 
 
 
 
// ---- end of configuration area ----
 
diag_log format["SAR_AI: Static Spawning for infantry patrols finished"];
 
can i see the beginning of my SAR Ai logging in your rpt ?

We might again have the issue that there are 2 different fallujah maps out there ...

tx, Sarge
 
can i see the beginning of my SAR Ai logging in your rpt ?

We might again have the issue that there are 2 different fallujah maps out there ...

tx, Sarge

This?

Code:
Error in expression <ol_hangareast", [8294.14, 2050.6, 0.082];
_this setMarkerShape "RECTANGLE";
_thi>
  Error position: <;
_this setMarkerShape "RECTANGLE";
_thi>
  Error Missing ]
File mpmissions\__CUR_MP.fallujah\addons\SARGE\map_config\SAR_cfg_grps_fallujah.sqf, line 75
Error in expression <ol_hangareast", [8294.14, 2050.6, 0.082];
_this setMarkerShape "RECTANGLE";
_thi>
  Error position: <;
_this setMarkerShape "RECTANGLE";
_thi>
  Error Missing ]
File mpmissions\__CUR_MP.fallujah\addons\SARGE\map_config\SAR_cfg_grps_fallujah.sqf, line 75
"PLOGIN: Player Model Exists"
"PLOGIN: Player Ready"
 
You are already missing a bracket here ---> (Positioned it for you)

Code:
// Hangar East
_this = createMarker ["SAR_patrol_hangareast", [8294.14, 2050.6, 0]];
_this setMarkerShape "RECTANGLE";
_this setMarkeralpha 0;
_this setMarkerType "Flag";
_this setMarkerBrush "Solid";
_this setMarkerSize [5, 5];
SAR_marker_hangareast = _this;
 
That's the only one that I was missing a bracket on, but the AI don't spawn at the other grids I placed either?

Here's My entire file:

Code:
// =========================================================================================================
//  SAR_AI - DayZ AI library
//  Version: 1.0.0
//  Author: Sarge ([email protected])
//
//        Wiki: to come
//        Forum: to come
//       
// ---------------------------------------------------------------------------------------------------------
//  Required:
//  UPSMon 
//  SHK_pos
// 
// ---------------------------------------------------------------------------------------------------------
//  area, group & spawn  cfg file for Fallujah
//  last modified: 5.3.2013
// ---------------------------------------------------------------------------------------------------------
 
/* reconfiguring the properties of the grid (keep in mind the grid has default settings, but these you should overwrite where needed).
 
IMPORTANT: The grid squares are named like : SAR_area_0_0
 
where the first 0 is the x counter, and the second 0 the y counter.
 
So to adress the bottom left square in the grid, you use SAR_area_0_0.
The square above that one would be: SAR_area_0_1
the square one to the right of the bottom left square is SAR_area_1_0
 
You want to change the number arrays in the below lines:
 
The order for these numbers is always [BANDIT, SURVIVOR, SOLDIER]
 
Lets take an example for Chernarus
 
// 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,75,100],[0,4,3]],"SAR_area_0_0"] call SAR_AI_mon_upd;
 
[[0,1,2],[0,75,100],[0,4,3]]
 
the first set of numbers : 0,1,2
stands for
0 bandit groups
1 soldier group
2 surivors groups
thats the max that can spawn in this grid
 
the second set of numbers : 0,75,100
that means:
0% probability to spawn bandit groups
75% for soldiers
100% for survivors
 
the last set of numbers : 0,4,3
thats the maximum number of ppl in the group (plus 1 leader)
0 bandits
max 4 (+1 leader) soldiers
max 3 (+1 leader) survivors
this number is randomized
 
 
*/
// --------------------------------------------------
// grid definition for the automatic spawn system
//
// examples see the chernarus file
// --------------------------------------------------
 
 
 
// ---------------------------------------------------------------
// Definition of area markers for static spawns
// ---------------------------------------------------------------
 
// Hangar East
_this = createMarker ["SAR_patrol_hangareast", [8294.14, 2050.6, 0.082]];
_this setMarkerShape "RECTANGLE";
_this setMarkeralpha 0;
_this setMarkerType "Flag";
_this setMarkerBrush "Solid";
_this setMarkerSize [5, 5];
SAR_marker_hangareast = _this;
 
// Firehouse AF
_this = createMarker ["SAR_patrol_firehouse", [7892.68, 2067.22, 0.039]];
_this setMarkerShape "RECTANGLE";
_this setMarkeralpha 0;
_this setMarkerType "Flag";
_this setMarkerBrush "Solid";
_this setMarkerSize [5, 5];
SAR_marker_firehouse = _this;
 
// PVP FOB
_this = createMarker ["SAR_patrol_pvpfob", [4024.74, 3391.39, 0.001]];
_this setMarkerShape "RECTANGLE";
_this setMarkeralpha 0;
_this setMarkerType "Flag";
_this setMarkerBrush "Solid";
_this setMarkerSize [5, 5];
SAR_marker_pvpfob = _this;
 
// North AF
_this = createMarker ["SAR_patrol_naf", [2916.64, 6386.32, 0.001]];
_this setMarkerShape "RECTANGLE";
_this setMarkeralpha 0;
_this setMarkerType "Flag";
_this setMarkerBrush "Solid";
_this setMarkerSize [5, 5];
SAR_marker_naf = _this;
 
// South Bridge
_this = createMarker ["SAR_patrol_south", [4045.88, 681.813, 0.001]];
_this setMarkerShape "RECTANGLE";
_this setMarkeralpha 0;
_this setMarkerType "Flag";
_this setMarkerBrush "Solid";
_this setMarkerSize [5, 5];
SAR_marker_south = _this;
 
// Hospital
_this = createMarker ["SAR_patrol_hospital", [5532.57, 207.763, 0.001]];
_this setMarkerShape "RECTANGLE";
_this setMarkeralpha 0;
_this setMarkerType "Flag";
_this setMarkerBrush "Solid";
_this setMarkerSize [5, 5];
SAR_marker_hospital = _this;
 
 
 
// ----------------------------------------------------------------------------------------
// End of area marker definition section
// ----------------------------------------------------------------------------------------
 
diag_log format["SAR_AI: Area & Trigger definition finalized"];
diag_log format["SAR_AI: Static Spawning for Helicopter patrols started"];
 
//
// Static, predefined heli patrol areas with configurable units
//
// Parameters used:
//                  Areaname
//                  1,2,3 = soldier, survivors, bandits
//
 
// add if needed, see examples in the chernarus file
 
diag_log format["SAR_AI: Static Spawning for Helicopter patrols finished"];
 
//---------------------------------------------------------------------------------
// Static, predefined infantry patrols in defined areas with configurable units
//---------------------------------------------------------------------------------
// Example: [SAR_area_DEBUG,1,0,1,""] call SAR_AI;
//
// SAR_area_DEBUG = areaname (must have been defined further up)
// 1 = type of group (1 = soldiers, 2 = survivors, 3 = bandits)
// 0 = amount of snipers in the group
// 1 = amount of rifleman in the group
//
//
 
// Example entries:
// SARGE DEBUG - Debug group
// military, 0 snipers, 1 riflemen, patrol
//[SAR_area_DEBUG,1,0,1,""] call SAR_AI;
 
// military, 2 snipers, 4 riflemen, patrol
//[SAR_area_DEBUG,1,2,4,""] call SAR_AI;
 
// survivors, 1 snipers, 3 riflemen, patrolling the NWAF
//[SAR_marker_helipatrol_nwaf,2,1,3,""] call SAR_AI;
 
// bandits, 5 snipers, 2 riflemen, patrolling the NWAF
//[SAR_marker_helipatrol_nwaf,3,5,2,""] call SAR_AI;
//---------------------------------------------------------------------------------
 
// add here if needed
 
//Hangar East
[SAR_marker_hangareast,1,2,4,"fortify",true] call SAR_AI;
 
//Firehouse AF
[SAR_marker_firehouse,1,2,4,"fortify",true] call SAR_AI;
 
//PVP FOB
[SAR_marker_pvpfob,2,3,6,"fortify",true] call SAR_AI;
 
//North AF
[SAR_marker_naf,1,2,4,"fortify",true] call SAR_AI;
 
//South Bridge
[SAR_marker_south,3,1,4,"ambush",true] call SAR_AI;
 
//Hospital
[SAR_marker_hospital,1,1,4,"patrol",true] call SAR_AI;
 
 
 
 
 
// ---- end of configuration area ----
 
diag_log format["SAR_AI: Static Spawning for infantry patrols finished"];
 
Back
Top