Release Candidate

This commit is contained in:
eraser1 2016-04-14 21:20:26 -05:00
parent 1e301e8cb6
commit fd94fb0bcc
15 changed files with 115 additions and 103 deletions

View File

@ -4,7 +4,7 @@ class CfgPatches
{
units[] = {};
weapons[] = {};
a3_DMS_version = "March 31 2016 (TEST)";
a3_DMS_version = "April 14, 2016 (RC)";
requiredVersion = 1.36;
requiredAddons[] = {"exile_client","exile_server_config"};
};

View File

@ -105,7 +105,7 @@ _crate = [_crateClassname, _pos] call DMS_fnc_SpawnCrate;
_veh =
[
[
_pos getPos [_pos,100,random 360],
_pos getPos [100,random 360],
_pos
],
_group,

View File

@ -57,7 +57,7 @@
*/
private ["_added", "_pos", "_onEndingScripts", "_completionInfo", "_timeOutInfo", "_units", "_inputUnits", "_missionObjs", "_mines", "_difficulty", "_side", "_messages", "_markers", "_arr", "_timeStarted", "_timeUntilFail", "_buildings", "_vehs", "_crate_info_array", "_missionName", "_msgWIN", "_msgLose", "_markerDot", "_markerCircle", "_missionEvents", "_onSuccessScripts", "_onFailScripts"];
private ["_added", "_pos", "_onEndingScripts", "_completionInfo", "_timeOutInfo", "_units", "_missionObjs", "_mines", "_difficulty", "_side", "_messages", "_markers", "_arr", "_timeStarted", "_timeUntilFail", "_buildings", "_vehs", "_crate_info_array", "_missionName", "_msgWIN", "_msgLose", "_markerDot", "_markerCircle", "_missionEvents", "_onSuccessScripts", "_onFailScripts"];
_added = false;
@ -68,7 +68,7 @@ if !(params
["_pos","",[[]],[2,3]],
["_completionInfo","",[[]]],
["_timeOutInfo","",[[]],[1,2]],
["_inputUnits","",[[]]],
["_units","",[[]]],
["_missionObjs","",[[]],[3,4]],
["_messages","",[[]],[3]],
["_markers","",[[]],[DMS_MissionMarkerCount]],
@ -103,9 +103,6 @@ try
["_timeUntilFail",DMS_MissionTimeOut call DMS_fnc_SelectRandomVal,[0]]
];
_units = _inputUnits call DMS_fnc_GetAllUnits;
if !(_missionObjs params
[
["_buildings","",[[]]],

View File

@ -67,7 +67,7 @@
*/
private ["_added", "_pos", "_onEndingScripts", "_completionInfo", "_timeOutInfo", "_units", "_inputUnits", "_missionObjs", "_mines", "_difficulty", "_side", "_messages", "_markers", "_arr", "_timeStarted", "_timeUntilFail", "_buildings", "_vehs", "_crate_info_array", "_missionName", "_msgWIN", "_msgLose", "_markerDot", "_markerCircle", "_missionEvents", "_onSuccessScripts", "_onFailScripts"];
private ["_added", "_pos", "_onEndingScripts", "_completionInfo", "_timeOutInfo", "_units", "_missionObjs", "_mines", "_difficulty", "_side", "_messages", "_markers", "_arr", "_timeStarted", "_timeUntilFail", "_buildings", "_vehs", "_crate_info_array", "_missionName", "_msgWIN", "_msgLose", "_markerDot", "_markerCircle", "_missionEvents", "_onSuccessScripts", "_onFailScripts"];
_added = false;
@ -78,7 +78,7 @@ if !(params
["_completionInfo","",[[]]],
["_groupReinforcementsInfo","",[[]]],
["_timeOutInfo","",[[]],[1,2]],
["_inputUnits","",[[]]],
["_units","",[[]]],
["_missionObjs","",[[]],[3,4]],
["_messages","",[[]],[3]],
["_markers","",[[]],[DMS_MissionMarkerCount]],
@ -166,7 +166,7 @@ try
_timeStarted,
_timeUntilFail
],
_inputUnits,
_units,
[
_buildings,
_vehs,
@ -195,7 +195,7 @@ try
if (DMS_MarkerText_ShowAICount) then
{
_markerDot = _markers select 0;
_markerDot setMarkerText (format ["%1 (%2 %3 remaining)",markerText _markerDot,count (_inputUnits call DMS_fnc_GetAllUnits),DMS_MarkerText_AIName]);
_markerDot setMarkerText (format ["%1 (%2 %3 remaining)",markerText _markerDot,count (_units call DMS_fnc_GetAllUnits),DMS_MarkerText_AIName]);
};
if (DMS_DEBUG) then

View File

@ -17,7 +17,6 @@
A single object can also be used for (_this select 0)
*/
if (DMS_CleanUpList isEqualTo []) exitWith {}; // Empty array, no objects to clean :)
{
if (DMS_DEBUG) then
@ -27,7 +26,7 @@ if (DMS_CleanUpList isEqualTo []) exitWith {}; // Empty array, no objects to cl
private ["_objs","_timeAddedToList","_timeUntilClean"];
if !(_x params
[
["_objs",[objNull],[objNull,[],grpNull]],
@ -51,4 +50,4 @@ if (DMS_CleanUpList isEqualTo []) exitWith {}; // Empty array, no objects to cl
(format ["CleanUpManager :: %1 is not yet ready to clean!",_x]) call DMS_fnc_DebugLog;
};
};
} forEach DMS_CleanUpList;
} forEach DMS_CleanUpList;

View File

@ -40,8 +40,8 @@ _units = [];
case "OBJECT":
{
[
[_parameter],
[]
[],
[_parameter]
] select (alive _parameter);
};

View File

@ -96,9 +96,12 @@
_monitorParams =
[
_AICount, // SCALAR: If the AI Group has fewer than "_AICount" living units, then the group will receive reinforcements.
_ejectFFVGunners, // BOOLEAN: Whether or not to eject the gunners that are FFV (firing from vehicle).
_remainAsGunship, // BOOLEAN: Whether or not the heli should remain in the area and function as a gunship or simply fly away and despawn.
_vehClass // (OPTIONAL) STRING: The classname of the vehicle to spawn. Use "random" to select a random vehicle from "DMS_ArmedVehicles". Default: "random"
_ejectFFVGunners, // BOOLEAN: Whether or not to eject Fire-From-Vehicle (FFV) gunners.
_maxJumpers, // SCALAR: Maximum number of AI to eject from the aircraft. Set to a really high # to ignore (like 999).
_remainAsGunship, // BOOLEAN: Whether or not to keep the heli flying around as a gunship.
_dropPoint, // OBJECT or ARRAY (OPTIONAL - Position2D or 3D): The location to drop the reinforcements at. The drop point will default to the group leader.
_heliClass, // STRING (OPTIONAL): The classname of the heli to spawn.
_spawnPos // ARRAY (OPTIONAL - Position2D or 3D): The position for the heli to spawn at.
]
This reinforcement type will attempt to drop the AI off at the group leader's position. The heli will spawn in the air 500-5000 meters away from the leader's position and 1000 meters away from a player (default).
@ -504,7 +507,8 @@ if (!_reinforcementsDepleted && {(diag_tickTime-_lastUpdated)>_updateDelay}) the
[
["_AICount",0,[0]],
["_ejectFFVGunners",false,[false]],
["_remainAsGunship",false,[false]]
["_maxJumpers",0,[0]],
["_remainAsGunship", 0, [false]]
])
exitWith
{
@ -514,18 +518,28 @@ if (!_reinforcementsDepleted && {(diag_tickTime-_lastUpdated)>_updateDelay}) the
if (_remainingUnits<_AICount) then
{
private["_heli"];
private _dropPoint = if ((count _monitorParams)>4) then {_monitorParams param [4, getPosATL (leader _AIGroup), [objNull,[]], [2,3]]} else {getPosATL (leader _AIGroup)};
private _heliClass = if ((count _monitorParams)>5) then {_monitorParams param [5, "", [""]]} else {selectRandom DMS_ReinforcementHelis};
_heli =
[
private _params =
[
_AIGroup,
_class,
_difficulty,
_side,
getPosATL (leader _AIGroup),
_dropPoint,
_ejectFFVGunners,
_remainAsGunship
] call DMS_fnc_SpawnHeliReinforcement;
_maxJumpers,
_remainAsGunship,
_heliClass
];
if ((count _monitorParams)>6) then
{
_params pushBack (_monitorParams select 6);
};
private _heli = _params call DMS_fnc_SpawnHeliReinforcement;
// Every vehicle counts as one unit given, so the number of units given is equivalent to number of waves given.
_reinforcementWavesGiven = _reinforcementWavesGiven + 1;

View File

@ -2,16 +2,12 @@
DMS_fnc_HeliParatroopers_Monitor
Created by eraser1
**********!!!!NOTE!!!!**********: THIS FUNCTION IS NOT FINAL, IT IS FOR TESTING PURPOSES ONLY! Changes are planned, and the function parameters will likely change.
In addition, this function is not behaving as expected.
Used in Exile's thread system.
Every heli to be used as paratroopers has an index in "DMS_HeliParatrooper_Arr".
Every index has the values:
[
_heli, // OBJECT: The heli that holds the units.
_dropPoint, // ARRAY (POSITION2D or 3D): The position (or object) to which the troopers need to be dropped near.
_ejectFFVGunners, // BOOLEAN: Whether or not to eject Fire-From-Vehicle (FFV) gunners.
_remainAsGunship // BOOLEAN: Whether or not to keep the heli flying around as a gunship.
]
@ -46,14 +42,12 @@
} forEach DMS_HelisToClean;
if (DMS_HeliParatrooper_Arr isEqualTo []) exitWith {};
{
if !(_x params
[
["_heli", objNull, [objNull]],
["_dropPoint", 0, [[], objNull], [2,3]],
["_ejectFFVGunners", false, [false]],
["_remainAsGunship", false, [false]]
])
exitWith
@ -89,18 +83,11 @@ if (DMS_HeliParatrooper_Arr isEqualTo []) exitWith {};
};
{
_x params
[
"_unit",
"_role",
"_cargoIndex",
"_turretPath",
"_personTurret"
];
private _unit = _x;
if ((alive _unit) && {(_role isEqualTo "cargo") || {_ejectFFVGunners && {_personTurret}}}) then
if ((alive _unit) && {_unit getVariable ["DMS_Paratrooper", false]}) then
{
/*
/*
moveOut _unit;
private ["_parachute", "_dir"];
_parachute = createVehicle ["Steerable_Parachute_F", (getPosATL _unit), [], 0, "CAN_COLLIDE"];
@ -108,13 +95,13 @@ if (DMS_HeliParatrooper_Arr isEqualTo []) exitWith {};
_parachute enableSimulationGlobal true;
_unit moveInDriver _parachute;
*/
*/
_unit action ["Eject", _heli];
_unit setDestination [_dropPoint, "LEADER DIRECT", true];
_unit setVariable ["DMS_AISpawnPos", _dropPoint];
};
} forEach (fullCrew _heli);
} forEach (crew _heli);
if (_remainAsGunship) then
{
@ -134,11 +121,21 @@ if (DMS_HeliParatrooper_Arr isEqualTo []) exitWith {};
else
{
private _pilot = driver _heli;
private _pilotGrp = createGroup (side _pilot);
private _newPos = _dropPoint getPos [2 * worldSize, random 360];
[_pilot] joinSilent (createGroup (side _pilot));
[_pilot] joinSilent _pilotGrp;
_pilot setDestination [_dropPoint getPos [2 * worldSize, random 360], "VEHICLE PLANNED", true];
{_pilot disableAI _x} forEach ["FSM", "AUTOCOMBAT", "CHECKVISIBLE", "TARGET", "AUTOTARGET"];
_pilot setDestination [_newPos, "VEHICLE PLANNED", true];
for "_i" from count (waypoints _pilotGrp) to 1 step -1 do
{
deleteWaypoint ((waypoints _pilotGrp) select _i);
};
private _wp = _pilotGrp addWaypoint [_newPos,5];
_wp setWaypointType "MOVE";
//{_pilot disableAI _x} forEach ["FSM", "AUTOCOMBAT", "CHECKVISIBLE", "TARGET", "AUTOTARGET"];
DMS_HelisToClean pushBack _heli;

View File

@ -33,7 +33,6 @@
A semi-full breakdown can be found in fn_AddMissionToMonitor.sqf
*/
if (DMS_Mission_Arr isEqualTo []) exitWith {}; // Empty array, no missions running
private ["_pos", "_completionInfo", "_timeStarted", "_failTime", "_units", "_buildings", "_vehs", "_crate_info_array", "_mines", "_missionName", "_msgWIN", "_msgLose", "_markers", "_missionSide", "_arr", "_cleanupList"];
@ -228,16 +227,13 @@ private ["_pos", "_completionInfo", "_timeStarted", "_failTime", "_units", "_bui
_dot setMarkerText (format ["%1 (%2 %3 remaining)",_text,count (_units call DMS_fnc_GetAllUnits),DMS_MarkerText_AIName]);
};
if !(_missionEvents isEqualTo []) then
{
/*
Coming soon...
/*
Coming soon...
{
_x call DMS_fnc_HandleMissionEvents;
} forEach _missionEvents;
*/
};
{
_x call DMS_fnc_HandleMissionEvents;
} forEach _missionEvents;
*/
if !(_onMonitorEnd isEqualTo {}) then

View File

@ -39,7 +39,6 @@
A semi-full breakdown can be found in fn_AddStaticMissionToMonitor.sqf
*/
if (DMS_StaticMission_Arr isEqualTo []) exitWith {}; // Empty array, no static missions running
{
@ -232,16 +231,13 @@ if (DMS_StaticMission_Arr isEqualTo []) exitWith {}; // Empty array, no stati
_dot setMarkerText (format ["%1 (%2 %3 remaining)",_text,count (_inputAIUnits call DMS_fnc_GetAllUnits),DMS_MarkerText_AIName]);
};
if !(_missionEvents isEqualTo []) then
{
/*
Coming soon...
/*
Coming soon...
{
_x call DMS_fnc_HandleMissionEvents;
} forEach _missionEvents;
*/
};
{
_x call DMS_fnc_HandleMissionEvents;
} forEach _missionEvents;
*/
if (DMS_AllowStaticReinforcements) then

View File

@ -117,22 +117,16 @@ if (!isNull _av) then
if (_memCount isEqualTo 0) then
{
/*
I know what you're probably thinking:
What the hell is this? An "if-statement" evaluated for an "if-statement"?! What madness is this?! Does this guy know what he's doing? There has to be a better way!
To which I (eraser1) reply...
I know it looks funky, and there are prettier and slicker ways to do this (such as using "select") BUT I tested extensively and found out that this way is the fastest way, so... yeah...
This is some pretty funky code because this is about the fastest way to do the task.
An "if-statement" inside another "if-statement" is almost as fast, but it isn't as slick ;)
*/
if
(
if (_av isKindOf "StaticWeapon") then
{
DMS_AI_destroyStaticWeapon && {(random 100)<(_av getVariable ["DMS_DestructionChance",DMS_AI_destroyStaticWeapon_chance])}
}
else
{
(random 100)<(_av getVariable ["DMS_DestructionChance",DMS_AI_destroyVehicleChance])
}
call
[
{ (random 100)<(_av getVariable ["DMS_DestructionChance",DMS_AI_destroyVehicleChance]) },
{ DMS_AI_destroyStaticWeapon && {(random 100)<(_av getVariable ["DMS_DestructionChance",DMS_AI_destroyStaticWeapon_chance])} }
] select (_av isKindOf "StaticWeapon")
) then
{
_av setDamage 1;

View File

@ -156,6 +156,8 @@ if ((!isNull _playerObj) && {(_playerUID != "") && {_playerObj isKindOf "Exile_U
(owner _playerObj) publicVariableClient "ExileClientPlayerScore";
ExileClientPlayerScore = nil;
};
//DONKEYPUNCH CUSTOM KILL STAT ADD FOR AI KILL
if (DMS_Add_AIKill2DB) then
{
@ -167,6 +169,7 @@ if ((!isNull _playerObj) && {(_playerUID != "") && {_playerObj isKindOf "Exile_U
(owner _playerObj) publicVariableClient "ExileClientPlayerKills";
ExileClientPlayerKills = nil;
};
//DONKEYPUNCH CUSTOM KILL RANK CHANGE FOR AI KILL
if (DMS_Enable_RankChange) then
{
@ -180,6 +183,8 @@ if ((!isNull _playerObj) && {(_playerUID != "") && {_playerObj isKindOf "Exile_U
ExileClientPlayerHumanity = nil;
};
};
if (DMS_DEBUG) then
{
format ["PlayerAwardOnAIKill :: %1 (%2) awarded %3 poptabs and %4 respect for killing %5. Player's money is now %6, and respect is now %7. Roadkill: %8", name _playerObj, _playerUID, _moneyChange, _repChange, _unit, _playerMoney, _playerRespect, _roadKilled] call DMS_fnc_DebugLog;

View File

@ -106,20 +106,17 @@ removeVest _unit;
removeBackpackGlobal _unit;
// Give default items
if !(DMS_ai_default_items isEqualTo []) then
{
// "Why doesn't linkItem work with any of these? Because fuck you, that's why" - BIS
if (_x in ["Binocular","Rangefinder","Laserdesignator","Laserdesignator_02","Laserdesignator_03"]) then
{
// "Why doesn't linkItem work with any of these? Because fuck you, that's why" - BIS
if (_x in ["Binocular","Rangefinder","Laserdesignator","Laserdesignator_02","Laserdesignator_03"]) then
{
_unit addWeapon _x;
}
else
{
_unit linkItem _x;
};
} forEach DMS_ai_default_items;
};
_unit addWeapon _x;
}
else
{
_unit linkItem _x;
};
} forEach DMS_ai_default_items;
if (_class == "unarmed") then

View File

@ -2,8 +2,6 @@
DMS_fnc_SpawnHeliReinforcement
Created by eraser1
**********!!!!NOTE!!!!**********: THIS FUNCTION IS NOT FINAL, IT IS FOR TESTING PURPOSES ONLY! Changes are planned, and the function parameters will likely change.
This function will create a heli/aircraft within "DMS_RHeli_MinDistFromDrop" to "DMS_RHeli_MaxDistFromDrop" meters and drop units at "_dropPoint".
Usage:
@ -14,6 +12,7 @@
_side, // STRING: The "side" that the AI are on.
_dropPoint, // OBJECT or ARRAY (Position2D or 3D): The location to drop the reinforcements at.
_ejectFFVGunners, // BOOLEAN: Whether or not to eject Fire-From-Vehicle (FFV) gunners.
_maxJumpers, // SCALAR: Maximum number of AI to eject from the aircraft. Set to a really high # to ignore (like 999).
_remainAsGunship, // BOOLEAN: Whether or not to keep the heli flying around as a gunship.
_heliClass, // STRING (OPTIONAL): The classname of the heli to spawn.
_spawnPos // ARRAY (OPTIONAL - Position2D or 3D): The position for the heli to spawn at.
@ -33,6 +32,7 @@ if !(params
["_side", 0, [""]],
["_dropPoint", 0, [[],objNull], [2,3]],
["_ejectFFVGunners", 0, [false]],
["_maxJumpers",0,[0]],
["_remainAsGunship", 0, [false]]
])
exitWith
@ -47,7 +47,7 @@ if (isNull _AIGroup) exitWith
-1
};
_heliClass = if ((count _this)>7) then {_this param [7, "", [""]]} else {selectRandom DMS_ReinforcementHelis};
_heliClass = if ((count _this)>8) then {_this param [8, "", [""]]} else {selectRandom DMS_ReinforcementHelis};
// Make the AI group local to add passengers.
if !(local _AIGroup) then
@ -58,9 +58,9 @@ if !(local _AIGroup) then
// Get the spawn position for the heli
_spawnPos =
if ((count _this)>8) then
if ((count _this)>9) then
{
_this param [8, "", [[]], [2,3]]
_this param [9, [0,0,0], [[]], [2,3]]
}
else
{
@ -122,9 +122,11 @@ _crewCount =
case "gunner";
case "turret":
{
if (_ejectFFVGunners && {_personTurret}) then
if (_ejectFFVGunners && {_personTurret} && {_paratrooperCount < _maxJumpers}) then
{
_unit = [_AIGroup,_spawnPos,_class,_difficulty,_side,"Paratroopers"] call DMS_fnc_SpawnAISoldier;
_unit setVariable ["DMS_Paratrooper", true];
_paratrooperCount = _paratrooperCount + 1;
}
else
@ -132,14 +134,20 @@ _crewCount =
_unit = [_AIGroup,_spawnPos,_class,_difficulty,_side,"Vehicle"] call DMS_fnc_SpawnAISoldier;
_unit setVariable ["DMS_AssignedVeh",_heli];
};
_unit moveInTurret [_heli, _x];
};
case "cargo":
{
_unit = [_AIGroup,_spawnPos,_class,_difficulty,_side,"Paratroopers"] call DMS_fnc_SpawnAISoldier;
_unit moveInCargo [_heli, _cargoIndex];
_paratrooperCount = _paratrooperCount + 1;
if (_paratrooperCount < _maxJumpers) then
{
_unit = [_AIGroup,_spawnPos,_class,_difficulty,_side,"Paratroopers"] call DMS_fnc_SpawnAISoldier;
_unit moveInCargo [_heli, _cargoIndex];
_unit setVariable ["DMS_Paratrooper", true];
_paratrooperCount = _paratrooperCount + 1;
};
};
};
_units pushBack _unit;
@ -167,4 +175,4 @@ if (DMS_DEBUG) then
};
// Add the necessary information to the monitor.
DMS_HeliParatrooper_Arr pushBack [_heli, _dropPoint, _ejectFFVGunners, _remainAsGunship];
DMS_HeliParatrooper_Arr pushBack [_heli, _dropPoint, _remainAsGunship];

View File

@ -117,7 +117,7 @@ ___
___
# Changelog:
### Test Branch:
### Test Branch **!!RC Now Available!!**:
#### List Of new Config values:
DMS_SpawnMissions_Scheduled
@ -130,6 +130,15 @@ ___
DMS_RareLootAmount
DMS_ReinforcementHelis
#### April 14, 2016 (9:20 PM CST-America, RC):
* Fix script error with saltflats.
* "DMS_fnc_AddMissionToMonitor" will no longer convert given AI parameters to a list of objects, so you can now add other units to the mission (within the same group) without much issue.
* Micro-optimizations here and there.
* Fixed an issue with DMS_fnc_GetAllUnits such that it would return an empty list if given a list of AI objects.
* You can now set the maximum limit of paratrooper reinforcements.
* The pilot of the reinforcement heli should now fly away properly if configured to do so.
* Updated group reinforcement manager for compatibility with latest syntax for paratrooper reinforcements (NOTE: UNTESTED).
#### March 31, 2016 (6:00 PM CST-America):
* You can now use "setVariable" to define individually on an AI vehicle its "DMS_DestructionChance". EG: ```_vehicle setVariable ["DMS_DestructionChance",100];``` to always destroy a vehicle when its crew is dead.