2015-08-28 21:52:56 +00:00
|
|
|
/*
|
2015-09-05 03:40:00 +00:00
|
|
|
DMS_fnc_MissionSuccessState
|
2015-08-28 21:52:56 +00:00
|
|
|
Created by eraser1
|
|
|
|
|
|
|
|
Usage:
|
|
|
|
[
|
2015-09-20 05:37:13 +00:00
|
|
|
[_completionType1,_completionArgs1,_isAbsoluteCondition],
|
|
|
|
[_completionType2,_completionArgs2,_isAbsoluteCondition],
|
2015-08-28 21:52:56 +00:00
|
|
|
...
|
2015-09-20 05:37:13 +00:00
|
|
|
[_completionTypeN,_completionArgsN,_isAbsoluteCondition]
|
2015-09-05 03:40:00 +00:00
|
|
|
] call DMS_fnc_MissionSuccessState;
|
2015-08-28 21:52:56 +00:00
|
|
|
*/
|
2015-08-30 00:33:32 +00:00
|
|
|
|
2015-09-20 05:37:13 +00:00
|
|
|
if ((typeName _this) != "ARRAY") exitWith
|
2015-08-28 21:52:56 +00:00
|
|
|
{
|
2015-09-20 05:37:13 +00:00
|
|
|
diag_log format ["DMS ERROR :: DMS_fnc_MissionSuccessState called with invalid parameter: %1",_this];
|
2015-08-28 21:52:56 +00:00
|
|
|
};
|
|
|
|
|
2015-09-20 05:37:13 +00:00
|
|
|
private ["_success", "_exit"];
|
2015-08-28 21:52:56 +00:00
|
|
|
|
|
|
|
_success = true;
|
2015-09-20 05:37:13 +00:00
|
|
|
_exit = false;
|
2015-08-28 21:52:56 +00:00
|
|
|
|
|
|
|
{
|
2015-09-20 05:37:13 +00:00
|
|
|
if (_exit) exitWith {};
|
|
|
|
|
|
|
|
try
|
2015-08-28 21:52:56 +00:00
|
|
|
{
|
2015-09-20 05:37:13 +00:00
|
|
|
private ["_OK","_completionType","_completionArgs","_absoluteWinCondition"];
|
|
|
|
|
|
|
|
_OK = _x params
|
|
|
|
[
|
|
|
|
["_completionType", "", [""] ],
|
|
|
|
["_completionArgs", [], [[],grpNull] ]
|
|
|
|
];
|
|
|
|
|
|
|
|
if (!_OK) then
|
2015-08-28 21:52:56 +00:00
|
|
|
{
|
2015-09-20 05:37:13 +00:00
|
|
|
diag_log format ["DMS ERROR :: DMS_fnc_MissionSuccessState has invalid parameters in: %1",_x];
|
|
|
|
throw "ERROR";
|
2015-08-28 21:52:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2015-09-20 05:37:13 +00:00
|
|
|
_absoluteWinCondition = false;
|
|
|
|
if (((count _x)>2) && {_x select 2}) then
|
|
|
|
{
|
|
|
|
_absoluteWinCondition = true;
|
|
|
|
};
|
2015-08-28 21:52:56 +00:00
|
|
|
|
2015-09-20 05:37:13 +00:00
|
|
|
if (!_success && {!_absoluteWinCondition}) then
|
|
|
|
{
|
|
|
|
throw format ["Skipping completion check for condition |%1|; Condition is not absolute and a previous condition has already been failed.",_x];
|
|
|
|
};
|
2015-08-28 21:52:56 +00:00
|
|
|
|
2015-09-20 05:37:13 +00:00
|
|
|
|
Readme changes, new debug fnc, fixes, tweaks
Created disclaimer for DMS. Now mentioning that HC for DMS isn't that
good.
Some structure stuff in readme (let's see if it works lol)
* **NEW CONFIG VALUE: DMS_Use_Map_Config**
* You can now overwrite "main config values" with map-specific config
values located in the new "map_configs" folder. This should allow you to
use one DMS PBO if you have multiple servers with different maps.
Included examples for Altis, Bornholm, Esseker, and Tavi (Taviana).
* Because of the above implementation, DMS by default will not include
the salt flats blacklist for findSafePos. In addition, it is
preconfigured to the hilly terrains in Esseker and Taviana, as well as
reducing all of the blacklist distances due to the smaller map size in
Esseker.
* Created new function "DMS_fnc_DebugLog". All DMS files (that produced
debug logs) have been changed, including mission files. However,
updating them is not important (and completely pointless if you don't
even use DMS_DEBUG).
* Fixed a few locations where it said "sized" instead of "seized".
Thanks to [icomrade](https://github.com/icomrade) for pointing them out.
* DMS now utilizes the "ARMA_LOG" DLL (if it exists) by infiSTAR to
produce debug logs (if enabled). All debug logs now also include server
uptime (in seconds) and server FPS.
* The FSM no longer produces debug logs.
* AI Locality manager will now run every minute.
* Debug logs for "DMS_fnc_MissionsMonitor" will only output the mission
name and the position, instead of all of the parameters.
* "DMS_fnc_IsNearWater" will now check the provided position itself for
water.
* "DMS_fnc_IsValidPosition" will now do a surfaceNormal check within a 5
meter radius of the provided position as well.
* "_customGearSet" should now actually work for
"DMS_fnc_SpawnAISoldier", and the function title comment has been
updated for the slightly tweaked syntax.
2015-10-10 01:35:07 +00:00
|
|
|
(format ["MissionSuccessState :: Checking completion type ""%1"" with argument |%2|. Absolute: %3",_completionType,_completionArgs,_absoluteWinCondition]) call DMS_fnc_DebugLog;
|
2015-09-20 05:37:13 +00:00
|
|
|
|
|
|
|
switch (toLower _completionType) do
|
2015-08-28 21:52:56 +00:00
|
|
|
{
|
2015-09-20 05:37:13 +00:00
|
|
|
case "kill":
|
|
|
|
{
|
|
|
|
_success = _completionArgs call DMS_fnc_TargetsKilled;
|
|
|
|
};
|
|
|
|
/*
|
|
|
|
case "killpercent":
|
|
|
|
{
|
|
|
|
_success = _completionArgs call DMS_fnc_TargetsKilledPercent;//<---TODO
|
|
|
|
};
|
|
|
|
*/
|
|
|
|
case "playernear":
|
|
|
|
{
|
|
|
|
_success = _completionArgs call DMS_fnc_IsPlayerNearby;
|
|
|
|
};
|
|
|
|
default
|
|
|
|
{
|
|
|
|
diag_log format ["DMS ERROR :: Invalid completion type (%1) with args: %2",_completionType,_completionArgs];
|
|
|
|
throw "ERROR";
|
|
|
|
};
|
2015-08-28 21:52:56 +00:00
|
|
|
};
|
2015-09-20 05:37:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
if (_success && {_absoluteWinCondition}) then
|
2015-08-30 00:33:32 +00:00
|
|
|
{
|
2015-09-20 05:37:13 +00:00
|
|
|
_exit = true;
|
|
|
|
throw format ["Mission completed because of absolute win condition: %1",_x];
|
2015-08-30 00:33:32 +00:00
|
|
|
};
|
2015-09-20 05:37:13 +00:00
|
|
|
}
|
|
|
|
catch
|
|
|
|
{
|
Readme changes, new debug fnc, fixes, tweaks
Created disclaimer for DMS. Now mentioning that HC for DMS isn't that
good.
Some structure stuff in readme (let's see if it works lol)
* **NEW CONFIG VALUE: DMS_Use_Map_Config**
* You can now overwrite "main config values" with map-specific config
values located in the new "map_configs" folder. This should allow you to
use one DMS PBO if you have multiple servers with different maps.
Included examples for Altis, Bornholm, Esseker, and Tavi (Taviana).
* Because of the above implementation, DMS by default will not include
the salt flats blacklist for findSafePos. In addition, it is
preconfigured to the hilly terrains in Esseker and Taviana, as well as
reducing all of the blacklist distances due to the smaller map size in
Esseker.
* Created new function "DMS_fnc_DebugLog". All DMS files (that produced
debug logs) have been changed, including mission files. However,
updating them is not important (and completely pointless if you don't
even use DMS_DEBUG).
* Fixed a few locations where it said "sized" instead of "seized".
Thanks to [icomrade](https://github.com/icomrade) for pointing them out.
* DMS now utilizes the "ARMA_LOG" DLL (if it exists) by infiSTAR to
produce debug logs (if enabled). All debug logs now also include server
uptime (in seconds) and server FPS.
* The FSM no longer produces debug logs.
* AI Locality manager will now run every minute.
* Debug logs for "DMS_fnc_MissionsMonitor" will only output the mission
name and the position, instead of all of the parameters.
* "DMS_fnc_IsNearWater" will now check the provided position itself for
water.
* "DMS_fnc_IsValidPosition" will now do a surfaceNormal check within a 5
meter radius of the provided position as well.
* "_customGearSet" should now actually work for
"DMS_fnc_SpawnAISoldier", and the function title comment has been
updated for the slightly tweaked syntax.
2015-10-10 01:35:07 +00:00
|
|
|
(format ["MissionSuccessState :: %1",_exception]) call DMS_fnc_DebugLog;
|
2015-08-28 21:52:56 +00:00
|
|
|
};
|
2015-09-04 16:35:19 +00:00
|
|
|
} forEach _this;
|
2015-08-28 21:52:56 +00:00
|
|
|
|
|
|
|
_success;
|