mirror of
https://github.com/Defent/DMS_Exile.git
synced 2024-08-30 16:52:12 +00:00
0544cfe9e7
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.
94 lines
2.1 KiB
Plaintext
94 lines
2.1 KiB
Plaintext
/*
|
|
DMS_fnc_MissionSuccessState
|
|
Created by eraser1
|
|
|
|
Usage:
|
|
[
|
|
[_completionType1,_completionArgs1,_isAbsoluteCondition],
|
|
[_completionType2,_completionArgs2,_isAbsoluteCondition],
|
|
...
|
|
[_completionTypeN,_completionArgsN,_isAbsoluteCondition]
|
|
] call DMS_fnc_MissionSuccessState;
|
|
*/
|
|
|
|
if ((typeName _this) != "ARRAY") exitWith
|
|
{
|
|
diag_log format ["DMS ERROR :: DMS_fnc_MissionSuccessState called with invalid parameter: %1",_this];
|
|
};
|
|
|
|
private ["_success", "_exit"];
|
|
|
|
_success = true;
|
|
_exit = false;
|
|
|
|
{
|
|
if (_exit) exitWith {};
|
|
|
|
try
|
|
{
|
|
private ["_OK","_completionType","_completionArgs","_absoluteWinCondition"];
|
|
|
|
_OK = _x params
|
|
[
|
|
["_completionType", "", [""] ],
|
|
["_completionArgs", [], [[],grpNull] ]
|
|
];
|
|
|
|
if (!_OK) then
|
|
{
|
|
diag_log format ["DMS ERROR :: DMS_fnc_MissionSuccessState has invalid parameters in: %1",_x];
|
|
throw "ERROR";
|
|
};
|
|
|
|
|
|
_absoluteWinCondition = false;
|
|
if (((count _x)>2) && {_x select 2}) then
|
|
{
|
|
_absoluteWinCondition = true;
|
|
};
|
|
|
|
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];
|
|
};
|
|
|
|
|
|
(format ["MissionSuccessState :: Checking completion type ""%1"" with argument |%2|. Absolute: %3",_completionType,_completionArgs,_absoluteWinCondition]) call DMS_fnc_DebugLog;
|
|
|
|
switch (toLower _completionType) do
|
|
{
|
|
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";
|
|
};
|
|
};
|
|
|
|
|
|
if (_success && {_absoluteWinCondition}) then
|
|
{
|
|
_exit = true;
|
|
throw format ["Mission completed because of absolute win condition: %1",_x];
|
|
};
|
|
}
|
|
catch
|
|
{
|
|
(format ["MissionSuccessState :: %1",_exception]) call DMS_fnc_DebugLog;
|
|
};
|
|
} forEach _this;
|
|
|
|
_success; |