Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --------------------------------------------------------------------------------------//** SERVER_CLEANUP **//
- /*%FSM<COMPILE "F:\Program Files (x86)\Bohemia Interactive\Tools\FSM Editor Personal Edition\scriptedFSM.cfg, DayZ Server Cleanup">*/
- /*%FSM<HEAD>*/
- /*
- item0[] = {"init",0,250,-75.000000,-400.000000,25.000000,-350.000000,0.000000,"init"};
- item1[] = {"true",8,218,-75.000000,-175.000000,25.000000,-125.000000,0.000000,"true"};
- item2[] = {"waiting",2,250,-75.000000,-100.000000,25.000000,-50.000000,0.000000,"waiting"};
- item3[] = {"time_sync",4,218,-275.000000,-25.000000,-175.000000,25.000000,1.000000,"time" \n "sync"};
- item4[] = {"sync_the_time",2,4346,-275.000000,50.000000,-175.000000,100.000000,0.000000,"sync" \n "the time"};
- item5[] = {"true",8,218,-75.000000,125.000000,25.000000,175.000000,0.000000,"true"};
- item6[] = {"general_cleanup",2,250,-75.000000,200.000000,25.000000,250.000000,0.000000,"general" \n "cleanup" \n "loop"};
- item7[] = {"",7,210,-304.000000,220.999985,-296.000000,229.000015,0.000000,""};
- item8[] = {"",7,210,-304.000000,-154.000000,-296.000000,-146.000000,0.000000,""};
- item9[] = {"",7,210,221.000000,-79.000000,229.000000,-71.000000,0.000000,""};
- item10[] = {"",7,210,221.000000,146.000000,229.000000,154.000000,0.000000,""};
- item11[] = {"initialized",4,218,-75.000000,-325.000000,25.000000,-275.000000,0.000000,"initialized"};
- item12[] = {"prepare",2,250,-75.000000,-250.000000,25.000000,-200.000000,0.000000,"prepare"};
- item13[] = {"update_objects",2,250,100.000000,50.000000,200.000000,100.000000,0.000000,"update objects"};
- item14[] = {"need_update",4,218,100.000000,-25.000000,200.000000,25.000000,1.000000,"need update"};
- item15[] = {"",7,210,221.000000,-79.000000,229.000000,-71.000000,0.000000,""};
- item16[] = {"cleanup_groups",4,218,-150.000000,-25.000000,-50.000000,25.000000,1.000000,"cleanup" \n "groups"};
- item17[] = {"group_cleanup",2,250,-150.000000,50.000000,-50.000000,100.000000,0.000000,"group" \n "cleanup"};
- item18[] = {"cleanup_vehicles",4,218,-25.000000,-25.000000,75.000000,25.000000,1.000000,"cleanup" \n "vehicles"};
- item19[] = {"vehicle_cleanup",2,250,-25.000000,50.000000,75.000000,100.000000,0.000000,"vehicle" \n "cleanup"};
- link0[] = {0,11};
- link1[] = {1,2};
- link2[] = {2,3};
- link3[] = {2,9};
- link4[] = {2,14};
- link5[] = {2,16};
- link6[] = {2,18};
- link7[] = {3,4};
- link8[] = {4,5};
- link9[] = {5,6};
- link10[] = {6,7};
- link11[] = {7,8};
- link12[] = {8,1};
- link13[] = {9,10};
- link14[] = {9,15};
- link15[] = {10,5};
- link16[] = {11,12};
- link17[] = {12,1};
- link18[] = {13,5};
- link19[] = {14,13};
- link20[] = {16,17};
- link21[] = {17,5};
- link22[] = {18,19};
- link23[] = {19,5};
- globals[] = {25.000000,1,0,0,0,640,480,1,30,6316128,1,-419.782135,377.473389,510.243530,-212.601486,675,612,1};
- window[] = {0,-1,-1,-1,-1,940,182,1460,182,1,693};
- *//*%FSM</HEAD>*/
- class FSM
- {
- fsmName = "DayZ Server Cleanup";
- class States
- {
- /*%FSM<STATE "init">*/
- class init
- {
- name = "init";
- init = /*%FSM<STATEINIT""">*/""/*%FSM</STATEINIT""">*/;
- precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
- class Links
- {
- /*%FSM<LINK "initialized">*/
- class initialized
- {
- priority = 0.000000;
- to="prepare";
- precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
- condition=/*%FSM<CONDITION""">*/"!isnil ""bis_fnc_init"""/*%FSM</CONDITION""">*/;
- action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
- };
- /*%FSM</LINK>*/
- };
- };
- /*%FSM</STATE>*/
- /*%FSM<STATE "waiting">*/
- class waiting
- {
- name = "waiting";
- init = /*%FSM<STATEINIT""">*/"//diag_log ""CLEANUP: Waiting for next task"";" \n
- ""/*%FSM</STATEINIT""">*/;
- precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
- class Links
- {
- /*%FSM<LINK "need_update">*/
- class need_update
- {
- priority = 1.000000;
- to="update_objects";
- precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
- condition=/*%FSM<CONDITION""">*/"( (count needUpdate_objects) > 0 && (diag_tickTime -_lastNeedUpdate>40) )"/*%FSM</CONDITION""">*/;
- action=/*%FSM<ACTION""">*/"_lastNeedUpdate = diag_tickTime;"/*%FSM</ACTION""">*/;
- };
- /*%FSM</LINK>*/
- /*%FSM<LINK "cleanup_groups">*/
- class cleanup_groups
- {
- priority = 1.000000;
- to="group_cleanup";
- precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
- condition=/*%FSM<CONDITION""">*/"((diag_tickTime - _lastCleanupGroups) > 10)"/*%FSM</CONDITION""">*/;
- action=/*%FSM<ACTION""">*/"_lastCleanupGroups = diag_tickTime;"/*%FSM</ACTION""">*/;
- };
- /*%FSM</LINK>*/
- /*%FSM<LINK "cleanup_vehicles">*/
- class cleanup_vehicles
- {
- priority = 1.000000;
- to="vehicle_cleanup";
- precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
- condition=/*%FSM<CONDITION""">*/"((diag_tickTime - _lastCleanupVehicles) > 5)"/*%FSM</CONDITION""">*/;
- action=/*%FSM<ACTION""">*/"_lastCleanupVehicles = diag_tickTime;"/*%FSM</ACTION""">*/;
- };
- /*%FSM</LINK>*/
- /*%FSM<LINK "time_sync">*/
- class time_sync
- {
- priority = 1.000000;
- to="sync_the_time";
- precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
- condition=/*%FSM<CONDITION""">*/"((diag_tickTime - _lastUpdate) > 300)"/*%FSM</CONDITION""">*/;
- action=/*%FSM<ACTION""">*/"_lastUpdate = diag_tickTime;"/*%FSM</ACTION""">*/;
- };
- /*%FSM</LINK>*/
- /*%FSM<LINK "true">*/
- class true
- {
- priority = 0.000000;
- to="general_cleanup";
- precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
- condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
- action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
- };
- /*%FSM</LINK>*/
- };
- };
- /*%FSM</STATE>*/
- /*%FSM<STATE "sync_the_time">*/
- class sync_the_time
- {
- name = "sync_the_time";
- init = /*%FSM<STATEINIT""">*/"//Send request" \n
- "_key = ""CHILD:307:"";" \n
- "_result = _key call server_hiveReadWrite;" \n
- "_outcome = _result select 0;" \n
- "if(_outcome == ""PASS"") then {" \n
- " _date = _result select 1; " \n
- " " \n
- " if(dayz_fullMoonNights) then {" \n
- " //date setup" \n
- " _year = _date select 0;" \n
- " _month = _date select 1;" \n
- " _day = _date select 2;" \n
- " _hour = _date select 3;" \n
- " _minute = _date select 4;" \n
- " " \n
- " //Force full moon nights" \n
- " _date = [2013,6,12,_hour,_minute];" \n
- " };" \n
- "" \n
- " setDate _date;" \n
- " PVDZE_plr_SetDate = _date;" \n
- " publicVariable ""PVDZE_plr_SetDate"";" \n
- " diag_log (""TIME SYNC: Local Time set to "" + str(_date)); " \n
- "};" \n
- ""/*%FSM</STATEINIT""">*/;
- precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
- class Links
- {
- /*%FSM<LINK "true">*/
- class true
- {
- priority = 0.000000;
- to="general_cleanup";
- precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
- condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
- action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
- };
- /*%FSM</LINK>*/
- };
- };
- /*%FSM</STATE>*/
- /*%FSM<STATE "general_cleanup">*/
- class general_cleanup
- {
- name = "general_cleanup";
- init = /*%FSM<STATEINIT""">*/"//diag_log ""CLEANUP: Starting loop for next task"";"/*%FSM</STATEINIT""">*/;
- precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
- class Links
- {
- /*%FSM<LINK "true">*/
- class true
- {
- priority = 0.000000;
- to="waiting";
- precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
- condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
- action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
- };
- /*%FSM</LINK>*/
- };
- };
- /*%FSM</STATE>*/
- /*%FSM<STATE "prepare">*/
- class prepare
- {
- name = "prepare";
- init = /*%FSM<STATEINIT""">*/"diag_log (""CLEANUP: INITIALIZING CLEANUP SCRIPT"");" \n
- "" \n
- "_safety = PVDZE_serverObjectMonitor;" \n
- "//_dateNow = (DateToNumber date);" \n
- "" \n
- "_lastUpdate = diag_tickTime;" \n
- "_lastNeedUpdate = diag_tickTime;" \n
- "_lastCleanupVehicles = diag_tickTime;" \n
- "_lastCleanupGroups = diag_tickTime;" \n
- ""/*%FSM</STATEINIT""">*/;
- precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
- class Links
- {
- /*%FSM<LINK "true">*/
- class true
- {
- priority = 0.000000;
- to="waiting";
- precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
- condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
- action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
- };
- /*%FSM</LINK>*/
- };
- };
- /*%FSM</STATE>*/
- /*%FSM<STATE "update_objects">*/
- class update_objects
- {
- name = "update_objects";
- init = /*%FSM<STATEINIT""">*/"//diag_log format[""DEBUG: needUpdate_objects=%1"",needUpdate_objects];" \n
- "{" \n
- " needUpdate_objects = needUpdate_objects - [_x];" \n
- " [_x,""all""] call server_updateObject;" \n
- "" \n
- "} forEach needUpdate_objects;"/*%FSM</STATEINIT""">*/;
- precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
- class Links
- {
- /*%FSM<LINK "true">*/
- class true
- {
- priority = 0.000000;
- to="general_cleanup";
- precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
- condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
- action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
- };
- /*%FSM</LINK>*/
- };
- };
- /*%FSM</STATE>*/
- /*%FSM<STATE "group_cleanup">*/
- class group_cleanup
- {
- name = "group_cleanup";
- init = /*%FSM<STATEINIT""">*/"//Clean groups" \n
- "{" \n
- " // diag_log (""CLEANUP: CHECKING GROUP WITH "" + str(count units _x) + "" UNITS"");" \n
- " if (count units _x==0) then {" \nif ((count units _x==0) && !(_x getVariable[""SAR_protect"",false])) then {" \n
- " deleteGroup _x;" \n
- " // diag_log (""CLEANUP: DELETING A GROUP"");" \n
- " };" \n
- "} forEach allGroups;" \n
- ""/*%FSM</STATEINIT""">*/;
- precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
- class Links
- {
- /*%FSM<LINK "true">*/
- class true
- {
- priority = 0.000000;
- to="general_cleanup";
- precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
- condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
- action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
- };
- /*%FSM</LINK>*/
- };
- };
- /*%FSM</STATE>*/
- /*%FSM<STATE "vehicle_cleanup">*/
- class vehicle_cleanup
- {
- name = "vehicle_cleanup";
- init = /*%FSM<STATEINIT""">*/"_safety = PVDZE_serverObjectMonitor;" \n
- "" \n
- "//Check for hackers" \n
- " {" \n
- " if(vehicle _x != _x && (vehicle _x getVariable [""Sarge"",0] != 1) && !(vehicle _x in _safety) && (typeOf vehicle _x) != ""ParachuteWest"") then {" \n //**MISSIONS**
- " // diag_log (""CLEANUP: KILLING A HACKER "" + (name _x) + "" "" + str(_x) + "" IN "" + (typeOf vehicle _x));" \n // ** COMMENTED OUT FOR SARGE **
- " (vehicle _x) setDamage 1;" \n
- " _x setDamage 1;" \n
- " };" \n
- " } forEach allUnits;" \n
- "" \n
- "PVDZE_serverObjectMonitor = _safety;"/*%FSM</STATEINIT""">*/;
- precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
- class Links
- {
- /*%FSM<LINK "true">*/
- class true
- {
- priority = 0.000000;
- to="general_cleanup";
- precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
- condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
- action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
- };
- /*%FSM</LINK>*/
- };
- };
- /*%FSM</STATE>*/
- };
- initState="init";
- finalStates[] =
- {
- };
- };
- /*%FSM</COMPILE>*/
- --------------------------------------------------------------------------//** SAR_cfg_grps_chernarus.sqf **//
- // =========================================================================================================
- // 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 Chernarus
- // 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 (including the leader)
- 0 bandits
- max 4 soldiers
- max 3 survivors
- this number is randomized
- */
- //
- // grid definition for the automatic spawn system
- //
- // 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"],[[4,1,2],[0,100,100],[0,2,1]],"SAR_area_0_0"] call SAR_AI_mon_upd;
- // Balota, 1 bandit groups, 0 soldier groups, 2 survivor groups - spawn probability ba,so,su - maximum group members ba,so,su
- _check = [["max_grps","rnd_grps","max_p_grp"],[[5,0,2],[80,0,80],[2,0,3]],"SAR_area_1_0"] call SAR_AI_mon_upd;
- // Cherno, 2 bandit groups, 0 soldier groups, 3 survivor groups - spawn probability ba,so,su - maximum group members ba,so,su
- _check = [["max_grps","rnd_grps","max_p_grp"],[[2,0,3],[75,0,75],[4,0,4]],"SAR_area_2_0"] call SAR_AI_mon_upd;
- // Prido, 1 bandit groups, 0 soldier groups, 3 survivor groups - spawn probability ba,so,su - maximum group members ba,so,su
- _check = [["max_grps","rnd_grps","max_p_grp"],[[1,0,3],[50,0,50],[4,0,2]],"SAR_area_3_0"] call SAR_AI_mon_upd;
- // Elektro, 2 bandit groups, 0 soldier groups, 3 survivor groups - spawn probability ba,so,su - maximum group members ba,so,su
- _check = [["max_grps","rnd_grps","max_p_grp"],[[2,0,3],[50,0,50],[4,0,4]],"SAR_area_4_0"] call SAR_AI_mon_upd;
- // Kamyshovo, 0 bandit groups, 0 soldier groups, 1 survivor groups - spawn probability ba,so,su - maximum group members ba,so,su
- _check = [["max_grps","rnd_grps","max_p_grp"],[[1,0,1],[0,0,80],[0,0,3]],"SAR_area_5_0"] call SAR_AI_mon_upd;
- // Tulga, 0 bandit groups, 0 soldier groups, 1 survivor groups - spawn probability ba,so,su - maximum group members ba,so,su
- _check = [["max_grps","rnd_grps","max_p_grp"],[[4,0,1],[0,0,80],[0,0,3]],"SAR_area_5_1"] call SAR_AI_mon_upd;
- // Solni, 1 bandit groups, 0 soldier groups, 0 survivor groups - spawn probability ba,so,su - maximum group members ba,so,su
- _check = [["max_grps","rnd_grps","max_p_grp"],[[1,0,0],[80,0,0],[2,0,0]],"SAR_area_5_2"] call SAR_AI_mon_upd;
- // Berezino, 0 bandit groups, 0 soldier groups, 3 survivor groups - spawn probability ba,so,su - maximum group members ba,so,su
- _check = [["max_grps","rnd_grps","max_p_grp"],[[1,0,3],[1,0,75],[0,0,3]],"SAR_area_5_3"] call SAR_AI_mon_upd;
- // Khelm, 1 bandit groups, 0 soldier groups, 1 survivor groups - spawn probability ba,so,su - maximum group members ba,so,su
- _check = [["max_grps","rnd_grps","max_p_grp"],[[1,0,1],[75,0,75],[3,0,3]],"SAR_area_5_4"] call SAR_AI_mon_upd;
- // NEAF, 0 bandit groups, 3 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,3,1],[0,50,75],[0,2,4]],"SAR_area_5_5"] call SAR_AI_mon_upd;
- // 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"],[[1,2,1],[0,50,75],[0,2,4]],"SAR_area_1_4"] call SAR_AI_mon_upd;
- // Stary, 3 bandit groups, 0 soldier groups, 3 survivor groups - spawn probability ba,so,su - maximum group members ba,so,su
- _check = [["max_grps","rnd_grps","max_p_grp"],[[3,0,3],[50,0,50],[3,0,3]],"SAR_area_2_2"] call SAR_AI_mon_upd;
- // Devils Castle, 2 bandit groups, 0 soldier groups, 0 survivor groups - spawn probability ba,so,su - maximum group members ba,so,su
- _check = [["max_grps","rnd_grps","max_p_grp"],[[2,0,0],[75,0,0],[3,0,0]],"SAR_area_2_4"] call SAR_AI_mon_upd;
- // Skalka, 1 bandit groups, 0 soldier groups, 0 survivor groups - spawn probability ba,so,su - maximum group members ba,so,su
- _check = [["max_grps","rnd_grps","max_p_grp"],[[1,0,0],[75,0,0],[3,0,0]],"SAR_area_0_5"] call SAR_AI_mon_upd;
- // Petrovka1, 2 bandit groups, 0 soldier groups, 0 survivor groups - spawn probability ba,so,su - maximum group members ba,so,su
- _check = [["max_grps","rnd_grps","max_p_grp"],[[2,0,0],[75,0,0],[3,0,0]],"SAR_area_1_5"] call SAR_AI_mon_upd;
- // Petrovka2, 2 bandit groups, 0 soldier groups, 0 survivor groups - spawn probability ba,so,su - maximum group members ba,so,su
- _check = [["max_grps","rnd_grps","max_p_grp"],[[2,0,0],[75,0,0],[3,0,0]],"SAR_area_2_5"] call SAR_AI_mon_upd;
- // Pobeda, 2 bandit groups, 0 soldier groups, 0 survivor groups - spawn probability ba,so,su - maximum group members ba,so,su
- _check = [["max_grps","rnd_grps","max_p_grp"],[[2,0,0],[75,0,0],[3,0,0]],"SAR_area_3_5"] call SAR_AI_mon_upd;
- // Krasno, 0 bandit groups, 1 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,1,1],[0,75,75],[0,4,2]],"SAR_area_4_5"] call SAR_AI_mon_upd;
- // test south of lopatino, 1 bandit groups, 0 soldier groups, 0 survivor groups - spawn probability ba,so,su - maximum group members ba,so,su
- _check = [["max_grps","rnd_grps","max_p_grp"],[[1,0,0],[100,0,0],[6,0,0]],"SAR_area_0_3"] call SAR_AI_mon_upd;
- //
- // Definition of area markers for static spawns
- //
- // soutcoast, heli patrol area
- _this = createMarker ["SAR_patrol_soutcoast", [7997.2837, 2687.6707]];
- _this setMarkerShape "RECTANGLE";
- _this setMarkeralpha 0;
- _this setMarkerType "Flag";
- _this setMarkerBrush "Solid";
- _this setMarkerSize [6500, 1200];
- SAR_marker_helipatrol_southcoast = _this;
- // eastcoast, heli patrol area
- _this = createMarker ["SAR_patrol_eastcoast", [13304.196, 8220.9795]];
- _this setMarkerShape "RECTANGLE";
- _this setMarkeralpha 0;
- _this setMarkerType "Flag";
- _this setMarkerBrush "Solid";
- _this setMarkerSize [1200, 6000];
- SAR_marker_helipatrol_eastcoast = _this;
- // NWAF, heli patrol area
- _this = createMarker ["SAR_patrol_NWAF", [4525.3335, 10292.299]];
- _this setMarkerShape "RECTANGLE";
- _this setMarkeralpha 0;
- _this setMarkerType "Flag";
- _this setMarkerBrush "Solid";
- _this setMarkerSize [1500, 500];
- _this setMarkerDir 59.354115;
- SAR_marker_helipatrol_nwaf = _this;
- // NEAF, heli patrol area
- _this = createMarker ["SAR_patrol_NEAF", [12034.16, 12725.376, 0]];
- _this setMarkerShape "RECTANGLE";
- _this setMarkeralpha 0;
- _this setMarkerType "Flag";
- _this setMarkerBrush "Solid";
- _this setMarkerSize [1000, 600];
- SAR_marker_helipatrol_neaf = _this;
- // SAR DEBUG AREA - at NWAF
- _this = createMarker ["SAR_marker_DEBUG", [4600.3335, 10240.299]];
- _this setMarkerShape "RECTANGLE";
- _this setMarkeralpha 1;
- _this setMarkerType "Flag";
- _this setMarkerBrush "Solid";
- _this setMarkerSize [100, 100];
- _this setMarkerDir 59.354115;
- SAR_marker_DEBUG = _this;
- // SAR DEBUG AREA - at Skaly
- _this = createMarker ["SAR_marker_DEBUG1", [2519.3335, 13140.299]];
- _this setMarkerShape "RECTANGLE";
- _this setMarkeralpha 1;
- _this setMarkerType "Flag";
- _this setMarkerBrush "Solid";
- _this setMarkerSize [100, 100];
- SAR_marker_DEBUG1 = _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
- //
- // respawn
- // true or false
- //Heli Patrol NWAF
- [SAR_marker_helipatrol_nwaf,1,true] call SAR_AI_heli;
- //Heli Patrol NEAF
- [SAR_marker_helipatrol_neaf,1,true] call SAR_AI_heli;
- // Heli patrol south coast
- [SAR_marker_helipatrol_southcoast,1,true] call SAR_AI_heli;
- [SAR_marker_helipatrol_southcoast,1,true] call SAR_AI_heli;
- // heli patrol east coast
- [SAR_marker_helipatrol_eastcoast,1,true] call SAR_AI_heli;
- [SAR_marker_helipatrol_eastcoast,1,true] call SAR_AI_heli;
- diag_log format["SAR_AI: Static Spawning for Helicopter patrols finished"];
- //---------------------------------------------------------------------------------
- // Static, predefined infantry patrols in defined areas with configurable units
- //---------------------------------------------------------------------------------
- // Example: [SAR_marker_DEBUG,1,0,1,"",true] call SAR_AI;
- //
- // SAR_marker_DEBUG = areaname (must have been defined further up, and MUST NOT BE similar to SAR_area_ ! THIS IS IMPORTANT!
- // 1 = type of group (1 = soldiers, 2 = survivors, 3 = bandits)
- // 0 = amount of snipers in the group
- // 1 = amount of rifleman in the group
- // "" = action, possible values: "noupsmon","fortify","ambush","patrol"
- // true = respawning group, true or false
- // Example entries:
- // SARGE DEBUG - Debug group
- // military, 0 snipers, 1 riflemen, patrol
- //[SAR_marker_DEBUG,1,0,1,"fortify",true] call SAR_AI;
- //[SAR_marker_DEBUG1,1,0,2,"patrol",false] call SAR_AI;
- //[SAR_marker_DEBUG1,2,0,2,"patrol",false] call SAR_AI;
- //---------------------------------------------------------------------------------
- // add here if needed
- // ---- end of configuration area ----
- diag_log format["SAR_AI: Static Spawning for infantry and heli patrols finished"];
- --------------------------------------------------------------------------------------//** SAR_AI_init.sqf**//
- // =========================================================================================================
- // SAR_AI - DayZ AI library
- // Version: 1.1.0
- // Author: Sarge ([email protected])
- //
- // Wiki: to come
- // Forum: http://opendayz.net/index.php?threads/sarge-ai-framework-public-release.8391/
- //
- // ---------------------------------------------------------------------------------------------------------
- // Required:
- // UPSMon
- // SHK_pos
- //
- // ---------------------------------------------------------------------------------------------------------
- // SAR_AI_init.sqf - main init and control file of the framework
- // last modified: 1.4.2013
- // ---------------------------------------------------------------------------------------------------------
- private ["_worldname","_startx","_starty","_gridsize_x","_gridsize_y","_gridwidth","_i","_ii","_markername","_triggername","_trig_act_stmnt","_trig_deact_stmnt","_trig_cond","_check","_grp","_script_handler"];
- SAR_version = "1.1.0";
- // establish PvEH on all clients
- if (!isServer) then { // only run this on the connected clients
- "adjustrating" addPublicVariableEventHandler {((_this select 1) select 0) addRating ((_this select 1) select 1); };
- };
- if (!isServer) exitWith {}; // only run this on the server
- diag_log "----------------------------------------";
- diag_log format["Starting SAR_AI version %1",SAR_version];
- diag_log "----------------------------------------";
- // preprocessing relevant scripts
- SAR_AI_heli = compile preprocessFileLineNumbers "addons\SARGE\SAR_setup_AI_patrol_heli.sqf";
- SAR_AI = compile preprocessFileLineNumbers "addons\SARGE\SAR_setup_AI_patrol.sqf";
- // activate functions library
- call compile preprocessFileLineNumbers "addons\SARGE\SAR_functions.sqf";
- // Public Eventhandlers
- "doMedicAnim" addPublicVariableEventHandler {((_this select 1) select 0) playActionNow ((_this select 1) select 1); };
- //---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- //
- // include user config values
- //
- #include "SAR_config.sqf"
- //
- // make some config variables public
- //
- publicvariable "SAR_surv_kill_value";
- publicvariable "SAR_band_kill_value";
- publicvariable "SAR_DEBUG";
- publicvariable "SAR_EXTREME_DEBUG";
- publicvariable "SAR_DETECT_HOSTILE";
- publicvariable "SAR_DETECT_INTERVAL";
- publicvariable "SAR_HUMANITY_HOSTILE_LIMIT";
- //---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- // 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;
- SAR_leader_number = 0;
- diag_log format["SAR_AI: Area & Trigger definition Started"];
- // Declaring AI monitor array
- SAR_AI_monitor = [];
- _worldname= toLower format["%1",worldName];
- diag_log format["Setting up SAR_AI for : %1",_worldname];
- //
- // Setup aremarker & trigger grid - DO NOT CHANGE
- //
- // default gridvalues
- _startx=2500;
- _starty=2800;
- _gridsize_x=6;
- _gridsize_y=6;
- _gridwidth = 1000;
- //
- // get grid configuration for the different maps
- //
- switch (_worldname) do {
- case "chernarus":
- {
- #include "map_config\SAR_cfg_grid_chernarus.sqf"
- };
- case "tavi":
- {
- #include "map_config\SAR_cfg_grid_tavi.sqf"
- };
- case "namalsk":
- {
- #include "map_config\SAR_cfg_grid_namalsk.sqf"
- };
- case "lingor":
- {
- #include "map_config\SAR_cfg_grid_lingor.sqf"
- };
- case "mbg_celle2":
- {
- #include "map_config\SAR_cfg_grid_mbg_celle2.sqf"
- };
- case "takistan":
- {
- #include "map_config\SAR_cfg_grid_takistan.sqf"
- };
- case "fallujah":
- {
- #include "map_config\SAR_cfg_grid_fallujah.sqf"
- };
- case "panthera2":
- {
- #include "map_config\SAR_cfg_grid_panthera.sqf"
- };
- };
- //
- // Generate marker & trigger grid & activate it
- //
- SAR_area_ = text format ["SAR_area_%1","x"];
- for [{_i=0}, {_i < _gridsize_y}, {_i=_i+1}] do
- {
- for [{_ii=0}, {_ii < _gridsize_x}, {_ii=_ii+1}] do
- {
- //
- // Define marker area
- //
- _markername = format["SAR_area_%1_%2",_ii,_i];
- _this = createMarker[_markername,[_startx + (_ii * _gridwidth * 2),_starty + (_i * _gridwidth * 2)]];
- if(SAR_DEBUG || SAR_EXTREME_DEBUG) then {
- _this setMarkerAlpha 1;
- } else {
- _this setMarkerAlpha 0;
- };
- _this setMarkerShape "RECTANGLE";
- _this setMarkerType "Flag";
- _this setMarkerBrush "BORDER";
- _this setMarkerSize [_gridwidth, _gridwidth];
- Call Compile Format ["SAR_area_%1_%2 = _this",_ii,_i];
- if (SAR_dynamic_spawning) then {
- //
- // Define trigger area & conditions & actions
- //
- _triggername = format["SAR_trig_%1_%2",_ii,_i];
- _this = createTrigger ["EmptyDetector", [_startx + (_ii * _gridwidth * 2),_starty + (_i * _gridwidth * 2)]];
- _this setTriggerArea [_gridwidth, _gridwidth, 0, true];
- _this setTriggerActivation ["ANY", "PRESENT", true];
- Call Compile Format ["SAR_trig_%1_%2 = _this",_ii,_i];
- _trig_act_stmnt = format["if (SAR_DEBUG) then {diag_log 'SAR DEBUG: trigger on in %1';};[thislist,'%1'] execVM'addons\SARGE\SAR_AI_spawn.sqf';",_triggername];
- _trig_deact_stmnt = format["if (SAR_DEBUG) then {diag_log 'SAR DEBUG: trigger off in %1';};[thislist,thisTrigger,'%1'] execVM'addons\SARGE\SAR_AI_despawn.sqf';",_triggername];
- _trig_cond = "{isPlayer _x} count thisList > 0;";
- Call Compile Format ["SAR_trig_%1_%2 ",_ii,_i] setTriggerStatements [_trig_cond,_trig_act_stmnt , _trig_deact_stmnt];
- };
- // standard grid definition - maxgroups (ba,so,su) - probability (ba,so,su) - max group members (ba,so,su)
- SAR_AI_monitor set[count SAR_AI_monitor, [_markername,[SAR_max_grps_bandits,SAR_max_grps_soldiers,SAR_max_grps_survivors],[SAR_chance_bandits,SAR_chance_soldiers,SAR_chance_survivors],[SAR_max_grpsize_bandits,SAR_max_grpsize_soldiers,SAR_max_grpsize_survivors],[],[],[]]];
- };
- };
- // ----------------------------------------------------------------------------
- // end of Setup aremarker & trigger grid
- // ----------------------------------------------------------------------------
- //
- // Enable the SAR garbage collector & watchdog
- //
- [] execVM "addons\SARGE\SAR_group_monitor.sqf";
- //
- // include group & spawn definitions for automatic & static vehicle and infantry spawns
- //
- switch (_worldname) do {
- case "chernarus":
- {
- #include "map_config\SAR_cfg_grps_chernarus.sqf"
- };
- case "tavi":
- {
- #include "map_config\SAR_cfg_grps_tavi.sqf"
- };
- case "namalsk":
- {
- #include "map_config\SAR_cfg_grps_namalsk.sqf"
- };
- case "lingor":
- {
- #include "map_config\SAR_cfg_grps_lingor.sqf"
- };
- case "mbg_celle2":
- {
- #include "map_config\SAR_cfg_grps_mbg_celle2.sqf"
- };
- case "takistan":
- {
- #include "map_config\SAR_cfg_grps_takistan.sqf"
- };
- case "fallujah":
- {
- #include "map_config\SAR_cfg_grps_fallujah.sqf"
- };
- case "panthera2":
- {
- #include "map_config\SAR_cfg_grps_panthera.sqf"
- };
- };
- //
- // initialize the fix for sharing vehicles between survivors and bandits
- //
- if(SAR_FIX_VEHICLE_ISSUE) then {
- _script_handler = [] execVM "addons\SARGE\SAR_vehicle_fix.sqf";
- waitUntil {scriptDone _script_handler};
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement