2015-09-25 06:40:59 +00:00
/*
DMS_fnc_SpawnMinefield
Created by eraser1
Usage:
[
2015-09-26 00:28:04 +00:00
_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, to the North/West/East/South)
_mineClassname // (OPTIONAL) STRING: The classname of the mine to spawn.
2015-09-25 06:40:59 +00:00
] call DMS_fnc_SpawnMinefield;
*/
Finally another update... warming up
* NEW CONFIG VALUE: DMS_SpawnMinefieldForEveryMission
* You can now force-spawn an AT mine minefield on every mission with the
above config. These mines will only blow up on Tanks, APCs, and MRAPs
(Ifrits, Hunters, Striders).
* ALL MISSIONS HAVE BEEN EDITED TO MATCH THE NEW STANDARD FOR
DMS_fnc_AddMissionToMonitor. **If you have made any custom missions or
modified any of the current mission scripts, make sure you merge your
changes**!
* Adjusted the placement of the armed car in "bandits" mission. It
should no longer spawn right on the crate.
* Marker and message names for the "foodtransport" mission have been
adjusted.
* Added the AI vehicle to the "mercbase" mission.
* Removed some RPT spam...
* Standardize ATL for DMS_fnc_importFromM3E_Convert
* When revealing a player to AI, the reveal amount will be reduced if
the player has a suppressor.
* DMS_fnc_SetGroupBehavior will now remove all previous waypoints from
the AI group.
* Improved logging message for DMS_fnc_SpawnMinefield. Also, the mine
warning signs should be on a random offset (instead of always spawning
at 0, 90, 180, and 270 degrees)
2015-10-01 02:29:33 +00:00
private ["_centerPos", "_difficulty", "_side", "_mines", "_minesInfo", "_AISide", "_mineCount", "_radius", "_randDirOffset", "_sign"];
2015-09-25 06:40:59 +00:00
_mines = [];
if (DMS_SpawnMinesAroundMissions) then
{
_OK = params
[
["_centerPos","",[[]],[2,3]],
2015-09-26 00:28:04 +00:00
["_difficulty","",["",[]],[2]],
2015-09-25 06:40:59 +00:00
["_side","",[""]]
];
if (!_OK) exitWith
{
diag_log format ["DMS ERROR :: Calling DMS_fnc_SpawnMinefield with invalid parameters: %1",_this];
};
2015-09-26 00:28:04 +00:00
_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]];
};
};
_minesInfo = _difficulty;
if ((typeName _difficulty)=="STRING") then
{
_minesInfo = missionNamespace getVariable [format ["DMS_MineInfo_%1", _difficulty], [10,50]];
};
2015-09-25 06:40:59 +00:00
_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", _minePos, [], 0];
2015-09-26 00:28:04 +00:00
// 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);
2015-09-25 06:40:59 +00:00
_AISide revealMine _mine;
_mines pushBack _mine;
};
2015-09-26 00:28:04 +00:00
if (_spawnWarningSign) then
{
Finally another update... warming up
* NEW CONFIG VALUE: DMS_SpawnMinefieldForEveryMission
* You can now force-spawn an AT mine minefield on every mission with the
above config. These mines will only blow up on Tanks, APCs, and MRAPs
(Ifrits, Hunters, Striders).
* ALL MISSIONS HAVE BEEN EDITED TO MATCH THE NEW STANDARD FOR
DMS_fnc_AddMissionToMonitor. **If you have made any custom missions or
modified any of the current mission scripts, make sure you merge your
changes**!
* Adjusted the placement of the armed car in "bandits" mission. It
should no longer spawn right on the crate.
* Marker and message names for the "foodtransport" mission have been
adjusted.
* Added the AI vehicle to the "mercbase" mission.
* Removed some RPT spam...
* Standardize ATL for DMS_fnc_importFromM3E_Convert
* When revealing a player to AI, the reveal amount will be reduced if
the player has a suppressor.
* DMS_fnc_SetGroupBehavior will now remove all previous waypoints from
the AI group.
* Improved logging message for DMS_fnc_SpawnMinefield. Also, the mine
warning signs should be on a random offset (instead of always spawning
at 0, 90, 180, and 270 degrees)
2015-10-01 02:29:33 +00:00
_randDirOffset = random 45;
2015-09-26 00:28:04 +00:00
for "_i" from 0 to 359 step 90 do
{
Finally another update... warming up
* NEW CONFIG VALUE: DMS_SpawnMinefieldForEveryMission
* You can now force-spawn an AT mine minefield on every mission with the
above config. These mines will only blow up on Tanks, APCs, and MRAPs
(Ifrits, Hunters, Striders).
* ALL MISSIONS HAVE BEEN EDITED TO MATCH THE NEW STANDARD FOR
DMS_fnc_AddMissionToMonitor. **If you have made any custom missions or
modified any of the current mission scripts, make sure you merge your
changes**!
* Adjusted the placement of the armed car in "bandits" mission. It
should no longer spawn right on the crate.
* Marker and message names for the "foodtransport" mission have been
adjusted.
* Added the AI vehicle to the "mercbase" mission.
* Removed some RPT spam...
* Standardize ATL for DMS_fnc_importFromM3E_Convert
* When revealing a player to AI, the reveal amount will be reduced if
the player has a suppressor.
* DMS_fnc_SetGroupBehavior will now remove all previous waypoints from
the AI group.
* Improved logging message for DMS_fnc_SpawnMinefield. Also, the mine
warning signs should be on a random offset (instead of always spawning
at 0, 90, 180, and 270 degrees)
2015-10-01 02:29:33 +00:00
_sign = createVehicle ["Land_Sign_Mines_F",[_centerPos, _radius+2, _randDirOffset+_i] call DMS_fnc_SelectOffsetPos, [], 0, "CAN_COLLIDE"];
2015-10-09 00:26:27 +00:00
_sign setDir (180+_i);
2015-09-26 00:28:04 +00:00
_sign setVectorUp [0,0,1];
// _mines array is for only cleanup atm, so just add them to the list
_mines pushBack _sign;
};
};
Readme changes, new debug fnc, fixes, tweaks
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.
2015-10-10 01:35:07 +00:00
(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;
2015-09-25 06:40:59 +00:00
};
_mines