Update + PBO

This commit is contained in:
eraser1 2015-09-05 01:03:20 -05:00
parent 160dc773ed
commit 600f3445e4
10 changed files with 62 additions and 7 deletions

View File

@ -37,6 +37,7 @@ class CfgFunctions
class FillCrate {}; class FillCrate {};
class FindSafePos {}; class FindSafePos {};
class FindSuppressor {}; class FindSuppressor {};
class IsPlayerNearby {};
class IsNearWater {}; class IsNearWater {};
class MissionsMonitor {}; class MissionsMonitor {};
class MissionSuccessState {}; class MissionSuccessState {};

View File

@ -6,7 +6,7 @@
*/ */
// If you're gonna make any changes to DMS functions and/or create any new missions, it's a good idea to enable this :) // If you're gonna make any changes to DMS functions and/or create any new missions, it's a good idea to enable this :)
DMS_DEBUG = false; DMS_DEBUG = true;

View File

@ -51,7 +51,7 @@ _clean =
{ {
if (isNull _x) exitWith {}; if (isNull _x) exitWith {};
if !([_x,DMS_CleanUp_PlayerNearLimit] call ExileServer_util_position_isPlayerNearby) then if !([_x,DMS_CleanUp_PlayerNearLimit] call DMS_fnc_IsPlayerNearby) then
{ {
_x call _clean; _x call _clean;
} }

View File

@ -150,7 +150,7 @@ if(DMS_SpawnBoxSmoke && {sunOrMoon == 1}) then {
}; };
if (DMS_SpawnBoxIRGrenade && {sunOrMoon != 1}) then { if (DMS_SpawnBoxIRGrenade && {sunOrMoon != 1}) then {
_marker = "B_IR_Grenade" createVehicle getPosATL _crate; _marker = "B_IRStrobe" createVehicle getPosATL _crate;
_marker setPosATL (getPosATL _crate); _marker setPosATL (getPosATL _crate);
_marker attachTo [_crate, [0,0,0]]; _marker attachTo [_crate, [0,0,0.5]];
}; };

View File

@ -38,7 +38,7 @@ while{!_validspot} do {
}; };
// Check for nearby players // Check for nearby players
if ([_pos,DMS_PlayerNearBlacklist] call ExileServer_util_position_isPlayerNearby) exitWith if ([_pos,DMS_PlayerNearBlacklist] call DMS_fnc_IsPlayerNearby) exitWith
{ {
throw ("players"); throw ("players");
}; };

View File

@ -0,0 +1,50 @@
/*
DMS_fnc_IsPlayerNearby
Created by eraser1
Usage:
[
_positionOrObject,
_distance
] call DMS_fnc_IsPlayerNearby;
Returns whether or not a player is within "_distance" meters of "_positionOrObject".
*/
private ["_pos", "_dis", "_isNear"];
_OK = params
[
["_pos", "", [objNull,[]], [2,3]],
["_dis", 0, [0]]
];
if (!_OK) exitWith
{
diag_log format ["DMS ERROR :: Calling DMS_fnc_IsPlayerNearby with invalid parameters: %1",_this];
};
_isNear = false;
try
{
{
{
if (isPlayer _x) then
{
throw _x;
};
} forEach (crew _x);
} forEach (_pos nearEntities [["Exile_Unit_Player","LandVehicle", "Air", "Ship"], _dis]);
}
catch
{
_isNear = true;
if (DMS_DEBUG) then
{
diag_log format ["DMS_DEBUG IsPlayerNearby :: %1 is within %2 meters of %3!",_exception,_dis,_pos];
};
};
_isNear;

View File

@ -55,7 +55,7 @@ _success = true;
}; };
case "playerNear": case "playerNear":
{ {
_success = _completionArgs call ExileServer_util_position_isPlayerNearby; _success = _completionArgs call DMS_fnc_IsPlayerNearby;
}; };
}; };
} forEach _this; } forEach _this;

View File

@ -73,7 +73,7 @@ private ["_pos", "_success", "_timeStarted", "_timeUntilFail", "_units", "_build
throw format ["Mission Success at %1 with message %2.",_pos,_msgWIN]; throw format ["Mission Success at %1 with message %2.",_pos,_msgWIN];
}; };
if (DMS_MissionTimeoutReset && {[_pos,DMS_MissionTimeoutResetRange] call ExileServer_util_position_isPlayerNearby}) then if (DMS_MissionTimeoutReset && {[_pos,DMS_MissionTimeoutResetRange] call DMS_fnc_IsPlayerNearby}) then
{ {
_x set [2,[diag_tickTime,_timeUntilFail]]; _x set [2,[diag_tickTime,_timeUntilFail]];

Binary file not shown.

View File

@ -74,6 +74,10 @@ if (!hasInterface && !isServer) then
## Changelog: ## Changelog:
#### September 5, 2015 (12:00 AM CST-America):
* Created new function "DMS_fnc_IsPlayerNearby" to replace "ExileServer_util_position_isPlayerNearby".
* Fix IR Strobes spawning inside the crate and not appearing.
#### September 4, 2015 (11:20 PM CST-America): #### September 4, 2015 (11:20 PM CST-America):
* Improved crate handling by DMS. You can now spawn multiple crates with different loot, or simply no crates at all. (REQUIRES FILE CHANGES FOR EACH MISSION) * Improved crate handling by DMS. You can now spawn multiple crates with different loot, or simply no crates at all. (REQUIRES FILE CHANGES FOR EACH MISSION)
* Accounted for case sensitivity in switch-do statements for SpawnAISolder. * Accounted for case sensitivity in switch-do statements for SpawnAISolder.