diff --git a/@ExileServer/addons/a3_dms/fn_init_dms.sqf b/@ExileServer/addons/a3_dms/fn_init_dms.sqf index 59db111..74ffeaa 100644 --- a/@ExileServer/addons/a3_dms/fn_init_dms.sqf +++ b/@ExileServer/addons/a3_dms/fn_init_dms.sqf @@ -6,7 +6,6 @@ // compiles -DMS_findSafePos = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\DMS_findSafePos.sqf"; DMS_CreateMarker = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\DMS_CreateMarker.sqf"; DMS_spawnAI = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\DMS_spawnAI.sqf"; DMS_selectMission = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\DMS_selectMission.sqf"; @@ -25,7 +24,8 @@ load_ammo = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\loa //Completed DMS_MissionStatusCheck = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\MissionStatusCheck.sqf"; -DMS_MissionSuccessState = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\MissionSuccessState.sqf"; +DMS_MissionSuccessState = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\MissionSuccessState.sqf";//<--- TODO +DMS_findSafePos = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\findSafePos.sqf";//<--- TODO DMS_BroadcastMissionStatus = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\BroadcastMissionStatus.sqf"; DMS_CleanUp = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\CleanUp.sqf"; DMS_isPlayerNearbyARRAY = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\isPlayerNearbyARRAY.sqf"; diff --git a/@ExileServer/addons/a3_dms/fn_start_DMS.sqf b/@ExileServer/addons/a3_dms/fn_start_DMS.sqf index 05a5cbf..6cf1e73 100644 --- a/@ExileServer/addons/a3_dms/fn_start_DMS.sqf +++ b/@ExileServer/addons/a3_dms/fn_start_DMS.sqf @@ -13,13 +13,11 @@ EAST setFriend[RESISTANCE,0]; EAST setFriend[WEST,0]; WEST setFriend[EAST,0]; - -[1, DMS_MissionStatusCheck, [], true] call ExileServer_system_thread_addTask; - -if(static_missions) then { +if(DMS_StaticMission) then { call compileFinal preprocessFileLineNumbers "\x\addons\dms\static\init.sqf"; }; -if (mission_system) then { - call compileFinal preprocessFileLineNumbers "\x\addons\dms\missions\init.sqf"; +if (DMS_DynamicMission) then { + call compileFinal preprocessFileLineNumbers "\x\addons\dms\missions\mission_init.sqf";//<---- TODO + [1, DMS_MissionStatusCheck, [], true] call ExileServer_system_thread_addTask; }; diff --git a/@ExileServer/addons/a3_dms/missions/mission_init.sqf b/@ExileServer/addons/a3_dms/missions/mission_init.sqf new file mode 100644 index 0000000..565c785 --- /dev/null +++ b/@ExileServer/addons/a3_dms/missions/mission_init.sqf @@ -0,0 +1 @@ +/*TODO*/ \ No newline at end of file diff --git a/@ExileServer/addons/a3_dms/scripts/MissionSuccessState.sqf b/@ExileServer/addons/a3_dms/scripts/MissionSuccessState.sqf new file mode 100644 index 0000000..565c785 --- /dev/null +++ b/@ExileServer/addons/a3_dms/scripts/MissionSuccessState.sqf @@ -0,0 +1 @@ +/*TODO*/ \ No newline at end of file diff --git a/@ExileServer/addons/a3_dms/scripts/findSafePos.sqf b/@ExileServer/addons/a3_dms/scripts/findSafePos.sqf new file mode 100644 index 0000000..47332bb --- /dev/null +++ b/@ExileServer/addons/a3_dms/scripts/findSafePos.sqf @@ -0,0 +1,49 @@ +private ["_i","_traders","_safePosParams","_validspot","_position"]; + +markerready = false; + +_safePosParams = [[16000,16000,0],1500,16000,(_this select 0),0,0.5,0]; + +_validspot = false; +_i = 0; +while{!_validspot} do { + _position = _safePosParams call BIS_fnc_findSafePos; + _validspot = true; + _i = _i+1; + call { + if (_position distance [14570, 16760, 0]<2000) exitWith + { + _validspot = false; + if (debug_mode) then {diag_log "Position is too close to trader zone!";}; + }; + if ([_position,wai_near_water] call wai_isNearWater) exitWith + { + _validspot = false; + if (debug_mode) then {diag_log "Position is too close to water!";}; + }; + + if ([_position] call wai_nearbyPlayers) exitWith + { + _validspot = false; + if (debug_mode) then {diag_log "Position has players nearby!";}; + }; + + /* + Leave this off for now + + if(debug_mode) then { diag_log("WAI DEBUG: FINDPOS: Checking nearby mission markers: " + str(wai_mission_markers)); }; + { + if ({getMarkerColor _x != "" && {_position distance (getMarkerPos _x) < wai_avoid_missions}}) exitWith + { + _validspot = false; + if (debug_mode) then {diag_log "Position is too close to another mission!";}; + }; + } count wai_mission_markers; + */ + }; + if(_validspot) then { + if(debug_mode) then { diag_log("Loop complete, valid position " +str(_position) + " in " + str(_i) + " attempts"); }; + }; +}; +_position set [2, 0]; +_position; \ No newline at end of file