mirror of
https://github.com/Defent/DMS_Exile.git
synced 2024-08-30 16:52:12 +00:00
70fae7bc44
* **NEW CONFIG VALUES:** DMS_SpawnFlareOnReinforcements DMS_MissionMarkerWinDot_Type DMS_MissionMarkerLoseDot_Type DMS_EnableBoxMoving DMS_BasesToImportOnServerStart DMS_AI_Classname DMS_AI_AimCoef_easy DMS_AI_AimCoef_moderate DMS_AI_AimCoef_difficult DMS_AI_AimCoef_hardcore DMS_AI_EnableStamina_easy DMS_AI_EnableStamina_moderate DMS_AI_EnableStamina_difficult DMS_AI_EnableStamina_hardcore DMS_AI_destroyStaticWeapon DMS_AI_destroyStaticWeapon_chance DMS_ai_SupportedRandomClasses DMS_random_non_assault_AI DMS_random_non_MG_AI DMS_random_non_sniper_AI * Please check out the new config values in config.sqf to see what they do :) * Fixed issue with "thieves" mission (and DMS-spawned persistent vehicles in general). Big thank you to [JamieKG from Eternal Gamer](http://eternal-gamer.com/) and Torndeco. * **New static mission: "slums"** * Credit for the base goes to [William from Refugees of the Fallen](http://refugeesofthefallen.enjin.com/) * Spawns 2 crates at 2 different locations from a list of 5 locations. * No AI vehicles, only infantry (introduces Close Quarters Combat) * Added to Altis by default. * Static bases can now be imported on server startup instead of mission spawns. Enabled by default for saltflats and slums. * Increased "DMS_MissionTimeoutResetRange" from 1000 to 1500. * Removed the Navid from config (MG AI and box weapons). * Edited panthera3_config to reduce SpawnZoneNear and TraderZoneNear blacklists. * Edited "blackhawkdown" and "donthasslethehoff" missions to use a slightly different heli wreck classname. * Increased marker circle diameter for saltflats mission to 750 meters. * Moved "DMS_Version" variable assignment to pre-init. * Moved Map Center and Map Radius assignments to post-init. * Added support for 2 new optional parameters: _onMonitorStart and _onMonitorEnd, run before and after the Mission Monitor checks the mission, but AFTER "Mission Success State" is checked. * Mines should now be deleted when a mission fails. * Script optimizations for almost all functions using new command(s) introduced in ArmA v1.54, as well as improved technique(s). * "ExileServer_system_garbageCollector_deleteObject" is now used to actually delete items by DMS_fnc_CleanUp. * AI and vehicle cleanup should now be completely handled by Exile. * Added support for mARMA logging. * **You can now disable the movement/lifting of loot crates after the mission is complete using "DMS_EnableBoxMoving".** * Added some debug code to DMS_fnc_FindSafePos and DMS_fnc_IsValidPosition (commented out by default) * New group reinforcement type "increasing_difficulty". * DMS_fnc_IsNearWater now checks for invalid parameter(s). * DMS_fnc_PlayerAwardOnAIKill now checks for roadkill values AFTER unit-defined respect/tabs. * You can now define different marker types for mission completion/failure using "DMS_MissionMarkerWinDot_Type" and "DMS_MissionMarkerLoseDot_Type" respectively. * "DMS_fnc_SetGroupBehavior" can now take a unit as parameter as well. It will also now return true if behavior was changed, false otherwise. * "DMS_fnc_SpawnAIGroup" and "DMS_fnc_SpawnAIGroup_MultiPos" now supports the definition of custom gear sets. * Improved function documentation for "DMS_fnc_SpawnAIGroup", "DMS_fnc_SpawnAIGroup_MultiPos", and "DMS_fnc_SpawnAISoldier". * "DMS_fnc_SpawnAISoldier" now supports multiple different random AI class presets. This means that you can define a certain "random" class preset, but have it select from a specially defined list that excludes classes that you don't want. * Added default values to certain "missionNameSpace getVariable"s in DMS_fnc_SpawnAISoldier to prevent script errors in the event of invalid definitions. * Slight logic tweak/fix to DMS_fnc_TargetsKilled (it shouldn't throw errors when there aren't any).
111 lines
3.1 KiB
Plaintext
111 lines
3.1 KiB
Plaintext
/*
|
|
DMS_fnc_SpawnMinefield
|
|
Created by eraser1
|
|
|
|
Usage:
|
|
[
|
|
_centerPos, // ARRAY: Position to spawn the minefield around
|
|
_difficulty, // STRING or ARRAY: The "difficulty" level of the minefield. Determines the number of mines and the radius it spawns at. String refers to a difficulty set in config, array is defined as [_mineCount,_radius];
|
|
_side, // STRING: The "side" for which the mines should spawn. The spawned mines will be revealed to the AI so they don't run into it.
|
|
_spawnWarningSign, // (OPTIONAL) BOOL: Whether or not to spawn the warning signs around the minefield (at maximum radius + 2 meters)
|
|
_mineClassname // (OPTIONAL) STRING: The classname of the mine to spawn.
|
|
] call DMS_fnc_SpawnMinefield;
|
|
*/
|
|
|
|
private ["_centerPos", "_difficulty", "_side", "_mines", "_minesInfo", "_AISide", "_mineCount", "_radius", "_randDirOffset", "_sign"];
|
|
|
|
|
|
_mines = [];
|
|
|
|
if (DMS_SpawnMinesAroundMissions) then
|
|
{
|
|
if !(params
|
|
[
|
|
["_centerPos","",[[]],[2,3]],
|
|
["_difficulty","",["",[]],[2]],
|
|
["_side","",[""]]
|
|
])
|
|
exitWith
|
|
{
|
|
diag_log format ["DMS ERROR :: Calling DMS_fnc_SpawnMinefield with invalid parameters: %1",_this];
|
|
};
|
|
|
|
_spawnWarningSign = DMS_SpawnMineWarningSigns;
|
|
_mineClassname = "ATMine";
|
|
if ((count _this)>3) then
|
|
{
|
|
_spawnWarningSign = param [3,DMS_SpawnMineWarningSigns,[true]];
|
|
|
|
if ((count _this)>4) then
|
|
{
|
|
_mineClassname = param [4,"ATMine",[true]];
|
|
};
|
|
};
|
|
|
|
|
|
if !(getText (configfile >> "CfgVehicles" >> _mineClassname >> "vehicleClass") isEqualTo "Mines") exitWith
|
|
{
|
|
diag_log format ["DMS ERROR :: Calling DMS_fnc_SpawnMinefield with invalid _mineClassname: %1 | _this: %2",_mineClassname, _this];
|
|
};
|
|
|
|
|
|
_minesInfo = _difficulty;
|
|
if (_difficulty isEqualType "") then
|
|
{
|
|
_minesInfo = missionNamespace getVariable [format ["DMS_MineInfo_%1", _difficulty], [10,50]];
|
|
};
|
|
|
|
_AISide = missionNamespace getVariable [format ["DMS_%1Side", _side], EAST];
|
|
|
|
|
|
_mineCount = _minesInfo select 0;
|
|
_radius = _minesInfo select 1;
|
|
|
|
|
|
for "_i" from 1 to _mineCount do
|
|
{
|
|
private ["_minePos", "_mine"];
|
|
|
|
_minePos = [_centerPos,random _radius,random 360] call DMS_fnc_SelectOffsetPos;
|
|
_mine = createMine ["ATMine", [0,0,0], [], 0];
|
|
|
|
// Fixes players shooting the mine and causing premature 'splosions
|
|
if (DMS_BulletProofMines) then
|
|
{
|
|
_mine allowDamage false;
|
|
};
|
|
|
|
//In case you're using directional mines such as tripwires/SLAMs
|
|
_mine setDir (random 360);
|
|
_mine setPosATL _minePos;
|
|
|
|
_AISide revealMine _mine;
|
|
|
|
|
|
_mines pushBack _mine;
|
|
};
|
|
|
|
if (_spawnWarningSign) then
|
|
{
|
|
_randDirOffset = random 45;
|
|
for "_i" from 0 to 359 step 90 do
|
|
{
|
|
_sign = createVehicle ["Land_Sign_Mines_F", [0,0,0], [], 0, "CAN_COLLIDE"];
|
|
_sign setDir (180+_i);
|
|
_sign setPosATL ([_centerPos, _radius+2, _randDirOffset+_i] call DMS_fnc_SelectOffsetPos);
|
|
_sign setVectorUp [0,0,1];
|
|
|
|
// _mines array is for only cleanup atm, so just add them to the list
|
|
_mines pushBack _sign;
|
|
};
|
|
};
|
|
|
|
if (DMS_DEBUG) then
|
|
{
|
|
(format ["SpawnMinefield :: Spawned %1 mines around %2 with _minesInfo: %3 | Warning signs spawned: %5 | _mines: %4",_mineCount,_centerPos,_minesInfo,_mines,_spawnWarningSign]) call DMS_fnc_DebugLog;
|
|
};
|
|
};
|
|
|
|
|
|
|
|
_mines |