DMS_Exile/@ExileServer/addons/a3_dms/scripts/fn_AILocalityManager.sqf
eraser1 8562289765 Some more required changes... sorry
* **You must update all of your mission files; the mission message
system as well as the calling parameters for DMS_fnc_FindSafePos have
been overhauled and will be incompatible with previous versions.**
* NEW CONFIG VALUES:

|DMS_ThrottleBlacklists|
|DMS_AttemptsUntilThrottle|
|DMS_ThrottleCoefficient|
|DMS_MinThrottledDistance|
* Decreased
"DMS_TraderZoneNearBlacklist","DMS_MissionNearBlacklist","DMS_WaterNearBlacklist"
* Changed "DMS_dynamicText_Color" to "#FFFFFF" (white)
* Replaced weapon classes in "DMS_CrateCase_Sniper" to the base classes;
all attachments should now spawn in the box separately.
* New function DMS_fnc_IsValidPosition (uses logic that was previously
from "DMS_fnc_FindSafePos").
* You can now manually define every individual parameter for
DMS_fnc_findSafePos per-mission, instead of using global parameters.
* AI will now be offloaded to an HC even with "DMS_ai_offload_to_client"
set to false.
* All of the previously "supported" values for
"DMS_PlayerNotificationTypes" are now PROPERLY supported.
DMS_PlayerNotificationTypes is now set to default "dynamicTextRequest"
and "systemChatRequest".
* Tweaked "cardealer" mission, the cars should no longer spawn inside of
each other.
2015-10-03 22:32:42 -05:00

52 lines
1.4 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
{
if (DMS_DEBUG) then
{
diag_log format ["DMS_DEBUG AILocalityManager :: DMS_HC_Object is null! Finding owner for group: %1",_group];
};
_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);
if (DMS_DEBUG) then
{
diag_log format ["DMS_DEBUG AILocalityManager :: Setting ownership of group %1 to HC (%2). Success: %3",_group,DMS_HC_Object,_transferSuccess];
};
};
};
};
};
} forEach allGroups;