Couple functions "added" + Tweaks

Add the DMS_MissionStatusCheck loop only if DMS_DynamicMission is being
used

Insert base function for findSafePos

Create a couple files to be used later
This commit is contained in:
eraser1 2015-08-28 01:04:50 -05:00
parent f0f5132867
commit 8386773993
5 changed files with 57 additions and 8 deletions

View File

@ -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";

View File

@ -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;
};

View File

@ -0,0 +1 @@
/*TODO*/

View File

@ -0,0 +1 @@
/*TODO*/

View File

@ -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;