mirror of
https://github.com/Defent/DMS_Exile.git
synced 2024-08-30 16:52:12 +00:00
78aa0f8667
#### November 14, 2015 (8:30 PM CST-America): * **NEW CONFIG VALUES:** DMS_AllowStaticReinforcements DMS_MarkerText_ShowAICount_Static DMS_PredefinedMissionLocations_WEIGHTED DMS_AIKill_DistanceBonusMinDistance DMS_AIKill_DistanceBonusCoefficient * You can now manually disable Static Mission AI reinforcements using "DMS_AllowStaticReinforcements" * You can now choose whether or not to show AI count for map markers for both Static and Dynamic missions separately. * DMS will now check to see if the config.sqf didn't load properly, and for the presence of RyanZombies. * You can now make predefined locations weighted. * Some optimization + code clarity. * Added ```taviana_config.sqf``` (identical to ```tavi_config.sqf```) for the latest version of Taviana. * **saltflats mission**: * The AI will now initially spawn randomly across the compound. This should help with the issue of some AI spawning outside of the compound. * Added more static guns: 4 around the flagpole (5 meters north, south, east, and west). One on top of the tower in each corner, and another on the top of the concrete water tower. * When an AI group is offloaded to a client and he gets out of range AND no other viable client is found, the AI locality should now revert to the server (it used to just stay with the original client). * Added extra measures to prevent the creation of 2 markers with the same name. * fn_FillCrate.sqf: * Fixed the issue where DMS would complain about incorrect parameters when using custom code to generate loot. * DMS now has debug logging to tell you exactly what it spawns in the crate when using a crate case or custom code. * "DMS_PredefinedMissionLocations" itself will now be shuffled when finding a position. This should make the generated positions even more random. * Added new Group Reinforcement Types: "armed_vehicle_replace" and "static_gunner" * Potentially resolved the issue with launchers not being deleted from AI bodies when they're killed sometimes. * **fn_PlayerAwardOnAIKill.sqf**: Created a separate function to handle poptabs/respect of a player when he/she kills an AI. * Added a "distance bonus" for respect when killing AI. * Added logging for player rewards on AI kills. * DMS now lets Exile's body cleanup handle dead AIs. * Fixed the issue where DMS would spawn static missions even when "DMS_StaticMission" is set to false. * fn_SetAILocality.sqf now returns true/false if it does/doesn't find an owner. * New function "fn_SpawnAIGroup_MultiPos.sqf". Almost identical to SpawnAIGroup, except it spawns each AI along a list of locations. * **Removed the pre-packed PBO. Too many people were having issues with their PBO tool removing the prefix and repacking it would result in DMS not working.**
81 lines
1.1 KiB
Plaintext
81 lines
1.1 KiB
Plaintext
/*
|
|
DMS_fnc_GetAllUnits
|
|
Created by eraser1
|
|
|
|
|
|
Usage:
|
|
[
|
|
_unitOrGroupOrArray1,
|
|
_unitOrGroupOrArray2,
|
|
...
|
|
_unitOrGroupOrArrayN
|
|
] call DMS_fnc_GetAllUnits;
|
|
|
|
Returns all living units from a given array of groups or objects.
|
|
*/
|
|
|
|
private ["_units"];
|
|
|
|
if ((typeName _this)!="ARRAY") then
|
|
{
|
|
_this = [_this];
|
|
};
|
|
|
|
|
|
_units = [];
|
|
|
|
{
|
|
private ["_parameter"];
|
|
_parameter = _x;
|
|
|
|
_units append
|
|
(
|
|
switch (typeName _parameter) do
|
|
{
|
|
case "ARRAY":
|
|
{
|
|
_parameter call DMS_fnc_GetAllUnits
|
|
};
|
|
|
|
case "OBJECT":
|
|
{
|
|
if (!(isNull _parameter) && {alive _parameter}) then
|
|
{
|
|
[_parameter]
|
|
}
|
|
else
|
|
{
|
|
[]
|
|
}
|
|
};
|
|
|
|
case "GROUP":
|
|
{
|
|
if (!isNull _parameter) then
|
|
{
|
|
{
|
|
if (alive _x) then
|
|
{
|
|
_units pushBack _x;
|
|
};
|
|
} forEach (units _parameter);
|
|
};
|
|
[]
|
|
};
|
|
|
|
default
|
|
{
|
|
diag_log format ["DMS ERROR :: Calling DMS_fnc_GetAllUnits with an invalid parameter: %1 | Type: %2", _parameter, typeName _parameter];
|
|
[]
|
|
};
|
|
}
|
|
);
|
|
} forEach _this;
|
|
|
|
if (DMS_DEBUG) then
|
|
{
|
|
(format ["GetAllUnits :: Input (%1) produced units: %2",_this,_units]) call DMS_fnc_DebugLog;
|
|
};
|
|
|
|
|
|
_units |