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.
47 lines
1.3 KiB
Plaintext
47 lines
1.3 KiB
Plaintext
/*
|
|
DMS_fnc_AILocalityManager
|
|
Created by Defent and eraser1
|
|
|
|
Offloads AI groups to a nearby client or HC in order to improve server performance.
|
|
*/
|
|
|
|
|
|
if (!DMS_ai_offload_to_client && {isNull DMS_HC_Object}) exitWith {};
|
|
|
|
{
|
|
if (((count (units _x))>1) && {!((DMS_ai_offload_Only_DMS_AI && {!(_x getVariable ["DMS_SpawnedGroup",false])}) || {(_x getVariable ["DMS_LockLocality",false])})}) then
|
|
{
|
|
private ["_leader", "_group", "_owner"];
|
|
_leader = leader _x;
|
|
_group = _x;
|
|
if ((!isNull _leader) && {(alive _leader) && {!isPlayer _leader}}) then
|
|
{
|
|
if (isNull DMS_HC_Object) then
|
|
{
|
|
|
|
(format ["AILocalityManager :: DMS_HC_Object is null! Finding owner for group: %1",_group]) call DMS_fnc_DebugLog;
|
|
_owner = objNull;
|
|
|
|
{
|
|
if ((groupOwner _group) isEqualTo (owner _x)) exitWith
|
|
{
|
|
_owner = _x;
|
|
};
|
|
} forEach allPlayers;
|
|
|
|
if ((isNull _owner) || {(_owner distance2D _leader)>3500}) then
|
|
{
|
|
[_group,_leader] call DMS_fnc_SetAILocality;
|
|
};
|
|
}
|
|
else
|
|
{
|
|
if !((groupOwner _group) isEqualTo (owner DMS_HC_Object)) then
|
|
{
|
|
_transferSuccess = _group setGroupOwner (owner DMS_HC_Object);
|
|
(format ["AILocalityManager :: Setting ownership of group %1 to HC (%2). Success: %3",_group,DMS_HC_Object,_transferSuccess]) call DMS_fnc_DebugLog;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
} forEach allGroups; |