2015-08-27 07:44:23 +00:00
/*
2015-09-05 03:40:00 +00:00
DMS Pre-init
2015-08-27 07:44:23 +00:00
Written by eraser1 (trainwreckdayz.com)
2015-08-28 16:37:23 +00:00
*/
2015-08-27 07:44:23 +00:00
2015-09-05 03:40:00 +00:00
DMS_HC_Object = objNull;
2015-08-28 19:14:59 +00:00
2015-09-20 20:26:08 +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
//Load main config
2015-09-20 20:26:08 +00:00
call compileFinal preprocessFileLineNumbers "\x\addons\dms\config.sqf";
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
//Load map-specific configs. Should make it easier for people with multiple servers/maps. One PBO to rule them all...
if (DMS_Use_Map_Config) then
{
call compileFinal preprocessFileLineNumbers (format ["\x\addons\dms\map_configs\%1_config.sqf",toLower worldName]);
};
2015-09-20 20:26:08 +00:00
/*
Original Functions from
http://maca134.co.uk/portfolio/m3editor-arma-3-map-editor/
Slightly modified by eraser1
*/
M3E_fnc_getCenter =
{
private ['_objects', '_ax', '_ay', '_az', '_xs', '_xc', '_xz', '_ys', '_yc', '_yz', '_zs', '_zc', '_zz'];
_objects = [_this, 0, [], [[]]] call BIS_fnc_param;
_ax = [];
_ay = [];
_az = [];
{
private ['_position'];
_position = getPosATL _x;
_ax pushBack (_position select 0);
_ay pushBack (_position select 1);
_az pushBack (_position select 2);
} foreach _objects;
_xs = 0;
_xc = {_xs = _xs + _x; true} count _ax;
_xz = _xs / _xc;
_ys = 0;
_yc = {_ys = _ys + _x; true} count _ay;
_yz = _ys / _yc;
_zs = 0;
_zc = {_zs = _zs + _x; true} count _az;
_zz = _zs / _zc;
[_xz, _yz, _zz]
};
M3E_fnc_subArr =
{
private ['_a1', '_a2', '_a3'];
_a1 = [_this, 0, [], [[]]] call BIS_fnc_param;
_a2 = [_this, 1, [], [[]]] call BIS_fnc_param;
if (count _a1 == 0 || {count _a2 == 0}) exitWith {[]};
if (count _a1 != count _a2) exitWith {[]};
_a3 = [];
{
_a3 pushBack ((_a1 select _foreachindex) - (_a2 select _foreachindex));
} foreach _a1;
_a3
};
DMS_fnc_setRelPositions =
{
private ['_OK','_objects','_newCPos','_center'];
_OK = params
[
["_objects", [], [[]]],
["_newCPos", [], [[]],[3]]
];
if (!_OK) exitWith
{
diag_log format ["DMS ERROR :: Calling DMS_fnc_setRelPositions with invalid parameters: %1",_this];
};
_center = [_objects] call M3E_fnc_getCenter;
{
private ['_relpos','_objPos'];
_relpos = [getPosATL _x, _center] call M3E_fnc_subArr;
_objPos = [_newCPos,_relpos] call DMS_fnc_CalcPos;
_x setPosATL _objPos;
//diag_log format ["Setting %1 at %2; %3 is the relpos from original center %4, reapplied to new center %5",typeOf _x,_objPos,_relpos,_center,_newCPos];
} foreach _objects;
};