DMS_Exile/@ExileServer/addons/a3_dms/scripts/MissionSuccessState.sqf
eraser1 0b0c290495 Function Changes + Fixes + Comments + Logs
Added configurable distance to when cleanup will be aborted for an
object with a player nearby.

Created TargetsKilled function

Rewrite BroadCastMissionStatus (the function was doing the same thing
for each switch case except one, so I just put that in a select
statement)

Created function information for CleanUp.

CleanUp was using "_this" instead of "_x"

Created more/better debug info for CleanUp

Changed calling parameters for FillCrate.

Increased robustness of FillCrate.

Made FillCrate prettier

Created function information for FindSafePos

Created function information for IsPlayerNearByARRAY (deprecated)

Tweaks to MissionStatusCheck:
Created debug log for empty "DMS_Mission_Arr"
Fixed placement of index increase (otherwise deleteAt would remove
incorrect element if it existed)

Created MissionSuccessState

Created logs for RemoveMarkers

Created function information for RemoveMarkers + made it prettier

Created function information for SelectMagazine

Created TargetsKilled
2015-08-28 16:52:56 -05:00

59 lines
1.2 KiB
Plaintext

/*
DMS_MissionSuccessState
Created by eraser1
Usage:
[
[_completionType1,_completionArgs1],
[_completionType2,_completionArgs2],
...
[_completionTypeN,_completionArgsN]
] call DMS_MissionSuccessState;
*/
if !((typeName _this) isEqualTo "ARRAY") exitWith
{
diag_log format ["DMS ERROR :: DMS_MissionSuccessState called with invalid parameter: %1",_this];
};
private "_success";
_success = true;
{
if (!_success) exitWith
{
if (DMS_DEBUG) then
{
diag_log format ["DMS_DEBUG MissionSuccessState :: Mission not completed with parameters: %1 | at time %2",_this,diag_tickTime];
};
};
private ["_OK","_completionType","_completionArgs"];
_OK = _x params
[
["_completionType", "", [""] ],
["_completionArgs", [], [[]] ]
];
if (!_OK) exitWith
{
diag_log format ["DMS ERROR :: DMS_MissionSuccessState has invalid parameters in: %1",_x];
};
switch (_completionType) do
{
// Using switch-do so that future cases can be added easily
case "kill":
{
_success = _completionArgs call DMS_TargetsKilled;
};
case "playerNear":
{
_success = _completionArgs call ExileServer_util_position_isPlayerNearby;
};
};
false;
} count _completionTypes;
_success;