mirror of
https://github.com/Defent/DMS_Exile.git
synced 2024-08-30 16:52:12 +00:00
I know... it's been over a week... gimme a break
#### October 17, 2015 (2:30 PM CST-America): * **NEW CONFIG VALUES**: |DMS_TimeToFirstMission| |DMS_ShowDifficultyColorLegend| |DMS_TerritoryNearBlacklist| |DMS_MinSurfaceNormal| (Used to be DMS_MaxSurfaceNormal, simply renamed) |DMS_ai_launchers_per_group| * **UPDATING ALL OF YOUR MISSION FILES IS HIGHLY RECOMMENDED UNLESS YOU KNOW WHAT YOU'RE DOING** * RENAMED "DMS_MaxSurfaceNormal" to "DMS_MinSurfaceNormal". I must have been very tired when I named it... * DMS_MinSurfaceNormal is now 0.9 by default, but will be 0.95 for Altis and Bornholm (since they're relatively large/flat maps). Esseker is still 0.85. If you want to convert DMS_MinSurfaceNormal to degrees, you would take the arc-cosine of the surfaceNormal, and that will give you the degrees from horizontal. For example, arccos(0.9) is about 25 degrees. Google: "arccos(0.9) in degrees" * Tweaked and rebalanced "DMS_BanditMissionTypes". Most of the spawn chances are the same, they're just reduced in order to prevent the creation of arrays that are far larger than they need to be. * You can now manually define how long it takes for the first mission to spawn after a restart. * DMS will now by default create markers on the bottom left of the map to show which colors correspond to which difficulty. It isn't very pretty, but it gets the point across. * DMS will now manually calculate the center of the map and its radius, if it isn't preconfigured by DMS. * You can now specify the vehicles to spawn for missions: "bandits", "cardealer", "construction", "donthasslethehoff", and "thieves". * You can now specify the spawning location of any mission (and whether or not to use an alternative location if the provided location is invalid). This will allow for easy integration of DMS into admin tools. * Added support for scripts to be executed on mission completion or mission failure (this will allow you to have "multi-part" missions, where you would simply spawn the next part of the mission if the previous is completed). * Restructured DMS_DEBUG from the previous patch in favor of a more "optimized" method. * DMS_fnc_findSafePos is completely overhauled; DMS no longer uses "BIS_fnc_findSafePos". It also now throttles minSurfaceNormal on repeated failure. You can now determine whether or not the mission should spawn on water (however, I don't suggest you use this function for water spawns yet). * You can also now define a minimum distance from other territories for missions. * DMS_fnc_IsValidPosition will now check for water depth if the provided position is meant to be checked as a "water spawn". It will now also check for nearby missions from A3XAI or VEMF (untested). * DMS_fnc_IsValidPosition now checks whether or not the position is outside of the map borders. * DMS_fnc_SelectOffsetPos will now return the 3rd element of the provided position as-is. * You can now have multiple AI within a group with a launcher. * AI now have a 5-second godmode after spawning. * You can now spawn a crate using ASL pos. DMS_fnc_SpawnCrate will also make sure that the provided classname is valid. * Just like SpawnCrate, "DMS_fnc_SpawnNonPersistentVehicle" and "DMS_fnc_SpawnPersistentVehicle" will now make sure that the provided classname is valid. * "DMS_fnc_SpawnPersistentVehicle" now supports ASL spawning. * Added support for [Rod Serling's](https://github.com/Rod-Serling) AVS. * General optimization.
This commit is contained in:
parent
122782df6d
commit
30136c8f37
@ -46,6 +46,7 @@ class CfgFunctions
|
||||
class IsPlayerNearby {};
|
||||
class IsNearWater {};
|
||||
class IsValidPosition {};
|
||||
class MissionParams {};
|
||||
class MissionsMonitor {};
|
||||
class MissionSuccessState {};
|
||||
class OnKilled {};
|
||||
|
@ -25,6 +25,7 @@ DMS_Use_Map_Config = true; // Whether or not to use config overwrites specific t
|
||||
DMS_DynamicMission = true; // Enable/disable dynamic mission system
|
||||
DMS_MaxBanditMissions = 3; // Maximum number of Bandit Missions running at the same time
|
||||
DMS_StaticMission = false; // Enable/disable static missions
|
||||
DMS_TimeToFirstMission = [180,420]; // [Minimum,Maximum] time between first mission spawn.
|
||||
DMS_TimeBetweenMissions = [600,900]; // [Minimum,Maximum] time between missions (if mission limit is not reached) | DEFAULT: 10-15 mins
|
||||
DMS_MissionTimeOut = [900,1800]; // [Minimum,Maximum] time it will take for a mission to timeout | Default: 15-30 mins
|
||||
/*General settings for dynamic missions*/
|
||||
@ -34,6 +35,7 @@ DMS_Use_Map_Config = true; // Whether or not to use config overwrites specific t
|
||||
DMS_AI_KillPercent = 100; // The percent amount of AI that need to be killed for "killPercent" mission requirement (NOT IMPLEMENTED)
|
||||
|
||||
/*Mission Marker settings*/
|
||||
DMS_ShowDifficultyColorLegend = true; // Whether or not to show a "color legend" at the bottom left of the map that shows which color corresponds to which difficulty. I know it's not very pretty, meh.
|
||||
DMS_MarkerText_ShowMissionPrefix = true; // Whether or not to place a prefix before the mission marker text. Enable this if your players get confused by the marker names :P
|
||||
DMS_MarkerText_MissionPrefix = "Mission:"; // The text displayed before the mission name in the mission marker.
|
||||
DMS_MarkerText_ShowAICount = true; // Whether or not to display the number of remaining AI in the marker name.
|
||||
@ -70,7 +72,8 @@ DMS_Use_Map_Config = true; // Whether or not to use config overwrites specific t
|
||||
DMS_TraderZoneNearBlacklist = 2500; // Missions won't spawn in a position this many meters close to a trader zone
|
||||
DMS_MissionNearBlacklist = 2500; // Missions won't spawn in a position this many meters close to another mission
|
||||
DMS_WaterNearBlacklist = 500; // Missions won't spawn in a position this many meters close to water
|
||||
DMS_MaxSurfaceNormal = 0.95; // Missions won't spawn if the surface normal of the location is less than this amount. The lower the value, the steeper the location. Greater values means flatter locations. Values can range from 0-1, with 0 being sideways, and 1 being perfectly flat. For reference: SurfaceNormal of about 0.7 is when you are forced to walk up a surface.
|
||||
DMS_TerritoryNearBlacklist = 100; // Missions won't spawn in a position this many meters close to a territory flag
|
||||
DMS_MinSurfaceNormal = 0.9; // Missions won't spawn in a position where its surfaceNormal is less than this amount. The lower the value, the steeper the location. Greater values means flatter locations. Values can range from 0-1, with 0 being sideways, and 1 being perfectly flat. For reference: SurfaceNormal of about 0.7 is when you are forced to walk up a surface. If you want to convert surfaceNormal to degrees, use the arc-cosine of the surfaceNormal. 0.9 is about 25 degrees. Google "(arccos 0.9) in degrees"
|
||||
/*Mission spawn location settings*/
|
||||
|
||||
DMS_MinWaterDepth = 20; // Minimum depth of water that an underwater mission can spawn at.
|
||||
@ -135,23 +138,23 @@ DMS_Use_Map_Config = true; // Whether or not to use config overwrites specific t
|
||||
/*Mission notification settings*/
|
||||
|
||||
DMS_BanditMissionTypes = [ // List of missions with spawn chances. If they add up to 100%, they represent the percentage chance each one will spawn
|
||||
["blackhawkdown",45],
|
||||
["construction",35],
|
||||
["donthasslethehoff",30],
|
||||
["bandits",25],
|
||||
["bauhaus",25],
|
||||
["cardealer",25],
|
||||
["humanitarian",25],
|
||||
["foodtransport",25],
|
||||
["walmart",20],
|
||||
["mercenaries",20],
|
||||
["guntransport",20],
|
||||
["beertransport",15],
|
||||
["roguenavyseals",15],
|
||||
["thieves",10],
|
||||
["lost_battalion",10],
|
||||
["behindenemylines",10],
|
||||
["mercbase",5]
|
||||
["blackhawkdown",7],
|
||||
["donthasslethehoff",6],
|
||||
["bandits",5],
|
||||
["bauhaus",5],
|
||||
["cardealer",5],
|
||||
["humanitarian",5],
|
||||
["foodtransport",5],
|
||||
["construction",4],
|
||||
["walmart",4],
|
||||
["mercenaries",4],
|
||||
["guntransport",4],
|
||||
["beertransport",3],
|
||||
["roguenavyseals",3],
|
||||
["thieves",2],
|
||||
["lost_battalion",2],
|
||||
["behindenemylines",2],
|
||||
["mercbase",1]
|
||||
];
|
||||
|
||||
DMS_findSafePosBlacklist = [ // For BIS_fnc_findSafePos position blacklist info refer to: https://community.bistudio.com/wiki/BIS_fnc_findSafePos
|
||||
@ -495,7 +498,8 @@ DMS_Use_Map_Config = true; // Whether or not to use config overwrites specific t
|
||||
];
|
||||
|
||||
DMS_ai_use_launchers = true; // Enable/disable spawning an AI in a group with a launcher
|
||||
DMS_ai_use_launchers_chance = 50; // Percentage chance to actually spawn the launcher (per-group)
|
||||
DMS_ai_launchers_per_group = 2; // How many units per AI group can get a launcher.
|
||||
DMS_ai_use_launchers_chance = 50; // Percentage chance to actually spawn the launcher (per-unit). With "DMS_ai_launchers_per_group" set to 2, and "DMS_ai_use_launchers_chance" set to 50, there will be an average of 1 launcher per group.
|
||||
DMS_AI_launcher_ammo_count = 2; // How many rockets an AI will get with its launcher
|
||||
DMS_ai_remove_launchers = true; // Remove rocket launchers on AI death
|
||||
|
||||
|
@ -63,3 +63,41 @@ if (DMS_DynamicMission) then
|
||||
call compileFinal preprocessFileLineNumbers "\x\addons\dms\missions\mission_init.sqf";
|
||||
execFSM "\x\addons\dms\FSM\missions.fsm";
|
||||
};
|
||||
|
||||
|
||||
if (DMS_ShowDifficultyColorLegend) then
|
||||
{
|
||||
private "_title";
|
||||
_title = createmarker ["DMS_MissionMarker_DifficultyColorLegend",[-500,-200]];
|
||||
_title setMarkerColor "ColorRed";
|
||||
_title setmarkertext "DMS Mission Difficulties Color Legend";
|
||||
_title setMarkerType "mil_dot";
|
||||
_title setMarkerAlpha 0.5;
|
||||
{
|
||||
private ["_difficulty", "_color", "_num", "_pos", "_circle", "_dot"];
|
||||
|
||||
_difficulty = _x;
|
||||
switch (_difficulty) do
|
||||
{
|
||||
case "easy": {_color = "ColorGreen";};
|
||||
case "moderate": {_color = "ColorYellow";};
|
||||
case "difficult": {_color = "ColorRed";};
|
||||
case "hardcore" : {_color = "ColorBlack";};
|
||||
};
|
||||
|
||||
_num = -200 * (_forEachIndex - 0.5);
|
||||
_pos = [100,_num];
|
||||
|
||||
_circle = createMarker [format ["DMS_MissionMarker_DifficultyColor_%1",_color], _pos];
|
||||
_circle setMarkerColor _color;
|
||||
_circle setMarkerShape "ELLIPSE";
|
||||
_circle setMarkerBrush "Solid";
|
||||
_circle setMarkerSize [100,100];
|
||||
|
||||
_dot = createMarker [format ["DMS_MissionMarker_Difficulty_%1",_difficulty],_pos];
|
||||
_dot setMarkerColor "ColorWhite";
|
||||
_dot setMarkerType "mil_dot";
|
||||
_dot setMarkerAlpha 0.5;
|
||||
_dot setMarkerText _difficulty;
|
||||
} forEach ["hardcore","difficult","moderate","easy"];
|
||||
};
|
@ -18,6 +18,42 @@ if (DMS_Use_Map_Config) then
|
||||
|
||||
|
||||
|
||||
// Some custom maps don't have the proper safePos config entries.
|
||||
// If you are using one and you have an issue with mission spawns, please create an issue on GitHub or post a comment in the DMS thread.
|
||||
switch (toLower worldName) do
|
||||
{
|
||||
case "altis": // [16000,16000] w/ radius of 16000 works well for Altis
|
||||
{
|
||||
DMS_MapCenterPos = [16000,16000];
|
||||
DMS_MapRadius = 16000;
|
||||
};
|
||||
case "bornholm": // Thanks to thirdhero for testing this info
|
||||
{
|
||||
DMS_MapCenterPos = [11265,11265];
|
||||
DMS_MapRadius = 12000;
|
||||
};
|
||||
case "esseker": // Thanks to Flowrider for this info
|
||||
{
|
||||
DMS_MapCenterPos = [6275,6350];
|
||||
DMS_MapRadius = 5000;
|
||||
};
|
||||
case "tavi": // Thanks to JamieKG for this info
|
||||
{
|
||||
DMS_MapCenterPos = [12800,12800];
|
||||
DMS_MapRadius = 12800;
|
||||
};
|
||||
default // Use "worldSize" to determine map center/radius (not always very nice).
|
||||
{
|
||||
private "_middle";
|
||||
_middle = worldSize/2;
|
||||
DMS_MapCenterPos = [_middle,_middle];
|
||||
DMS_MapRadius = _middle;
|
||||
};
|
||||
};
|
||||
|
||||
// Since we use primarily ATL
|
||||
DMS_MapCenterPos set [2,0];
|
||||
|
||||
/*
|
||||
Original Functions from
|
||||
http://maca134.co.uk/portfolio/m3editor-arma-3-map-editor/
|
||||
@ -94,4 +130,7 @@ DMS_fnc_setRelPositions =
|
||||
_x setPosATL _objPos;
|
||||
//diag_log format ["Setting %1 at %2; %3 is the relpos from original center %4, reapplied to new center %5",typeOf _x,_objPos,_relpos,_center,_newCPos];
|
||||
} foreach _objects;
|
||||
};
|
||||
};
|
||||
|
||||
// Because I fucked up the name on first implementation and don't want to mess anybody up who didn't realize to change every occurence of "DMS_MaxSurfaceNormal" to "DMS_MinSurfaceNormal".
|
||||
DMS_MaxSurfaceNormal = DMS_MinSurfaceNormal;
|
@ -17,4 +17,6 @@ DMS_SpawnZoneNearBlacklist = 2500;
|
||||
DMS_TraderZoneNearBlacklist = 2500;
|
||||
DMS_MissionNearBlacklist = 2500;
|
||||
DMS_WaterNearBlacklist = 500;
|
||||
DMS_MaxSurfaceNormal = 0.95;
|
||||
|
||||
// Altis is pretty flat, so we can make the min surfaceNormal ... stricter? more strict? Who cares, you get the idea.
|
||||
DMS_MinSurfaceNormal = 0.95;
|
@ -17,4 +17,6 @@ DMS_SpawnZoneNearBlacklist = 2500;
|
||||
DMS_TraderZoneNearBlacklist = 2500;
|
||||
DMS_MissionNearBlacklist = 2500;
|
||||
DMS_WaterNearBlacklist = 500;
|
||||
DMS_MaxSurfaceNormal = 0.95;
|
||||
|
||||
// Bornholm seems to be fine with a greater minimum surfaceNormal.
|
||||
DMS_MinSurfaceNormal = 0.95;
|
@ -17,7 +17,4 @@ DMS_PlayerNearBlacklist = 750;
|
||||
DMS_SpawnZoneNearBlacklist = 1250;
|
||||
DMS_TraderZoneNearBlacklist = 1250;
|
||||
DMS_MissionNearBlacklist = 1250;
|
||||
DMS_WaterNearBlacklist = 250;
|
||||
|
||||
// Esseker is a hilly map, so reduced surfaceNormal so all the missions don't spawn in the south.
|
||||
DMS_MaxSurfaceNormal = 0.9;
|
||||
DMS_WaterNearBlacklist = 250;
|
18
@ExileServer/addons/a3_dms/map_configs/panthera3_config.sqf
Normal file
18
@ExileServer/addons/a3_dms/map_configs/panthera3_config.sqf
Normal file
@ -0,0 +1,18 @@
|
||||
/*
|
||||
Custom configs for Panthera3 (Panthera).
|
||||
Sample by eraser1
|
||||
|
||||
All of these configs exist in the main config. The configs below will simply override any config from the main config.
|
||||
Explanations to all of these configs also exist in the main config.
|
||||
*/
|
||||
|
||||
DMS_findSafePosBlacklist =
|
||||
[
|
||||
//Insert position blacklists here.
|
||||
];
|
||||
|
||||
// Let missions spawn closer to water, since we aren't spoiled for choice with all of the steep terrain.
|
||||
DMS_WaterNearBlacklist = 200;
|
||||
|
||||
// Panthera is super hilly/mountain-y, so we allow a tolerance of up to a 30 degree slope.
|
||||
DMS_MinSurfaceNormal = 0.85;
|
@ -16,8 +16,4 @@ DMS_PlayerNearBlacklist = 2000;
|
||||
DMS_SpawnZoneNearBlacklist = 2500;
|
||||
DMS_TraderZoneNearBlacklist = 2500;
|
||||
DMS_MissionNearBlacklist = 2500;
|
||||
DMS_WaterNearBlacklist = 500;
|
||||
|
||||
|
||||
// Taviana is a pretty hilly/mountainous map, so we should be a little more lenient for surfaceNormal on it
|
||||
DMS_MaxSurfaceNormal = 0.9;
|
||||
DMS_WaterNearBlacklist = 500;
|
@ -1,8 +1,8 @@
|
||||
/*
|
||||
Sample mission (duplicate for testing purposes)
|
||||
Sample mission
|
||||
*/
|
||||
|
||||
private ["_num", "_side", "_pos", "_difficulty", "_AICount", "_group", "_crate", "_crate_loot_values", "_msgStart", "_msgWIN", "_msgLOSE", "_missionName", "_missionAIUnits", "_missionObjs", "_markers", "_time", "_added","_vehicle"];
|
||||
private ["_num", "_side", "_classname", "_OK", "_pos", "_difficulty", "_AICount", "_group", "_type", "_launcher", "_crate", "_vehClass", "_extraParams", "_vehicle", "_crate_loot_values", "_missionAIUnits", "_missionObjs", "_msgStart", "_msgWIN", "_msgLOSE", "_missionName", "_markers", "_time", "_added", "_cleanup"];
|
||||
|
||||
// For logging purposes
|
||||
_num = DMS_MissionCount;
|
||||
@ -12,11 +12,32 @@ _num = DMS_MissionCount;
|
||||
_side = "bandit";
|
||||
|
||||
|
||||
// find position
|
||||
_pos =
|
||||
// This part is unnecessary, but exists just as an example to format the parameters for "DMS_fnc_MissionParams" if you want to explicitly define the calling parameters for DMS_fnc_FindSafePos.
|
||||
// It also allows anybody to modify the default calling parameters easily.
|
||||
if ((isNil "_this") || {_this isEqualTo [] || {(typeName _this)!="ARRAY"}}) then
|
||||
{
|
||||
_this =
|
||||
[
|
||||
[25,DMS_WaterNearBlacklist,DMS_MinSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_TerritoryNearBlacklist,DMS_ThrottleBlacklists],
|
||||
[
|
||||
[]
|
||||
],
|
||||
_this
|
||||
];
|
||||
};
|
||||
|
||||
// Check calling parameters for manually defined mission position.
|
||||
// You can define "_extraParams" to specify the vehicle classname to spawn, either as _classname or [_classname]
|
||||
_OK = (_this call DMS_fnc_MissionParams) params
|
||||
[
|
||||
25,DMS_WaterNearBlacklist,DMS_MaxSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_ThrottleBlacklists
|
||||
]call DMS_fnc_findSafePos;
|
||||
["_pos","_pos ERROR",[[]],[3]],
|
||||
["_extraParams",[]]
|
||||
];
|
||||
|
||||
if !(_OK) exitWith
|
||||
{
|
||||
diag_log format ["DMS ERROR :: Called MISSION bandits.sqf with invalid parameters: %1",_this];
|
||||
};
|
||||
|
||||
|
||||
// Set general mission difficulty
|
||||
@ -24,7 +45,6 @@ _difficulty = "moderate";
|
||||
|
||||
|
||||
// Create AI
|
||||
// TODO: Spawn AI only when players are nearby
|
||||
_AICount = 4 + (round (random 2));
|
||||
|
||||
_group =
|
||||
@ -39,7 +59,33 @@ _group =
|
||||
|
||||
// Create Crate
|
||||
_crate = ["Box_NATO_Wps_F",_pos] call DMS_fnc_SpawnCrate;
|
||||
_vehicle = ["Exile_Car_Offroad_Armed_Guerilla01",[_pos,3+(random 5),random 360] call DMS_fnc_SelectOffsetPos] call DMS_fnc_SpawnNonPersistentVehicle;
|
||||
|
||||
// Check to see if a special vehicle class is defined in "_extraParams", and make sure it's valid, otherwise use the default (Offroad Armed)
|
||||
_vehClass =
|
||||
if (_extraParams isEqualTo []) then
|
||||
{
|
||||
"Exile_Car_Offroad_Armed_Guerilla01"
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((typeName _extraParams)=="STRING") then
|
||||
{
|
||||
_extraParams
|
||||
}
|
||||
else
|
||||
{
|
||||
if (((typeName _extraParams)=="ARRAY") && {(typeName (_extraParams select 0))=="STRING"}) then
|
||||
{
|
||||
_extraParams select 0
|
||||
}
|
||||
else
|
||||
{
|
||||
"Exile_Car_Offroad_Armed_Guerilla01"
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
_vehicle = [_vehClass,[_pos,3+(random 5),random 360] call DMS_fnc_SelectOffsetPos] call DMS_fnc_SpawnNonPersistentVehicle;
|
||||
|
||||
// Set crate loot values
|
||||
_crate_loot_values =
|
||||
@ -148,4 +194,7 @@ if !(_added) exitWith
|
||||
|
||||
|
||||
|
||||
(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog;
|
||||
};
|
@ -5,7 +5,7 @@
|
||||
Called from DMS_selectMission
|
||||
*/
|
||||
|
||||
private ["_num", "_side", "_pos", "_difficulty", "_AICount", "_group", "_crate1", "_crate_loot_values1", "_crate2", "_crate_loot_values2", "_msgStart", "_msgWIN", "_msgLOSE", "_missionName", "_missionAIUnits", "_missionObjs", "_markers", "_time", "_added","_wreck"];
|
||||
private ["_num", "_side", "_pos", "_OK", "_difficulty", "_AICount", "_group", "_type", "_launcher", "_crate1", "_crate2", "_wreck", "_crate_loot_values1", "_crate_loot_values2", "_missionAIUnits", "_missionObjs", "_msgStart", "_msgWIN", "_msgLOSE", "_missionName", "_markers", "_time", "_added", "_cleanup"];
|
||||
|
||||
// For logging purposes
|
||||
_num = DMS_MissionCount;
|
||||
@ -14,12 +14,32 @@ _num = DMS_MissionCount;
|
||||
// Set mission side (only "bandit" is supported for now)
|
||||
_side = "bandit";
|
||||
|
||||
// This part is unnecessary, but exists just as an example to format the parameters for "DMS_fnc_MissionParams" if you want to explicitly define the calling parameters for DMS_fnc_FindSafePos.
|
||||
// It also allows anybody to modify the default calling parameters easily.
|
||||
if ((isNil "_this") || {_this isEqualTo [] || {(typeName _this)!="ARRAY"}}) then
|
||||
{
|
||||
_this =
|
||||
[
|
||||
[10,DMS_WaterNearBlacklist,DMS_MinSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_TerritoryNearBlacklist,DMS_ThrottleBlacklists],
|
||||
[
|
||||
[]
|
||||
],
|
||||
_this
|
||||
];
|
||||
};
|
||||
|
||||
// find position
|
||||
_pos =
|
||||
// Check calling parameters for manually defined mission position.
|
||||
// This mission doesn't use "_extraParams" in any way currently.
|
||||
_OK = (_this call DMS_fnc_MissionParams) params
|
||||
[
|
||||
10,DMS_WaterNearBlacklist,DMS_MaxSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_ThrottleBlacklists
|
||||
]call DMS_fnc_findSafePos;
|
||||
["_pos",[],[[]],[3]],
|
||||
["_extraParams",[]]
|
||||
];
|
||||
|
||||
if !(_OK) exitWith
|
||||
{
|
||||
diag_log format ["DMS ERROR :: Called MISSION bauhaus.sqf with invalid parameters: %1",_this];
|
||||
};
|
||||
|
||||
|
||||
// Set general mission difficulty
|
||||
@ -27,7 +47,6 @@ _difficulty = "difficult";
|
||||
|
||||
|
||||
// Create AI
|
||||
// TODO: Spawn AI only when players are nearby
|
||||
_AICount = 6 + (round (random 2));
|
||||
|
||||
_group =
|
||||
@ -159,4 +178,7 @@ if !(_added) exitWith
|
||||
|
||||
|
||||
|
||||
(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog;
|
||||
};
|
@ -5,7 +5,7 @@
|
||||
Called from DMS_selectMission
|
||||
*/
|
||||
|
||||
private ["_num", "_side", "_pos", "_difficulty", "_AICount", "_group", "_crate1", "_crate_loot_values1", "_crate2", "_crate_loot_values2", "_msgStart", "_msgWIN", "_msgLOSE", "_missionName", "_missionAIUnits", "_missionObjs", "_markers", "_time", "_added","_wreck"];
|
||||
private ["_num", "_group", "_pos", "_side", "_OK", "_difficulty", "_AICount", "_type", "_launcher", "_crate1", "_wreck", "_crate_loot_values1", "_missionAIUnits", "_missionObjs", "_msgStart", "_msgWIN", "_msgLOSE", "_missionName", "_markers", "_time", "_added", "_cleanup"];
|
||||
|
||||
// For logging purposes
|
||||
_num = DMS_MissionCount;
|
||||
@ -14,12 +14,32 @@ _num = DMS_MissionCount;
|
||||
// Set mission side (only "bandit" is supported for now)
|
||||
_side = "bandit";
|
||||
|
||||
// This part is unnecessary, but exists just as an example to format the parameters for "DMS_fnc_MissionParams" if you want to explicitly define the calling parameters for DMS_fnc_FindSafePos.
|
||||
// It also allows anybody to modify the default calling parameters easily.
|
||||
if ((isNil "_this") || {_this isEqualTo [] || {(typeName _this)!="ARRAY"}}) then
|
||||
{
|
||||
_this =
|
||||
[
|
||||
[10,DMS_WaterNearBlacklist,DMS_MinSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_TerritoryNearBlacklist,DMS_ThrottleBlacklists],
|
||||
[
|
||||
[]
|
||||
],
|
||||
_this
|
||||
];
|
||||
};
|
||||
|
||||
// find position
|
||||
_pos =
|
||||
// Check calling parameters for manually defined mission position.
|
||||
// This mission doesn't use "_extraParams" in any way currently.
|
||||
_OK = (_this call DMS_fnc_MissionParams) params
|
||||
[
|
||||
10,DMS_WaterNearBlacklist,DMS_MaxSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_ThrottleBlacklists
|
||||
]call DMS_fnc_findSafePos;
|
||||
["_pos",[],[[]],[3]],
|
||||
["_extraParams",[]]
|
||||
];
|
||||
|
||||
if !(_OK) exitWith
|
||||
{
|
||||
diag_log format ["DMS ERROR :: Called MISSION beertransport.sqf with invalid parameters: %1",_this];
|
||||
};
|
||||
|
||||
|
||||
// Set general mission difficulty
|
||||
@ -27,7 +47,6 @@ _difficulty = "easy";
|
||||
|
||||
|
||||
// Create AI
|
||||
// TODO: Spawn AI only when players are nearby
|
||||
_AICount = 3 + (round (random 2));
|
||||
|
||||
_group =
|
||||
@ -152,4 +171,7 @@ if !(_added) exitWith
|
||||
|
||||
|
||||
|
||||
(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog;
|
||||
};
|
@ -5,7 +5,7 @@
|
||||
Called from DMS_selectMission
|
||||
*/
|
||||
|
||||
private ["_num", "_side", "_pos", "_difficulty", "_AICount", "_group", "_crate1", "_crate_loot_values1", "_crate2", "_crate_loot_values2", "_msgStart", "_msgWIN", "_msgLOSE", "_missionName", "_missionAIUnits", "_missionObjs", "_markers", "_time", "_added","_wreck"];
|
||||
private ["_num", "_group", "_pos", "_side", "_OK", "_difficulty", "_AICount", "_type", "_launcher", "_crate1", "_wreck", "_crate_loot_values1", "_missionAIUnits", "_missionObjs", "_msgStart", "_msgWIN", "_msgLOSE", "_missionName", "_markers", "_time", "_added", "_cleanup"];
|
||||
|
||||
// For logging purposes
|
||||
_num = DMS_MissionCount;
|
||||
@ -15,11 +15,32 @@ _num = DMS_MissionCount;
|
||||
_side = "bandit";
|
||||
|
||||
|
||||
// find position
|
||||
_pos =
|
||||
// This part is unnecessary, but exists just as an example to format the parameters for "DMS_fnc_MissionParams" if you want to explicitly define the calling parameters for DMS_fnc_FindSafePos.
|
||||
// It also allows anybody to modify the default calling parameters easily.
|
||||
if ((isNil "_this") || {_this isEqualTo [] || {(typeName _this)!="ARRAY"}}) then
|
||||
{
|
||||
_this =
|
||||
[
|
||||
[10,DMS_WaterNearBlacklist,DMS_MinSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_TerritoryNearBlacklist,DMS_ThrottleBlacklists],
|
||||
[
|
||||
[]
|
||||
],
|
||||
_this
|
||||
];
|
||||
};
|
||||
|
||||
// Check calling parameters for manually defined mission position.
|
||||
// This mission doesn't use "_extraParams" in any way currently.
|
||||
_OK = (_this call DMS_fnc_MissionParams) params
|
||||
[
|
||||
10,DMS_WaterNearBlacklist,DMS_MaxSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_ThrottleBlacklists
|
||||
]call DMS_fnc_findSafePos;
|
||||
["_pos",[],[[]],[3]],
|
||||
["_extraParams",[]]
|
||||
];
|
||||
|
||||
if !(_OK) exitWith
|
||||
{
|
||||
diag_log format ["DMS ERROR :: Called MISSION behindenemylines.sqf with invalid parameters: %1",_this];
|
||||
};
|
||||
|
||||
|
||||
// Set general mission difficulty
|
||||
@ -27,7 +48,6 @@ _difficulty = "easy";
|
||||
|
||||
|
||||
// Create AI
|
||||
// TODO: Spawn AI only when players are nearby
|
||||
_AICount = 2 + (round (random 2));
|
||||
|
||||
_group =
|
||||
@ -152,4 +172,7 @@ if !(_added) exitWith
|
||||
|
||||
|
||||
|
||||
(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog;
|
||||
};
|
@ -5,7 +5,7 @@
|
||||
Called from DMS_selectMission
|
||||
*/
|
||||
|
||||
private ["_num", "_side", "_pos", "_difficulty", "_AICount", "_group", "_crate1", "_crate_loot_values1", "_crate2", "_crate_loot_values2", "_msgStart", "_msgWIN", "_msgLOSE", "_missionName", "_missionAIUnits", "_missionObjs", "_markers", "_time", "_added","_wreck"];
|
||||
private ["_num", "_group", "_pos", "_side", "_OK", "_difficulty", "_AICount", "_type", "_launcher", "_crate1", "_wreck", "_crate_loot_values1", "_missionAIUnits", "_missionObjs", "_msgStart", "_msgWIN", "_msgLOSE", "_missionName", "_markers", "_time", "_added", "_cleanup"];
|
||||
|
||||
// For logging purposes
|
||||
_num = DMS_MissionCount;
|
||||
@ -15,11 +15,32 @@ _num = DMS_MissionCount;
|
||||
_side = "bandit";
|
||||
|
||||
|
||||
// find position
|
||||
_pos =
|
||||
// This part is unnecessary, but exists just as an example to format the parameters for "DMS_fnc_MissionParams" if you want to explicitly define the calling parameters for DMS_fnc_FindSafePos.
|
||||
// It also allows anybody to modify the default calling parameters easily.
|
||||
if ((isNil "_this") || {_this isEqualTo [] || {(typeName _this)!="ARRAY"}}) then
|
||||
{
|
||||
_this =
|
||||
[
|
||||
[10,DMS_WaterNearBlacklist,DMS_MinSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_TerritoryNearBlacklist,DMS_ThrottleBlacklists],
|
||||
[
|
||||
[]
|
||||
],
|
||||
_this
|
||||
];
|
||||
};
|
||||
|
||||
// Check calling parameters for manually defined mission position.
|
||||
// This mission doesn't use "_extraParams" in any way currently.
|
||||
_OK = (_this call DMS_fnc_MissionParams) params
|
||||
[
|
||||
10,DMS_WaterNearBlacklist,DMS_MaxSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_ThrottleBlacklists
|
||||
]call DMS_fnc_findSafePos;
|
||||
["_pos",[],[[]],[3]],
|
||||
["_extraParams",[]]
|
||||
];
|
||||
|
||||
if !(_OK) exitWith
|
||||
{
|
||||
diag_log format ["DMS ERROR :: Called MISSION blackhawkdown.sqf with invalid parameters: %1",_this];
|
||||
};
|
||||
|
||||
|
||||
// Set general mission difficulty
|
||||
@ -27,7 +48,6 @@ _difficulty = "difficult";
|
||||
|
||||
|
||||
// Create AI
|
||||
// TODO: Spawn AI only when players are nearby
|
||||
_AICount = 6 + (round (random 2));
|
||||
|
||||
_group =
|
||||
@ -152,4 +172,7 @@ if !(_added) exitWith
|
||||
|
||||
|
||||
|
||||
(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog;
|
||||
};
|
@ -5,7 +5,7 @@
|
||||
Called from DMS_selectMission
|
||||
*/
|
||||
|
||||
private ["_num", "_side", "_pos", "_difficulty", "_AICount", "_group", "_crate1", "_crate_loot_values1", "_crate2", "_crate_loot_values2", "_msgStart", "_msgWIN", "_msgLOSE", "_missionName", "_missionAIUnits", "_missionObjs", "_markers", "_time", "_added","_vehicle1","_vehicle2","_wreck"];
|
||||
private ["_num", "_group", "_pos", "_side", "_extraParams", "_OK", "_difficulty", "_AICount", "_type", "_launcher", "_crate1", "_rndDir", "_wreck", "_vehClass1", "_vehicle1", "_vehClass2", "_vehicle2", "_crate_loot_values1", "_missionAIUnits", "_missionObjs", "_msgStart", "_msgWIN", "_msgLOSE", "_missionName", "_markers", "_time", "_added", "_cleanup"];
|
||||
|
||||
// For logging purposes
|
||||
_num = DMS_MissionCount;
|
||||
@ -15,11 +15,32 @@ _num = DMS_MissionCount;
|
||||
_side = "bandit";
|
||||
|
||||
|
||||
// find position
|
||||
_pos =
|
||||
// This part is unnecessary, but exists just as an example to format the parameters for "DMS_fnc_MissionParams" if you want to explicitly define the calling parameters for DMS_fnc_FindSafePos.
|
||||
// It also allows anybody to modify the default calling parameters easily.
|
||||
if ((isNil "_this") || {_this isEqualTo [] || {(typeName _this)!="ARRAY"}}) then
|
||||
{
|
||||
_this =
|
||||
[
|
||||
[10,DMS_WaterNearBlacklist,DMS_MinSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_TerritoryNearBlacklist,DMS_ThrottleBlacklists],
|
||||
[
|
||||
[]
|
||||
],
|
||||
_this
|
||||
];
|
||||
};
|
||||
|
||||
// Check calling parameters for manually defined mission position.
|
||||
// You can use _extraParams to define which vehicles to spawn. _vehClass1, [_vehClass1], or [_vehClass1,_vehClass2]
|
||||
_OK = (_this call DMS_fnc_MissionParams) params
|
||||
[
|
||||
10,DMS_WaterNearBlacklist,DMS_MaxSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_ThrottleBlacklists
|
||||
]call DMS_fnc_findSafePos;
|
||||
["_pos",[],[[]],[3]],
|
||||
["_extraParams",[]]
|
||||
];
|
||||
|
||||
if !(_OK) exitWith
|
||||
{
|
||||
diag_log format ["DMS ERROR :: Called MISSION cardealer.sqf with invalid parameters: %1",_this];
|
||||
};
|
||||
|
||||
|
||||
// Set general mission difficulty
|
||||
@ -27,7 +48,6 @@ _difficulty = "easy";
|
||||
|
||||
|
||||
// Create AI
|
||||
// TODO: Spawn AI only when players are nearby
|
||||
_AICount = 3 + (round (random 2));
|
||||
|
||||
_group =
|
||||
@ -48,10 +68,33 @@ _rndDir = random 180;
|
||||
_wreck = createVehicle ["Land_FuelStation_Build_F",[_pos,10+(random 5),_rndDir+90] call DMS_fnc_SelectOffsetPos,[], 0, "CAN_COLLIDE"];
|
||||
|
||||
|
||||
_vehicle1 = ["Exile_Car_SUV_Red", [_pos,5+(random 3),_rndDir] call DMS_fnc_SelectOffsetPos] call DMS_fnc_SpawnNonPersistentVehicle;
|
||||
_vehClass1 = "Exile_Car_SUV_Red";
|
||||
_vehClass2 = "Exile_Car_SUV_Grey";
|
||||
|
||||
if !(_extraParams isEqualTo []) then
|
||||
{
|
||||
if ((typeName _extraParams)=="STRING") then
|
||||
{
|
||||
_vehClass1 = _extraParams;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (((typeName _extraParams)=="ARRAY") && {(typeName (_extraParams select 0))=="STRING"}) then
|
||||
{
|
||||
_vehClass1 = _extraParams select 0;
|
||||
|
||||
if (((count _extraParams)>1) && {(typeName (_extraParams select 1))=="STRING"}) then
|
||||
{
|
||||
_vehClass2 = _extraParams select 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
_vehicle1 = [_vehClass1, [_pos,5+(random 3),_rndDir] call DMS_fnc_SelectOffsetPos] call DMS_fnc_SpawnNonPersistentVehicle;
|
||||
//_vehicle1 setPosATL ([_pos,5+(random 3),_rndDir] call DMS_fnc_SelectOffsetPos);
|
||||
|
||||
_vehicle2 = ["Exile_Car_SUV_Grey", [_pos,5+(random 3),_rndDir+180] call DMS_fnc_SelectOffsetPos] call DMS_fnc_SpawnNonPersistentVehicle;
|
||||
|
||||
_vehicle2 = [_vehClass2, [_pos,5+(random 3),_rndDir+180] call DMS_fnc_SelectOffsetPos] call DMS_fnc_SpawnNonPersistentVehicle;
|
||||
//_vehicle2 setPosATL ([_pos,5+(random 3),_rndDir+180] call DMS_fnc_SelectOffsetPos);
|
||||
|
||||
|
||||
@ -163,4 +206,7 @@ if !(_added) exitWith
|
||||
|
||||
|
||||
|
||||
(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog;
|
||||
};
|
@ -1,8 +1,8 @@
|
||||
/*
|
||||
Sample mission (duplicate for testing purposes)
|
||||
Sample mission
|
||||
*/
|
||||
|
||||
private ["_num", "_side", "_pos", "_difficulty", "_AICount", "_group", "_crate", "_crate_loot_values", "_msgStart", "_msgWIN", "_msgLOSE", "_missionName", "_missionAIUnits", "_missionObjs", "_markers", "_time", "_added","_wreck1","_wreck2","_wreck3","_vehicle"];
|
||||
private ["_num", "_group", "_pos", "_side", "_OK", "_difficulty", "_AICount", "_type", "_launcher", "_crate", "_wreck1", "_wreck2", "_wreck3", "_vehClass", "_vehicle", "_crate_loot_values", "_missionAIUnits", "_missionObjs", "_msgStart", "_msgWIN", "_msgLOSE", "_missionName", "_markers", "_time", "_added", "_cleanup"];
|
||||
|
||||
// For logging purposes
|
||||
_num = DMS_MissionCount;
|
||||
@ -12,11 +12,32 @@ _num = DMS_MissionCount;
|
||||
_side = "bandit";
|
||||
|
||||
|
||||
// find position
|
||||
_pos =
|
||||
// This part is unnecessary, but exists just as an example to format the parameters for "DMS_fnc_MissionParams" if you want to explicitly define the calling parameters for DMS_fnc_FindSafePos.
|
||||
// It also allows anybody to modify the default calling parameters easily.
|
||||
if ((isNil "_this") || {_this isEqualTo [] || {(typeName _this)!="ARRAY"}}) then
|
||||
{
|
||||
_this =
|
||||
[
|
||||
[25,DMS_WaterNearBlacklist,DMS_MinSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_TerritoryNearBlacklist,DMS_ThrottleBlacklists],
|
||||
[
|
||||
[]
|
||||
],
|
||||
_this
|
||||
];
|
||||
};
|
||||
|
||||
// Check calling parameters for manually defined mission position.
|
||||
// You can define "_extraParams" to specify the vehicle classname to spawn, either as _classname or [_classname]
|
||||
_OK = (_this call DMS_fnc_MissionParams) params
|
||||
[
|
||||
25,DMS_WaterNearBlacklist,DMS_MaxSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_ThrottleBlacklists
|
||||
]call DMS_fnc_findSafePos;
|
||||
["_pos",[],[[]],[3]],
|
||||
["_extraParams",[]]
|
||||
];
|
||||
|
||||
if !(_OK) exitWith
|
||||
{
|
||||
diag_log format ["DMS ERROR :: Called MISSION construction.sqf with invalid parameters: %1",_this];
|
||||
};
|
||||
|
||||
|
||||
// Set general mission difficulty
|
||||
@ -24,7 +45,6 @@ _difficulty = "hardcore";
|
||||
|
||||
|
||||
// Create AI
|
||||
// TODO: Spawn AI only when players are nearby
|
||||
_AICount = 5 + (round (random 2));
|
||||
|
||||
_group =
|
||||
@ -44,7 +64,32 @@ _wreck1 = createVehicle ["Land_CinderBlocks_F",[(_pos select 0) - 10, (_pos sele
|
||||
_wreck2 = createVehicle ["Land_Bricks_V1_F",[(_pos select 0) - 5, (_pos select 1),-3.3],[], 0, "CAN_COLLIDE"];
|
||||
_wreck3 = createVehicle ["Land_Bricks_V1_F",[(_pos select 0) - 13, (_pos select 1),-1],[], 0, "CAN_COLLIDE"];
|
||||
|
||||
_vehicle = ["Exile_Car_Zamak",_pos] call DMS_fnc_SpawnNonPersistentVehicle;
|
||||
// Check to see if a special vehicle class is defined in "_extraParams", and make sure it's valid, otherwise use the default (Offroad Armed)
|
||||
_vehClass =
|
||||
if (_extraParams isEqualTo []) then
|
||||
{
|
||||
"Exile_Car_Zamak"
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((typeName _extraParams)=="STRING") then
|
||||
{
|
||||
_extraParams
|
||||
}
|
||||
else
|
||||
{
|
||||
if (((typeName _extraParams)=="ARRAY") && {(typeName (_extraParams select 0))=="STRING"}) then
|
||||
{
|
||||
_extraParams select 0
|
||||
}
|
||||
else
|
||||
{
|
||||
"Exile_Car_Zamak"
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
_vehicle = [_vehClass,_pos] call DMS_fnc_SpawnNonPersistentVehicle;
|
||||
|
||||
|
||||
// Set crate loot values
|
||||
@ -155,4 +200,7 @@ if !(_added) exitWith
|
||||
|
||||
|
||||
|
||||
(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog;
|
||||
};
|
@ -5,7 +5,7 @@
|
||||
Called from DMS_selectMission
|
||||
*/
|
||||
|
||||
private ["_num", "_side", "_pos", "_difficulty", "_AICount", "_group", "_crate1", "_crate_loot_values1", "_crate2", "_crate_loot_values2", "_msgStart", "_msgWIN", "_msgLOSE", "_missionName", "_missionAIUnits", "_missionObjs", "_markers", "_time", "_added","_wreck","_vehicle"];
|
||||
private ["_num", "_side", "_pos", "_OK", "_difficulty", "_AICount", "_group", "_type", "_launcher", "_staticGuns", "_crate1", "_wreck", "_vehClass", "_vehicle", "_crate_loot_values1", "_missionAIUnits", "_missionObjs", "_msgStart", "_msgWIN", "_msgLOSE", "_missionName", "_markers", "_time", "_added", "_cleanup"];
|
||||
|
||||
// For logging purposes
|
||||
_num = DMS_MissionCount;
|
||||
@ -15,11 +15,32 @@ _num = DMS_MissionCount;
|
||||
_side = "bandit";
|
||||
|
||||
|
||||
// find position
|
||||
_pos =
|
||||
// This part is unnecessary, but exists just as an example to format the parameters for "DMS_fnc_MissionParams" if you want to explicitly define the calling parameters for DMS_fnc_FindSafePos.
|
||||
// It also allows anybody to modify the default calling parameters easily.
|
||||
if ((isNil "_this") || {_this isEqualTo [] || {(typeName _this)!="ARRAY"}}) then
|
||||
{
|
||||
_this =
|
||||
[
|
||||
[10,DMS_WaterNearBlacklist,DMS_MinSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_TerritoryNearBlacklist,DMS_ThrottleBlacklists],
|
||||
[
|
||||
[]
|
||||
],
|
||||
_this
|
||||
];
|
||||
};
|
||||
|
||||
// Check calling parameters for manually defined mission position.
|
||||
// You can define "_extraParams" to specify the vehicle classname to spawn, either as _vehClass or [_vehClass]
|
||||
_OK = (_this call DMS_fnc_MissionParams) params
|
||||
[
|
||||
10,DMS_WaterNearBlacklist,DMS_MaxSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_ThrottleBlacklists
|
||||
]call DMS_fnc_findSafePos;
|
||||
["_pos",[],[[]],[3]],
|
||||
["_extraParams",[]]
|
||||
];
|
||||
|
||||
if !(_OK) exitWith
|
||||
{
|
||||
diag_log format ["DMS ERROR :: Called MISSION donthasslethehoff.sqf with invalid parameters: %1",_this];
|
||||
};
|
||||
|
||||
|
||||
// Set general mission difficulty
|
||||
@ -27,7 +48,6 @@ _difficulty = "difficult";
|
||||
|
||||
|
||||
// Create AI
|
||||
// TODO: Spawn AI only when players are nearby
|
||||
_AICount = 6 + (round (random 2));
|
||||
|
||||
_group =
|
||||
@ -57,7 +77,30 @@ _crate1 = ["Box_NATO_Wps_F",_pos] call DMS_fnc_SpawnCrate;
|
||||
|
||||
_wreck = createVehicle ["Land_UWreck_Heli_Attack_02_F",[(_pos select 0) - 10, (_pos select 1),-0.2],[], 0, "CAN_COLLIDE"];
|
||||
|
||||
_vehicle = ["Exile_Car_SUV_Black",_pos] call DMS_fnc_SpawnNonPersistentVehicle;
|
||||
_vehClass =
|
||||
if (_extraParams isEqualTo []) then
|
||||
{
|
||||
"Exile_Car_SUV_Black"
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((typeName _extraParams)=="STRING") then
|
||||
{
|
||||
_extraParams
|
||||
}
|
||||
else
|
||||
{
|
||||
if (((typeName _extraParams)=="ARRAY") && {(typeName (_extraParams select 0))=="STRING"}) then
|
||||
{
|
||||
_extraParams select 0
|
||||
}
|
||||
else
|
||||
{
|
||||
"Exile_Car_SUV_Black"
|
||||
};
|
||||
};
|
||||
};
|
||||
_vehicle = [_vehClass,_pos] call DMS_fnc_SpawnNonPersistentVehicle;
|
||||
|
||||
// Set crate loot values
|
||||
_crate_loot_values1 =
|
||||
@ -166,4 +209,7 @@ if !(_added) exitWith
|
||||
|
||||
|
||||
|
||||
(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog;
|
||||
};
|
@ -5,7 +5,7 @@
|
||||
Called from DMS_selectMission
|
||||
*/
|
||||
|
||||
private ["_num", "_side", "_pos", "_difficulty", "_AICount", "_group", "_crate1", "_crate_loot_values1", "_crate2", "_crate_loot_values2", "_msgStart", "_msgWIN", "_msgLOSE", "_missionName", "_missionAIUnits", "_missionObjs", "_markers", "_time", "_added","_wreck"];
|
||||
private ["_num", "_side", "_OK", "_pos", "_difficulty", "_AICount", "_group", "_type", "_launcher", "_crate1", "_wreck", "_crate_loot_values1", "_missionAIUnits", "_missionObjs", "_msgStart", "_msgWIN", "_msgLOSE", "_missionName", "_markers", "_time", "_added", "_cleanup"];
|
||||
|
||||
// For logging purposes
|
||||
_num = DMS_MissionCount;
|
||||
@ -15,11 +15,32 @@ _num = DMS_MissionCount;
|
||||
_side = "bandit";
|
||||
|
||||
|
||||
// find position
|
||||
_pos =
|
||||
// This part is unnecessary, but exists just as an example to format the parameters for "DMS_fnc_MissionParams" if you want to explicitly define the calling parameters for DMS_fnc_FindSafePos.
|
||||
// It also allows anybody to modify the default calling parameters easily.
|
||||
if ((isNil "_this") || {_this isEqualTo [] || {(typeName _this)!="ARRAY"}}) then
|
||||
{
|
||||
_this =
|
||||
[
|
||||
[10,DMS_WaterNearBlacklist,DMS_MinSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_TerritoryNearBlacklist,DMS_ThrottleBlacklists],
|
||||
[
|
||||
[]
|
||||
],
|
||||
_this
|
||||
];
|
||||
};
|
||||
|
||||
// Check calling parameters for manually defined mission position.
|
||||
// This mission doesn't use "_extraParams" in any way currently.
|
||||
_OK = (_this call DMS_fnc_MissionParams) params
|
||||
[
|
||||
10,DMS_WaterNearBlacklist,DMS_MaxSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_ThrottleBlacklists
|
||||
]call DMS_fnc_findSafePos;
|
||||
["_pos",[],[[]],[3]],
|
||||
["_extraParams",[]]
|
||||
];
|
||||
|
||||
if !(_OK) exitWith
|
||||
{
|
||||
diag_log format ["DMS ERROR :: Called MISSION foodtransport.sqf with invalid parameters: %1",_this];
|
||||
};
|
||||
|
||||
|
||||
// Set general mission difficulty
|
||||
@ -27,7 +48,6 @@ _difficulty = "difficult";
|
||||
|
||||
|
||||
// Create AI
|
||||
// TODO: Spawn AI only when players are nearby
|
||||
_AICount = 6 + (round (random 2));
|
||||
|
||||
_group =
|
||||
@ -152,4 +172,7 @@ if !(_added) exitWith
|
||||
|
||||
|
||||
|
||||
(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog;
|
||||
};
|
@ -5,7 +5,7 @@
|
||||
Called from DMS_selectMission
|
||||
*/
|
||||
|
||||
private ["_num", "_side", "_pos", "_difficulty", "_AICount", "_group", "_crate1", "_crate_loot_values1", "_crate2", "_crate_loot_values2", "_msgStart", "_msgWIN", "_msgLOSE", "_missionName", "_missionAIUnits", "_missionObjs", "_markers", "_time", "_added","_wreck"];
|
||||
private ["_num", "_side", "_OK", "_group", "_pos", "_difficulty", "_AICount", "_type", "_launcher", "_crate1", "_wreck", "_crate_loot_values1", "_missionAIUnits", "_missionObjs", "_msgStart", "_msgWIN", "_msgLOSE", "_missionName", "_markers", "_time", "_added", "_cleanup"];
|
||||
|
||||
// For logging purposes
|
||||
_num = DMS_MissionCount;
|
||||
@ -15,11 +15,32 @@ _num = DMS_MissionCount;
|
||||
_side = "bandit";
|
||||
|
||||
|
||||
// find position
|
||||
_pos =
|
||||
// This part is unnecessary, but exists just as an example to format the parameters for "DMS_fnc_MissionParams" if you want to explicitly define the calling parameters for DMS_fnc_FindSafePos.
|
||||
// It also allows anybody to modify the default calling parameters easily.
|
||||
if ((isNil "_this") || {_this isEqualTo [] || {(typeName _this)!="ARRAY"}}) then
|
||||
{
|
||||
_this =
|
||||
[
|
||||
[10,DMS_WaterNearBlacklist,DMS_MinSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_TerritoryNearBlacklist,DMS_ThrottleBlacklists],
|
||||
[
|
||||
[]
|
||||
],
|
||||
_this
|
||||
];
|
||||
};
|
||||
|
||||
// Check calling parameters for manually defined mission position.
|
||||
// This mission doesn't use "_extraParams" in any way currently.
|
||||
_OK = (_this call DMS_fnc_MissionParams) params
|
||||
[
|
||||
10,DMS_WaterNearBlacklist,DMS_MaxSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_ThrottleBlacklists
|
||||
]call DMS_fnc_findSafePos;
|
||||
["_pos",[],[[]],[3]],
|
||||
["_extraParams",[]]
|
||||
];
|
||||
|
||||
if !(_OK) exitWith
|
||||
{
|
||||
diag_log format ["DMS ERROR :: Called MISSION guntransport.sqf with invalid parameters: %1",_this];
|
||||
};
|
||||
|
||||
|
||||
// Set general mission difficulty
|
||||
@ -27,7 +48,6 @@ _difficulty = "difficult";
|
||||
|
||||
|
||||
// Create AI
|
||||
// TODO: Spawn AI only when players are nearby
|
||||
_AICount = 6 + (round (random 2));
|
||||
|
||||
_group =
|
||||
@ -152,4 +172,7 @@ if !(_added) exitWith
|
||||
|
||||
|
||||
|
||||
(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog;
|
||||
};
|
@ -5,7 +5,7 @@
|
||||
Called from DMS_selectMission
|
||||
*/
|
||||
|
||||
private ["_num", "_side", "_pos", "_difficulty", "_AICount", "_group", "_crate1", "_crate_loot_values1", "_crate2", "_crate_loot_values2", "_msgStart", "_msgWIN", "_msgLOSE", "_missionName", "_missionAIUnits", "_missionObjs", "_markers", "_time", "_added","_wreck"];
|
||||
private ["_num", "_side", "_OK", "_group", "_pos", "_difficulty", "_AICount", "_type", "_launcher", "_crate1", "_wreck", "_crate_loot_values1", "_missionAIUnits", "_missionObjs", "_msgStart", "_msgWIN", "_msgLOSE", "_missionName", "_markers", "_time", "_added", "_cleanup"];
|
||||
|
||||
// For logging purposes
|
||||
_num = DMS_MissionCount;
|
||||
@ -15,11 +15,32 @@ _num = DMS_MissionCount;
|
||||
_side = "bandit";
|
||||
|
||||
|
||||
// find position
|
||||
_pos =
|
||||
// This part is unnecessary, but exists just as an example to format the parameters for "DMS_fnc_MissionParams" if you want to explicitly define the calling parameters for DMS_fnc_FindSafePos.
|
||||
// It also allows anybody to modify the default calling parameters easily.
|
||||
if ((isNil "_this") || {_this isEqualTo [] || {(typeName _this)!="ARRAY"}}) then
|
||||
{
|
||||
_this =
|
||||
[
|
||||
[10,DMS_WaterNearBlacklist,DMS_MinSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_TerritoryNearBlacklist,DMS_ThrottleBlacklists],
|
||||
[
|
||||
[]
|
||||
],
|
||||
_this
|
||||
];
|
||||
};
|
||||
|
||||
// Check calling parameters for manually defined mission position.
|
||||
// This mission doesn't use "_extraParams" in any way currently.
|
||||
_OK = (_this call DMS_fnc_MissionParams) params
|
||||
[
|
||||
10,DMS_WaterNearBlacklist,DMS_MaxSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_ThrottleBlacklists
|
||||
]call DMS_fnc_findSafePos;
|
||||
["_pos",[],[[]],[3]],
|
||||
["_extraParams",[]]
|
||||
];
|
||||
|
||||
if !(_OK) exitWith
|
||||
{
|
||||
diag_log format ["DMS ERROR :: Called MISSION humanitarian.sqf with invalid parameters: %1",_this];
|
||||
};
|
||||
|
||||
|
||||
// Set general mission difficulty
|
||||
@ -27,7 +48,6 @@ _difficulty = "moderate";
|
||||
|
||||
|
||||
// Create AI
|
||||
// TODO: Spawn AI only when players are nearby
|
||||
_AICount = 3 + (round (random 2));
|
||||
|
||||
_group =
|
||||
@ -152,4 +172,7 @@ if !(_added) exitWith
|
||||
|
||||
|
||||
|
||||
(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog;
|
||||
};
|
@ -5,7 +5,7 @@
|
||||
Called from DMS_selectMission
|
||||
*/
|
||||
|
||||
private ["_num", "_side", "_pos", "_difficulty", "_AICount", "_group", "_crate", "_crate2", "_crate_loot_values", "_msgStart", "_msgWIN", "_msgLOSE", "_missionName", "_missionAIUnits", "_missionObjs", "_markers", "_time", "_added"];
|
||||
private ["_num", "_side", "_OK", "_group", "_pos", "_difficulty", "_AICount", "_type", "_launcher", "_crate", "_crate_loot_values", "_missionAIUnits", "_missionObjs", "_msgStart", "_msgWIN", "_msgLOSE", "_missionName", "_markers", "_time", "_added", "_cleanup"];
|
||||
|
||||
// For logging purposes
|
||||
_num = DMS_MissionCount;
|
||||
@ -15,11 +15,32 @@ _num = DMS_MissionCount;
|
||||
_side = "bandit";
|
||||
|
||||
|
||||
// find position
|
||||
_pos =
|
||||
// This part is unnecessary, but exists just as an example to format the parameters for "DMS_fnc_MissionParams" if you want to explicitly define the calling parameters for DMS_fnc_FindSafePos.
|
||||
// It also allows anybody to modify the default calling parameters easily.
|
||||
if ((isNil "_this") || {_this isEqualTo [] || {(typeName _this)!="ARRAY"}}) then
|
||||
{
|
||||
_this =
|
||||
[
|
||||
[10,DMS_WaterNearBlacklist,DMS_MinSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_TerritoryNearBlacklist,DMS_ThrottleBlacklists],
|
||||
[
|
||||
[]
|
||||
],
|
||||
_this
|
||||
];
|
||||
};
|
||||
|
||||
// Check calling parameters for manually defined mission position.
|
||||
// This mission doesn't use "_extraParams" in any way currently.
|
||||
_OK = (_this call DMS_fnc_MissionParams) params
|
||||
[
|
||||
10,DMS_WaterNearBlacklist,DMS_MaxSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_ThrottleBlacklists
|
||||
]call DMS_fnc_findSafePos;
|
||||
["_pos",[],[[]],[3]],
|
||||
["_extraParams",[]]
|
||||
];
|
||||
|
||||
if !(_OK) exitWith
|
||||
{
|
||||
diag_log format ["DMS ERROR :: Called MISSION lost_battalion.sqf with invalid parameters: %1",_this];
|
||||
};
|
||||
|
||||
|
||||
// Set general mission difficulty
|
||||
@ -27,7 +48,6 @@ _difficulty = "moderate";
|
||||
|
||||
|
||||
// Create AI
|
||||
// TODO: Spawn AI only when players are nearby
|
||||
_AICount = 7 + (round (random 2));
|
||||
|
||||
_group =
|
||||
@ -150,4 +170,7 @@ if !(_added) exitWith
|
||||
|
||||
|
||||
|
||||
(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog;
|
||||
};
|
||||
|
@ -1,8 +1,8 @@
|
||||
/*
|
||||
Sample mission (duplicate for testing purposes)
|
||||
Sample mission
|
||||
*/
|
||||
|
||||
private ["_num", "_side", "_pos", "_difficulty", "_AICount", "_group", "_crate", "_crate_loot_values", "_msgStart", "_msgWIN", "_msgLOSE", "_missionName", "_missionAIUnits", "_missionObjs", "_markers", "_time", "_added","_building","_vehicle"];
|
||||
private ["_num", "_side", "_OK", "_group", "_pos", "_difficulty", "_AICount", "_type", "_launcher", "_crate", "_building", "_vehicle", "_crate_loot_values", "_missionAIUnits", "_missionObjs", "_msgStart", "_msgWIN", "_msgLOSE", "_missionName", "_markers", "_time", "_added", "_cleanup"];
|
||||
|
||||
// For logging purposes
|
||||
_num = DMS_MissionCount;
|
||||
@ -12,11 +12,32 @@ _num = DMS_MissionCount;
|
||||
_side = "bandit";
|
||||
|
||||
|
||||
// find position
|
||||
_pos =
|
||||
// This part is unnecessary, but exists just as an example to format the parameters for "DMS_fnc_MissionParams" if you want to explicitly define the calling parameters for DMS_fnc_FindSafePos.
|
||||
// It also allows anybody to modify the default calling parameters easily.
|
||||
if ((isNil "_this") || {_this isEqualTo [] || {(typeName _this)!="ARRAY"}}) then
|
||||
{
|
||||
_this =
|
||||
[
|
||||
[10,DMS_WaterNearBlacklist,DMS_MinSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_TerritoryNearBlacklist,DMS_ThrottleBlacklists],
|
||||
[
|
||||
[]
|
||||
],
|
||||
_this
|
||||
];
|
||||
};
|
||||
|
||||
// Check calling parameters for manually defined mission position.
|
||||
// This mission doesn't use "_extraParams" in any way currently.
|
||||
_OK = (_this call DMS_fnc_MissionParams) params
|
||||
[
|
||||
10,DMS_WaterNearBlacklist,DMS_MaxSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_ThrottleBlacklists
|
||||
]call DMS_fnc_findSafePos;
|
||||
["_pos",[],[[]],[3]],
|
||||
["_extraParams",[]]
|
||||
];
|
||||
|
||||
if !(_OK) exitWith
|
||||
{
|
||||
diag_log format ["DMS ERROR :: Called MISSION medical.sqf with invalid parameters: %1",_this];
|
||||
};
|
||||
|
||||
|
||||
// Set general mission difficulty
|
||||
@ -24,7 +45,6 @@ _difficulty = "easy";
|
||||
|
||||
|
||||
// Create AI
|
||||
// TODO: Spawn AI only when players are nearby
|
||||
_AICount = 4 + (round (random 2));
|
||||
|
||||
_group =
|
||||
@ -152,4 +172,7 @@ if !(_added) exitWith
|
||||
|
||||
|
||||
|
||||
(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog;
|
||||
};
|
@ -2,7 +2,7 @@
|
||||
Sample mission (duplicate for testing purposes)
|
||||
*/
|
||||
|
||||
private ["_num", "_side", "_difficulty", "_AICount", "_staticGuns", "_baseObjs", "_crate", "_missionAIUnits", "_missionObjs", "_msgStart", "_msgWIN", "_msgLOSE", "_missionName", "_markers", "_time", "_added", "_cleanup"];
|
||||
private ["_num", "_side", "_OK", "_group", "_pos", "_difficulty", "_AICount", "_veh", "_staticGuns", "_baseObjs", "_crate", "_missionAIUnits", "_missionObjs", "_msgStart", "_msgWIN", "_msgLOSE", "_missionName", "_markers", "_time", "_added", "_cleanup"];
|
||||
|
||||
// For logging purposes
|
||||
_num = DMS_MissionCount;
|
||||
@ -12,11 +12,32 @@ _num = DMS_MissionCount;
|
||||
_side = "bandit";
|
||||
|
||||
|
||||
// find position
|
||||
_pos =
|
||||
// This part is unnecessary, but exists just as an example to format the parameters for "DMS_fnc_MissionParams" if you want to explicitly define the calling parameters for DMS_fnc_FindSafePos.
|
||||
// It also allows anybody to modify the default calling parameters easily.
|
||||
if ((isNil "_this") || {_this isEqualTo [] || {(typeName _this)!="ARRAY"}}) then
|
||||
{
|
||||
_this =
|
||||
[
|
||||
[50,DMS_WaterNearBlacklist,DMS_MinSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_TerritoryNearBlacklist,DMS_ThrottleBlacklists],
|
||||
[
|
||||
[]
|
||||
],
|
||||
_this
|
||||
];
|
||||
};
|
||||
|
||||
// Check calling parameters for manually defined mission position.
|
||||
// This mission doesn't use "_extraParams" in any way currently.
|
||||
_OK = (_this call DMS_fnc_MissionParams) params
|
||||
[
|
||||
25,DMS_WaterNearBlacklist,DMS_MaxSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_ThrottleBlacklists
|
||||
]call DMS_fnc_findSafePos;
|
||||
["_pos",[],[[]],[3]],
|
||||
["_extraParams",[]]
|
||||
];
|
||||
|
||||
if !(_OK) exitWith
|
||||
{
|
||||
diag_log format ["DMS ERROR :: Called MISSION mercbase.sqf with invalid parameters: %1",_this];
|
||||
};
|
||||
|
||||
|
||||
// Set general mission difficulty
|
||||
@ -183,4 +204,7 @@ if !(_added) exitWith
|
||||
|
||||
|
||||
|
||||
(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog;
|
||||
};
|
@ -5,7 +5,7 @@
|
||||
Called from DMS_selectMission
|
||||
*/
|
||||
|
||||
private ["_num", "_side", "_pos", "_difficulty", "_AICount", "_group", "_crate", "_crate_loot_values", "_msgStart", "_msgWIN", "_msgLOSE", "_missionName", "_missionAIUnits", "_missionObjs", "_markers", "_time", "_added"];
|
||||
private ["_num", "_side", "_OK", "_group", "_pos", "_difficulty", "_AICount", "_type", "_launcher", "_crate", "_crate_loot_values", "_missionAIUnits", "_missionObjs", "_msgStart", "_msgWIN", "_msgLOSE", "_missionName", "_markers", "_time", "_added", "_cleanup"];
|
||||
|
||||
// For logging purposes
|
||||
_num = DMS_MissionCount;
|
||||
@ -15,11 +15,32 @@ _num = DMS_MissionCount;
|
||||
_side = "bandit";
|
||||
|
||||
|
||||
// find position
|
||||
_pos =
|
||||
// This part is unnecessary, but exists just as an example to format the parameters for "DMS_fnc_MissionParams" if you want to explicitly define the calling parameters for DMS_fnc_FindSafePos.
|
||||
// It also allows anybody to modify the default calling parameters easily.
|
||||
if ((isNil "_this") || {_this isEqualTo [] || {(typeName _this)!="ARRAY"}}) then
|
||||
{
|
||||
_this =
|
||||
[
|
||||
[10,DMS_WaterNearBlacklist,DMS_MinSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_TerritoryNearBlacklist,DMS_ThrottleBlacklists],
|
||||
[
|
||||
[]
|
||||
],
|
||||
_this
|
||||
];
|
||||
};
|
||||
|
||||
// Check calling parameters for manually defined mission position.
|
||||
// This mission doesn't use "_extraParams" in any way currently.
|
||||
_OK = (_this call DMS_fnc_MissionParams) params
|
||||
[
|
||||
10,DMS_WaterNearBlacklist,DMS_MaxSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_ThrottleBlacklists
|
||||
]call DMS_fnc_findSafePos;
|
||||
["_pos",[],[[]],[3]],
|
||||
["_extraParams",[]]
|
||||
];
|
||||
|
||||
if !(_OK) exitWith
|
||||
{
|
||||
diag_log format ["DMS ERROR :: Called MISSION mercenaries.sqf with invalid parameters: %1",_this];
|
||||
};
|
||||
|
||||
|
||||
// Set general mission difficulty
|
||||
@ -27,7 +48,6 @@ _difficulty = "moderate";
|
||||
|
||||
|
||||
// Create AI
|
||||
// TODO: Spawn AI only when players are nearby
|
||||
_AICount = 6 + (round (random 2));
|
||||
|
||||
_group =
|
||||
@ -150,4 +170,7 @@ if !(_added) exitWith
|
||||
|
||||
|
||||
|
||||
(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog;
|
||||
};
|
@ -5,7 +5,7 @@
|
||||
Called from DMS_selectMission
|
||||
*/
|
||||
|
||||
private ["_num", "_side", "_pos", "_difficulty", "_AICount", "_group", "_crate", "_crate_loot_values", "_msgStart", "_msgWIN", "_msgLOSE", "_missionName", "_missionAIUnits", "_missionObjs", "_markers", "_time", "_added"];
|
||||
private ["_num", "_side", "_OK", "_group", "_pos", "_difficulty", "_AICount", "_type", "_launcher", "_crate", "_crate_loot_values", "_missionAIUnits", "_missionObjs", "_msgStart", "_msgWIN", "_msgLOSE", "_missionName", "_markers", "_time", "_added", "_cleanup"];
|
||||
|
||||
// For logging purposes
|
||||
_num = DMS_MissionCount;
|
||||
@ -15,11 +15,32 @@ _num = DMS_MissionCount;
|
||||
_side = "bandit";
|
||||
|
||||
|
||||
// find position
|
||||
_pos =
|
||||
// This part is unnecessary, but exists just as an example to format the parameters for "DMS_fnc_MissionParams" if you want to explicitly define the calling parameters for DMS_fnc_FindSafePos.
|
||||
// It also allows anybody to modify the default calling parameters easily.
|
||||
if ((isNil "_this") || {_this isEqualTo [] || {(typeName _this)!="ARRAY"}}) then
|
||||
{
|
||||
_this =
|
||||
[
|
||||
[10,DMS_WaterNearBlacklist,DMS_MinSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_TerritoryNearBlacklist,DMS_ThrottleBlacklists],
|
||||
[
|
||||
[]
|
||||
],
|
||||
_this
|
||||
];
|
||||
};
|
||||
|
||||
// Check calling parameters for manually defined mission position.
|
||||
// This mission doesn't use "_extraParams" in any way currently.
|
||||
_OK = (_this call DMS_fnc_MissionParams) params
|
||||
[
|
||||
10,DMS_WaterNearBlacklist,DMS_MaxSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_ThrottleBlacklists
|
||||
]call DMS_fnc_findSafePos;
|
||||
["_pos",[],[[]],[3]],
|
||||
["_extraParams",[]]
|
||||
];
|
||||
|
||||
if !(_OK) exitWith
|
||||
{
|
||||
diag_log format ["DMS ERROR :: Called MISSION roguenavyseals.sqf with invalid parameters: %1",_this];
|
||||
};
|
||||
|
||||
|
||||
// Set general mission difficulty
|
||||
@ -27,7 +48,6 @@ _difficulty = "hardcore";
|
||||
|
||||
|
||||
// Create AI
|
||||
// TODO: Spawn AI only when players are nearby
|
||||
_AICount = 4 + (round (random 2));
|
||||
|
||||
_group =
|
||||
@ -150,4 +170,7 @@ if !(_added) exitWith
|
||||
|
||||
|
||||
|
||||
(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog;
|
||||
};
|
@ -2,7 +2,7 @@
|
||||
Sample mission (duplicate for testing purposes)
|
||||
*/
|
||||
|
||||
private ["_num", "_side", "_pos", "_difficulty", "_AICount", "_group", "_crate", "_crate_loot_values", "_msgStart", "_msgWIN", "_msgLOSE", "_missionName", "_missionAIUnits", "_missionObjs", "_markers", "_time", "_added","_vehicle"];
|
||||
private ["_num", "_side", "_OK", "_difficulty", "_AICount", "_type", "_launcher", "_dir", "_staticGuns", "_crate", "_vehicle", "_crate_loot_values", "_veh", "_baseObjs", "_mines", "_missionAIUnits", "_missionObjs", "_msgStart", "_msgWIN", "_msgLOSE", "_missionName", "_markers", "_time", "_added", "_cleanup"];
|
||||
|
||||
// For logging purposes
|
||||
_num = DMS_MissionCount;
|
||||
@ -12,11 +12,32 @@ _num = DMS_MissionCount;
|
||||
_side = "bandit";
|
||||
|
||||
|
||||
// find position
|
||||
_pos =
|
||||
// This part is unnecessary, but exists just as an example to format the parameters for "DMS_fnc_MissionParams" if you want to explicitly define the calling parameters for DMS_fnc_FindSafePos.
|
||||
// It also allows anybody to modify the default calling parameters easily.
|
||||
if ((isNil "_this") || {_this isEqualTo [] || {(typeName _this)!="ARRAY"}}) then
|
||||
{
|
||||
_this =
|
||||
[
|
||||
[10,DMS_WaterNearBlacklist,DMS_MinSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_TerritoryNearBlacklist,DMS_ThrottleBlacklists],
|
||||
[
|
||||
[]
|
||||
],
|
||||
_this
|
||||
];
|
||||
};
|
||||
|
||||
// Check calling parameters for manually defined mission position.
|
||||
// This mission doesn't use "_extraParams" in any way currently.
|
||||
_OK = (_this call DMS_fnc_MissionParams) params
|
||||
[
|
||||
10,DMS_WaterNearBlacklist,DMS_MaxSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_ThrottleBlacklists
|
||||
]call DMS_fnc_findSafePos;
|
||||
["_pos",[],[[]],[3]],
|
||||
["_extraParams",[]]
|
||||
];
|
||||
|
||||
if !(_OK) exitWith
|
||||
{
|
||||
diag_log format ["DMS ERROR :: Called MISSION testmission.sqf with invalid parameters: %1",_this];
|
||||
};
|
||||
|
||||
|
||||
// Set general mission difficulty
|
||||
@ -24,7 +45,6 @@ _difficulty = "moderate";
|
||||
|
||||
|
||||
// Create AI
|
||||
// TODO: Spawn AI only when players are nearby
|
||||
_AICount = 1;
|
||||
|
||||
_group =
|
||||
@ -197,4 +217,7 @@ if !(_added) exitWith
|
||||
|
||||
|
||||
|
||||
(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog;
|
||||
};
|
@ -2,6 +2,8 @@
|
||||
Sample mission (duplicate for testing purposes)
|
||||
*/
|
||||
|
||||
private ["_num", "_side", "_OK", "_group", "_pos", "_difficulty", "_AICount", "_type", "_launcher", "_class", "_pinCode", "_vehicle", "_missionAIUnits", "_missionObjs", "_msgStart", "_msgWIN", "_msgLOSE", "_missionName", "_markers", "_time", "_added", "_cleanup"];
|
||||
|
||||
// For logging purposes
|
||||
_num = DMS_MissionCount;
|
||||
|
||||
@ -10,11 +12,32 @@ _num = DMS_MissionCount;
|
||||
_side = "bandit";
|
||||
|
||||
|
||||
// find position
|
||||
_pos =
|
||||
// This part is unnecessary, but exists just as an example to format the parameters for "DMS_fnc_MissionParams" if you want to explicitly define the calling parameters for DMS_fnc_FindSafePos.
|
||||
// It also allows anybody to modify the default calling parameters easily.
|
||||
if ((isNil "_this") || {_this isEqualTo [] || {(typeName _this)!="ARRAY"}}) then
|
||||
{
|
||||
_this =
|
||||
[
|
||||
[15,DMS_WaterNearBlacklist,DMS_MinSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_TerritoryNearBlacklist,DMS_ThrottleBlacklists],
|
||||
[
|
||||
[]
|
||||
],
|
||||
_this
|
||||
];
|
||||
};
|
||||
|
||||
// Check calling parameters for manually defined mission position.
|
||||
// You can define "_extraParams" to specify the vehicle classname to spawn, either as _classname or [_classname]
|
||||
_OK = (_this call DMS_fnc_MissionParams) params
|
||||
[
|
||||
15,DMS_WaterNearBlacklist,DMS_MaxSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_ThrottleBlacklists
|
||||
]call DMS_fnc_findSafePos;
|
||||
["_pos",[],[[]],[3]],
|
||||
["_extraParams",[]]
|
||||
];
|
||||
|
||||
if !(_OK) exitWith
|
||||
{
|
||||
diag_log format ["DMS ERROR :: Called MISSION thieves.sqf with invalid parameters: %1",_this];
|
||||
};
|
||||
|
||||
|
||||
// Set general mission difficulty
|
||||
@ -22,7 +45,6 @@ _difficulty = "easy";
|
||||
|
||||
|
||||
// Create AI
|
||||
// TODO: Spawn AI only when players are nearby
|
||||
_AICount = 3 + (round (random 1));
|
||||
|
||||
_group =
|
||||
@ -35,7 +57,29 @@ _group =
|
||||
] call DMS_fnc_SpawnAIGroup;
|
||||
|
||||
|
||||
_class = (DMS_MilitaryVehicles+DMS_TransportTrucks) call BIS_fnc_SelectRandom;
|
||||
_class =
|
||||
if (_extraParams isEqualTo []) then
|
||||
{
|
||||
(DMS_MilitaryVehicles+DMS_TransportTrucks) call BIS_fnc_SelectRandom
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((typeName _extraParams)=="STRING") then
|
||||
{
|
||||
_extraParams
|
||||
}
|
||||
else
|
||||
{
|
||||
if (((typeName _extraParams)=="ARRAY") && {(typeName (_extraParams select 0))=="STRING"}) then
|
||||
{
|
||||
_extraParams select 0
|
||||
}
|
||||
else
|
||||
{
|
||||
(DMS_MilitaryVehicles+DMS_TransportTrucks) call BIS_fnc_SelectRandom
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
//DMS_fnc_SpawnPersistentVehicle will automatically turn the pincode into a string and format it.
|
||||
_pinCode = round (random 9999);
|
||||
@ -143,4 +187,7 @@ if !(_added) exitWith
|
||||
|
||||
|
||||
|
||||
(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog;
|
||||
};
|
@ -2,10 +2,10 @@
|
||||
Sample mission
|
||||
Created by Defent and eraser1
|
||||
|
||||
Called from DMS_selectMission
|
||||
Called from DMS_fnc_SelectMission
|
||||
*/
|
||||
|
||||
private ["_num", "_side", "_pos", "_difficulty", "_AICount", "_group", "_crate", "_crate_loot_values", "_msgStart", "_msgWIN", "_msgLOSE", "_missionName", "_missionAIUnits", "_missionObjs", "_markers", "_time", "_added","_wreck1","_wreck2","_wreck3","_wreck4"];
|
||||
private ["_num", "_side", "_OK", "_group", "_pos", "_difficulty", "_AICount", "_type", "_launcher", "_crate", "_wreck1", "_wreck2", "_wreck3", "_wreck4", "_wreck5", "_crate_loot_values", "_missionAIUnits", "_missionObjs", "_msgStart", "_msgWIN", "_msgLOSE", "_missionName", "_markers", "_time", "_added", "_cleanup"];
|
||||
|
||||
// For logging purposes
|
||||
_num = DMS_MissionCount;
|
||||
@ -15,11 +15,32 @@ _num = DMS_MissionCount;
|
||||
_side = "bandit";
|
||||
|
||||
|
||||
// find position
|
||||
_pos =
|
||||
// This part is unnecessary, but exists just as an example to format the parameters for "DMS_fnc_MissionParams" if you want to explicitly define the calling parameters for DMS_fnc_FindSafePos.
|
||||
// It also allows anybody to modify the default calling parameters easily.
|
||||
if ((isNil "_this") || {_this isEqualTo [] || {(typeName _this)!="ARRAY"}}) then
|
||||
{
|
||||
_this =
|
||||
[
|
||||
[10,DMS_WaterNearBlacklist,DMS_MinSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_TerritoryNearBlacklist,DMS_ThrottleBlacklists],
|
||||
[
|
||||
[]
|
||||
],
|
||||
_this
|
||||
];
|
||||
};
|
||||
|
||||
// Check calling parameters for manually defined mission position.
|
||||
// This mission doesn't use "_extraParams" in any way currently.
|
||||
_OK = (_this call DMS_fnc_MissionParams) params
|
||||
[
|
||||
10,DMS_WaterNearBlacklist,DMS_MaxSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_ThrottleBlacklists
|
||||
]call DMS_fnc_findSafePos;
|
||||
["_pos",[],[[]],[3]],
|
||||
["_extraParams",[]]
|
||||
];
|
||||
|
||||
if !(_OK) exitWith
|
||||
{
|
||||
diag_log format ["DMS ERROR :: Called MISSION guntransport.sqf with invalid parameters: %1",_this];
|
||||
};
|
||||
|
||||
|
||||
// Set general mission difficulty
|
||||
@ -27,7 +48,6 @@ _difficulty = "moderate";
|
||||
|
||||
|
||||
// Create AI
|
||||
// TODO: Spawn AI only when players are nearby
|
||||
_AICount = 6 + (round (random 2));
|
||||
|
||||
_group =
|
||||
@ -151,4 +171,7 @@ if !(_added) exitWith
|
||||
|
||||
|
||||
|
||||
(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog;
|
||||
};
|
@ -13,7 +13,7 @@ DMS_CleanUpList = [];
|
||||
DMS_MissionCount = 0;
|
||||
DMS_RunningBMissionCount = 0;
|
||||
DMS_BMissionLastStart = diag_tickTime;
|
||||
DMS_BMissionDelay = DMS_TimeBetweenMissions call DMS_fnc_SelectRandomVal;
|
||||
DMS_BMissionDelay = DMS_TimeToFirstMission call DMS_fnc_SelectRandomVal;
|
||||
|
||||
|
||||
if (DMS_DEBUG) then
|
||||
|
@ -19,7 +19,10 @@ if (!DMS_ai_offload_to_client && {isNull DMS_HC_Object}) exitWith {};
|
||||
if (isNull DMS_HC_Object) then
|
||||
{
|
||||
|
||||
(format ["AILocalityManager :: DMS_HC_Object is null! Finding owner for group: %1",_group]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["AILocalityManager :: DMS_HC_Object is null! Finding owner for group: %1",_group]) call DMS_fnc_DebugLog;
|
||||
};
|
||||
_owner = objNull;
|
||||
|
||||
{
|
||||
@ -39,7 +42,10 @@ if (!DMS_ai_offload_to_client && {isNull DMS_HC_Object}) exitWith {};
|
||||
if !((groupOwner _group) isEqualTo (owner DMS_HC_Object)) then
|
||||
{
|
||||
_transferSuccess = _group setGroupOwner (owner DMS_HC_Object);
|
||||
(format ["AILocalityManager :: Setting ownership of group %1 to HC (%2). Success: %3",_group,DMS_HC_Object,_transferSuccess]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["AILocalityManager :: Setting ownership of group %1 to HC (%2). Success: %3",_group,DMS_HC_Object,_transferSuccess]) call DMS_fnc_DebugLog;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -44,14 +44,18 @@
|
||||
[_missionName,_markerDot,_markerCircle],
|
||||
_side,
|
||||
_difficulty,
|
||||
_missionEvents
|
||||
_missionEvents,
|
||||
[
|
||||
_onSuccessScripts, // (OPTIONAL) Array of code or string to be executed on mission completion (in addition to regular code).
|
||||
_onFailScripts // (OPTIONAL) Array of code or stirng to be executed on mission failure (in addition to regular code).
|
||||
]
|
||||
] call DMS_fnc_AddMissionToMonitor;
|
||||
|
||||
Returns whether or not info was added successfully
|
||||
|
||||
*/
|
||||
|
||||
private ["_added", "_pos", "_OK", "_completionInfo", "_timeOutInfo", "_inputUnits", "_missionObjs", "_mines", "_messages", "_markers", "_timeStarted", "_timeUntilFail", "_buildings", "_vehs", "_crate_info_array", "_msgWIN", "_msgLose", "_markerDot", "_markerCircle", "_side", "_difficulty", "_missionEvents", "_arr"];
|
||||
private ["_added", "_OK", "_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"];
|
||||
|
||||
|
||||
_added = false;
|
||||
@ -76,6 +80,8 @@ if (!_OK) exitWith
|
||||
false;
|
||||
};
|
||||
|
||||
_onEndingScripts = if ((count _this)>10) then {_this select 10} else {[[],[]]};
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
@ -157,6 +163,17 @@ try
|
||||
throw format["_markers |%1|",_markers];
|
||||
};
|
||||
|
||||
_OK = _onEndingScripts params
|
||||
[
|
||||
["_onSuccessScripts", [], [[]]],
|
||||
["_onFailScripts", [], [[]]]
|
||||
];
|
||||
|
||||
if (!_OK) then
|
||||
{
|
||||
throw format["_onEndingScripts |%1|",_onEndingScripts];
|
||||
};
|
||||
|
||||
_arr =
|
||||
[
|
||||
_pos,
|
||||
@ -183,7 +200,11 @@ try
|
||||
],
|
||||
_side,
|
||||
_difficulty,
|
||||
_missionEvents
|
||||
_missionEvents,
|
||||
[
|
||||
_onSuccessScripts,
|
||||
_onFailScripts
|
||||
]
|
||||
];
|
||||
DMS_Mission_Arr pushBack _arr;
|
||||
_added = true;
|
||||
@ -193,7 +214,10 @@ try
|
||||
_markerDot setMarkerText (format ["%1 (%2 %3 remaining)",markerText _markerDot,count _units,DMS_MarkerText_AIName]);
|
||||
};
|
||||
|
||||
(format ["AddMissionToMonitor :: Added |%1| to DMS_Mission_Arr!",_arr]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["AddMissionToMonitor :: Added |%1| to DMS_Mission_Arr!",_arr]) call DMS_fnc_DebugLog;
|
||||
};
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
@ -34,7 +34,10 @@ _messageInfo params
|
||||
["_message","",[""]]
|
||||
];
|
||||
|
||||
(format["BroadcastMissionStatus :: Notification types: |%1| for broadcasting mission status: %2",DMS_PlayerNotificationTypes,_message]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format["BroadcastMissionStatus :: Notification types: |%1| for broadcasting mission status: %2",DMS_PlayerNotificationTypes,_message]) call DMS_fnc_DebugLog;
|
||||
};
|
||||
|
||||
if ((typeName _message) != "STRING") then
|
||||
{
|
||||
|
@ -20,7 +20,10 @@
|
||||
if (DMS_CleanUpList isEqualTo []) exitWith {}; // Empty array, no objects to clean :)
|
||||
|
||||
{
|
||||
(format ["CleanUpManager :: Checking Cleaning Status for: %1",_x]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["CleanUpManager :: Checking Cleaning Status for: %1",_x]) call DMS_fnc_DebugLog;
|
||||
};
|
||||
|
||||
private ["_objs","_timeAddedToList","_timeUntilClean"];
|
||||
|
||||
@ -42,6 +45,9 @@ if (DMS_CleanUpList isEqualTo []) exitWith {}; // Empty array, no objects to cl
|
||||
}
|
||||
else
|
||||
{
|
||||
(format ["CleanUpManager :: %1 is not yet ready to clean!",_x]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["CleanUpManager :: %1 is not yet ready to clean!",_x]) call DMS_fnc_DebugLog;
|
||||
};
|
||||
};
|
||||
} forEach DMS_CleanUpList;
|
@ -83,10 +83,16 @@ if (_randomMarker) then
|
||||
_dot setMarkerPos _npos;
|
||||
_circle setMarkerBrush DMS_RandomMarkerBrush;
|
||||
|
||||
(format ["CreateMarker :: Moving markers %1 from %2 to %3 (%4m away)",[_dot,_circle],_pos,_npos,_dis]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["CreateMarker :: Moving markers %1 from %2 to %3 (%4m away)",[_dot,_circle],_pos,_npos,_dis]) call DMS_fnc_DebugLog;
|
||||
};
|
||||
};
|
||||
|
||||
(format ["CreateMarker :: Created markers |%1| at %2 with text |%3| colored %4",[_dot,_circle],_pos,_text,_color]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["CreateMarker :: Created markers |%1| at %2 with text |%3| colored %4",[_dot,_circle],_pos,_text,_color]) call DMS_fnc_DebugLog;
|
||||
};
|
||||
|
||||
|
||||
[_dot,_circle];
|
@ -5,12 +5,10 @@
|
||||
Usage:
|
||||
_anyValue call DMS_fnc_DebugLog;
|
||||
|
||||
If DMS_DEBUG is true, then it will write the passed parameter to RPT. If you have infistar, then it will also utilize the "ARMA_LOG" dll to write debug info.
|
||||
This function will write the passed parameter as well as server updtime and FPS to RPT.
|
||||
If you have infiSTAR's DLLs, then it will also utilize the "ARMA_LOG" dll to write debug info.
|
||||
*/
|
||||
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
_this = format ["%1 |::|::| (UpTime: %2 | %3 FPS)",_this,time,diag_fps];
|
||||
"ARMA_LOG" callExtension format ["DMS_DEBUG:%1",_this];
|
||||
diag_log format ["DMS_DEBUG :: %1",_this];
|
||||
};
|
||||
_this = format ["%1 |::|::| (UpTime: %2 | %3 FPS)",_this,time,diag_fps];
|
||||
"ARMA_LOG" callExtension format ["DMS_DEBUG:%1",_this];
|
||||
diag_log format ["DMS_DEBUG :: %1",_this];
|
@ -90,7 +90,10 @@ if ((typeName _lootValues)=="ARRAY") then
|
||||
};
|
||||
|
||||
|
||||
(format["FillCrate :: Filling %4 with %1 guns, %2 items and %3 backpacks",_wepCount,_itemCount,_backpackCount,_crate]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format["FillCrate :: Filling %4 with %1 guns, %2 items and %3 backpacks",_wepCount,_itemCount,_backpackCount,_crate]) call DMS_fnc_DebugLog;
|
||||
};
|
||||
|
||||
|
||||
if ((_wepCount>0) && {count _weps>0}) then
|
||||
|
@ -10,53 +10,52 @@
|
||||
[
|
||||
_nearestObjectMinDistance, // NUMBER (distance): Minimum distance from the nearest object.
|
||||
_waterNearLimit, // NUMBER (distance): Minimum distance from water.
|
||||
_maxSurfaceNormal, // NUMBER (between 0-1): Maximum "surfaceNormal"; Basically determines how steep a position is. Check the comment for config value "DMS_MaxSurfaceNormal" in config.sqf for more info
|
||||
_minSurfaceNormal, // NUMBER (between 0-1): Maximum "surfaceNormal"; Basically determines how steep a position is. Check the comment for config value "DMS_MinSurfaceNormal" in config.sqf for more info
|
||||
_spawnZoneNearLimit, // NUMBER (distance): Minimum distance from a spawn point.
|
||||
_traderZoneNearLimit, // NUMBER (distance): Minimum distance from a trader zone.
|
||||
_missionNearLimit, // NUMBER (distance): Minimum distance from another mission.
|
||||
_playerNearLimit, // NUMBER (distance): Minimum distance from a player.
|
||||
_throttleParams // BOOLEAN: Whether or not some of the distance values should be throttled on repeated attempts.
|
||||
_waterSpawn // (OPTIONAL) BOOLEAN: Whether or not the mission is supposed to spawn on water. Default: false
|
||||
] call DMS_fnc_findSafePos;
|
||||
*/
|
||||
|
||||
|
||||
private ["_nearestObjectMinDistance", "_waterNearLimit", "_maxSurfaceNormal", "_spawnZoneNearLimit", "_traderZoneNearLimit", "_missionNearLimit", "_playerNearLimit", "_throttleParams", "_safePosParams", "_validspot", "_attempts", "_pos"];
|
||||
private ["_nearestObjectMinDistance", "_waterNearLimit", "_minSurfaceNormal", "_spawnZoneNearLimit", "_traderZoneNearLimit", "_missionNearLimit", "_playerNearLimit", "_territoryNearLimit", "_throttleParams", "_waterSpawn", "_isValidSpot", "_attempts", "_pos"];
|
||||
|
||||
params
|
||||
[
|
||||
["_nearestObjectMinDistance", 25, [0] ],
|
||||
["_waterNearLimit", DMS_WaterNearBlacklist, [0] ],
|
||||
["_maxSurfaceNormal", DMS_MaxSurfaceNormal, [0] ],
|
||||
["_minSurfaceNormal", DMS_MinSurfaceNormal, [0] ],
|
||||
["_spawnZoneNearLimit", DMS_SpawnZoneNearBlacklist, [0] ],
|
||||
["_traderZoneNearLimit", DMS_TraderZoneNearBlacklist,[0] ],
|
||||
["_missionNearLimit", DMS_MissionNearBlacklist, [0] ],
|
||||
["_playerNearLimit", DMS_PlayerNearBlacklist, [0] ],
|
||||
["_territoryNearLimit", DMS_TerritoryNearBlacklist, [0] ],
|
||||
["_throttleParams", DMS_ThrottleBlacklists, [true]]
|
||||
];
|
||||
|
||||
|
||||
// Some custom maps don't have the proper safePos config entries.
|
||||
// If you are using one and you have an issue with mission spawns, please create an issue on GitHub or post a comment in the DMS thread.
|
||||
switch (toLower worldName) do
|
||||
{
|
||||
case "altis": { _safePosParams = [[16000,16000],0,16000]; }; // [16000,16000] w/ radius of 16000 works well for Altis
|
||||
case "bornholm": { _safePosParams = [[11265,11265],0,12000]; }; // Thanks to thirdhero for testing this info
|
||||
case "esseker": { _safePosParams = [[6275,6350,0],0,5000]; }; // Thanks to Flowrider for this info
|
||||
case "tavi": { _safePosParams = [[12800,12800],0,12800]; }; // Thanks to JamieKG for this info
|
||||
default { _safePosParams = [[],0,-1]; }; // Use default BIS_fnc_findSafePos methods for finding map center (worldSize)
|
||||
};
|
||||
_waterSpawn = if ((count _this)>9) then {_this select 9} else {false};
|
||||
|
||||
_safePosParams append [_nearestObjectMinDistance,0,9999,0,DMS_findSafePosBlacklist];
|
||||
_isValidSpot = false;
|
||||
_attempts = 0;
|
||||
_restriction = if (_waterSpawn) then {2} else {0};
|
||||
|
||||
|
||||
_validspot = false;
|
||||
_attempts = 0;
|
||||
|
||||
while{!_validspot} do
|
||||
while{!_isValidSpot} do
|
||||
{
|
||||
_pos = _safePosParams call BIS_fnc_findSafePos;
|
||||
_attempts = _attempts+1;
|
||||
|
||||
|
||||
_pos = ([DMS_MapCenterPos,random DMS_MapRadius,random 360] call DMS_fnc_SelectOffsetPos) isFlatEmpty [_nearestObjectMinDistance, 0, 9999, 1, _restriction, _waterSpawn, objNull];
|
||||
|
||||
while {_pos isEqualTo []} do
|
||||
{
|
||||
_pos = ([DMS_MapCenterPos,random DMS_MapRadius,random 360] call DMS_fnc_SelectOffsetPos) isFlatEmpty [_nearestObjectMinDistance, 0, 9999, 1, _restriction, _waterSpawn, objNull];
|
||||
};
|
||||
|
||||
|
||||
// It will only throttle the missionNear blacklist and playerNear limits because those are the most likely to throw an exception.
|
||||
// The throttling works by decreasing the parameters by 10% every 15 attempts, until it reaches 100 meters (by default).
|
||||
if (_throttleParams && {(_attempts>=DMS_AttemptsUntilThrottle) && {(_attempts%DMS_AttemptsUntilThrottle)==0}}) then
|
||||
@ -64,15 +63,25 @@ while{!_validspot} do
|
||||
_missionNearLimit = (DMS_ThrottleCoefficient * _missionNearLimit) max DMS_MinThrottledDistance;
|
||||
_playerNearLimit = (DMS_ThrottleCoefficient * _playerNearLimit) max DMS_MinThrottledDistance;
|
||||
|
||||
(format ["FindSafePos :: Throttling _missionNearLimit to %1 and _playerNearLimit to %2 after %3 failed attempts to find a safe position! FPS: %4",_missionNearLimit,_playerNearLimit,_attempts,diag_fps]) call DMS_fnc_DebugLog;
|
||||
// SurfaceNormal is a bit more tricky than distances, so it's throttled differently. To convert from degrees to surfaceNormal, you take the cosine of the degrees from horizontal. Take the arc-cosine to convert surfaceNormal to degrees: arccos(0.8) in degrees ~= 37
|
||||
_minSurfaceNormal = (_minSurfaceNormal - 0.005) max 0.8;
|
||||
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["FindSafePos :: Throttling _missionNearLimit to %1 and _playerNearLimit to %2 and _minSurfaceNormal to %4 after %3 failed attempts to find a safe position!",_missionNearLimit,_playerNearLimit,_attempts,_minSurfaceNormal]) call DMS_fnc_DebugLog;
|
||||
};
|
||||
};
|
||||
|
||||
_validspot = [_pos, _waterNearLimit, _maxSurfaceNormal, _spawnZoneNearLimit, _traderZoneNearLimit, _missionNearLimit, _playerNearLimit] call DMS_fnc_IsValidPosition;
|
||||
_isValidSpot = [_pos, _waterNearLimit, _minSurfaceNormal, _spawnZoneNearLimit, _traderZoneNearLimit, _missionNearLimit, _playerNearLimit, _territoryNearLimit, _waterSpawn] call DMS_fnc_IsValidPosition;
|
||||
};
|
||||
|
||||
_pos set [2,0];
|
||||
|
||||
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format["FindSafePos :: Found mission position %1 in %2 attempts. _this: %3",_pos,_attempts,_this]) call DMS_fnc_DebugLog;
|
||||
};
|
||||
|
||||
|
||||
(format["FindSafePos :: Found mission position %1 with %2 params in %3 attempts. _this: %4",_pos,_safePosParams,_attempts,_this]) call DMS_fnc_DebugLog;
|
||||
|
||||
|
||||
_pos set [2, 0];
|
||||
_pos;
|
@ -36,11 +36,19 @@ try
|
||||
};
|
||||
} forEach (crew _x);
|
||||
} forEach (_pos nearEntities [["Exile_Unit_Player","LandVehicle", "Air", "Ship"], _dis]);
|
||||
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["IsPlayerNearby :: No players within %1 meters of %2!",_dis,_pos]) call DMS_fnc_DebugLog;
|
||||
};
|
||||
}
|
||||
catch
|
||||
{
|
||||
_isNear = true;
|
||||
(format ["IsPlayerNearby :: %1 is within %2 meters of %3!",_exception,_dis,_pos]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["IsPlayerNearby :: %1 is within %2 meters of %3!",_exception,_dis,_pos]) call DMS_fnc_DebugLog;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
@ -6,28 +6,32 @@
|
||||
[
|
||||
_pos, // ARRAY (position): The position to check.
|
||||
_waterNearLimit, // NUMBER (distance): Minimum distance from water.
|
||||
_maxSurfaceNormal, // NUMBER (between 0-1): Maximum "surfaceNormal"; Basically determines how steep a position is. Check the comment for config value "DMS_MaxSurfaceNormal" in config.sqf for more info
|
||||
_minSurfaceNormal, // NUMBER (between 0-1): Maximum "surfaceNormal"; Basically determines how steep a position is. Check the comment for config value "DMS_MinSurfaceNormal" in config.sqf for more info
|
||||
_spawnZoneNearLimit, // NUMBER (distance): Minimum distance from a spawn point.
|
||||
_traderZoneNearLimit, // NUMBER (distance): Minimum distance from a trader zone.
|
||||
_missionNearLimit, // NUMBER (distance): Minimum distance from another mission.
|
||||
_playerNearLimit, // NUMBER (distance): Minimum distance from a player.
|
||||
_waterSpawn // BOOLEAN: Whether or not the mission is supposed to spawn on water.
|
||||
] call DMS_fnc_IsValidPosition;
|
||||
|
||||
All parameters except "_pos" are optional.
|
||||
|
||||
|
||||
Returns whether or not the provided position matches the parameters.
|
||||
*/
|
||||
|
||||
private ["_pos", "_waterNearLimit", "_maxSurfaceNormal", "_spawnZoneNearLimit", "_traderZoneNearLimit", "_missionNearLimit", "_playerNearLimit", "_dir"];
|
||||
private ["_pos", "_nearestObjectMinDistance", "_waterNearLimit", "_minSurfaceNormal", "_spawnZoneNearLimit", "_traderZoneNearLimit", "_missionNearLimit", "_playerNearLimit", "_territoryNearLimit", "_waterSpawn", "_isValidPos", "_xpos", "_ypos"];
|
||||
|
||||
_OK = params
|
||||
[
|
||||
["_pos", [0,0,0], [[]], [2,3]],
|
||||
["_pos", [], [[]], [0,2,3]],
|
||||
["_waterNearLimit", DMS_WaterNearBlacklist, [0] ],
|
||||
["_maxSurfaceNormal", DMS_MaxSurfaceNormal, [0] ],
|
||||
["_minSurfaceNormal", DMS_MinSurfaceNormal, [0] ],
|
||||
["_spawnZoneNearLimit", DMS_SpawnZoneNearBlacklist, [0] ],
|
||||
["_traderZoneNearLimit", DMS_TraderZoneNearBlacklist,[0] ],
|
||||
["_missionNearLimit", DMS_MissionNearBlacklist, [0] ],
|
||||
["_playerNearLimit", DMS_PlayerNearBlacklist, [0] ]
|
||||
["_playerNearLimit", DMS_PlayerNearBlacklist, [0] ],
|
||||
["_territoryNearLimit", DMS_TerritoryNearBlacklist, [0] ],
|
||||
["_waterSpawn", false, [false] ]
|
||||
];
|
||||
|
||||
|
||||
@ -41,26 +45,84 @@ else
|
||||
{
|
||||
try
|
||||
{
|
||||
// Check for nearby water
|
||||
if ((_waterNearLimit>0) && {[_pos,_waterNearLimit] call DMS_fnc_isNearWater}) then
|
||||
if ((count _pos)<2) then
|
||||
{
|
||||
throw ("water");
|
||||
throw ("(ERROR UNDEFINED POSITION)");
|
||||
};
|
||||
|
||||
// Terrain steepness check
|
||||
if (((surfaceNormal _pos) select 2)<_maxSurfaceNormal) then
|
||||
if ((count _pos) isEqualTo 2) then
|
||||
{
|
||||
throw ("a steep location");
|
||||
_pos set [2, 0];
|
||||
};
|
||||
|
||||
// Check the surrounding area (within 5 meters)
|
||||
for "_dir" from 0 to 359 step 45 do
|
||||
_xpos = _pos select 0;
|
||||
_ypos = _pos select 1;
|
||||
|
||||
if ((_xpos<0) || {_ypos<0} || {_xpos>worldSize} || {_ypos>worldSize}) then
|
||||
{
|
||||
throw ("or is outside of the map edge");
|
||||
};
|
||||
|
||||
|
||||
|
||||
if (!(DMS_findSafePosBlacklist isEqualTo []) && {([_pos, DMS_findSafePosBlacklist] call BIS_fnc_isPosBlacklisted)}) then
|
||||
{
|
||||
throw ("a blacklisted position");
|
||||
};
|
||||
|
||||
|
||||
// Only do these checks if the mission is supposed to be on land.
|
||||
if (!_waterSpawn) then
|
||||
{
|
||||
// Check for nearby water
|
||||
if ((_waterNearLimit>0) && {[_pos,_waterNearLimit] call DMS_fnc_isNearWater}) then
|
||||
{
|
||||
if (((surfaceNormal ([_position,5,_dir] call DMS_fnc_SelectOffsetPos)) select 2)<_maxSurfaceNormal) then
|
||||
throw ("water");
|
||||
};
|
||||
|
||||
// Terrain steepness check
|
||||
// 0 surfacenormal means completely vertical, 1 surfaceNormal means completely flat and horizontal.
|
||||
// Take the arccos of the surfaceNormal to determine how many degrees it is from the horizontal. In SQF: {acos ((surfaceNormal _pos) select 2)}. Don't forget to define _pos.
|
||||
if ((_minSurfaceNormal>0) && {_minSurfaceNormal<=1}) then
|
||||
{
|
||||
if (((surfaceNormal _pos) select 2)<_minSurfaceNormal) then
|
||||
{
|
||||
throw ("a nearby steep location");
|
||||
throw ("a steep location");
|
||||
};
|
||||
|
||||
// Check the surrounding area (within 5 meters)
|
||||
private "_dir";
|
||||
for "_dir" from 0 to 359 step 45 do
|
||||
{
|
||||
if (((surfaceNormal ([_pos,5,_dir] call DMS_fnc_SelectOffsetPos)) select 2)<_minSurfaceNormal) then
|
||||
{
|
||||
throw ("a nearby steep location");
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
// Check to see if the position is actually water.
|
||||
if !(surfaceIsWater _pos) then
|
||||
{
|
||||
throw ("land");
|
||||
};
|
||||
|
||||
// Check the depth of the water.
|
||||
if ((getTerrainHeightASL _pos)<-DMS_MinWaterDepth) then
|
||||
{
|
||||
throw ("shallow water");
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
{
|
||||
if (((getMarkerPos _x) distance2D _pos)<=_missionNearLimit) then
|
||||
{
|
||||
throw ("an A3XAI mission");
|
||||
};
|
||||
} forEach (missionNamespace getVariable ["A3XAI_mapMarkerArray",[]]);
|
||||
|
||||
{
|
||||
// Check for nearby spawn points
|
||||
@ -81,24 +143,40 @@ else
|
||||
_missionPos = missionNamespace getVariable [format ["%1_pos",_x], []];
|
||||
if (!(_missionPos isEqualTo []) && {(_missionPos distance2D _pos)<=_missionNearLimit}) then
|
||||
{
|
||||
throw ("another mission");
|
||||
throw ("a mission");
|
||||
};
|
||||
|
||||
if (((_x find "VEMFr_DynaLocInva_ID")>0) && {((getMarkerPos _x) distance2D _pos)<=_missionNearLimit}) then
|
||||
{
|
||||
throw ("a VEMF mission");
|
||||
};
|
||||
};
|
||||
} forEach allMapMarkers;
|
||||
|
||||
|
||||
// Check for nearby players
|
||||
// This is done last because it is likely to be the most resource intensive.
|
||||
if ((_playerNearLimit>0) && {[_pos,_playerNearLimit] call DMS_fnc_IsPlayerNearby}) then
|
||||
{
|
||||
throw ("players");
|
||||
throw ("a player");
|
||||
};
|
||||
|
||||
if ((_territoryNearLimit>0) && {[_pos,_territoryNearLimit] call ExileClient_util_world_isTerritoryInRange}) then
|
||||
{
|
||||
throw ("a territory");
|
||||
};
|
||||
|
||||
|
||||
|
||||
// No exceptions found
|
||||
_isValidPos = true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
(format ["IsValidPosition :: Exception in attempt %1 | Position %2 is too close to %3!",_attempts,_pos,_exception]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["IsValidPosition :: Position %1 is too close to %2!",_pos,_exception]) call DMS_fnc_DebugLog;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
146
@ExileServer/addons/a3_dms/scripts/fn_MissionParams.sqf
Normal file
146
@ExileServer/addons/a3_dms/scripts/fn_MissionParams.sqf
Normal file
@ -0,0 +1,146 @@
|
||||
/*
|
||||
DMS_fnc_MissionParams
|
||||
Created by eraser1
|
||||
|
||||
Takes input of any argument and converts it into a standard format for DMS missions.
|
||||
|
||||
It will use provided mission position requirements (if they exist) and simply return a position that matches the requirements.
|
||||
|
||||
If arguments provided do not have the mission position information, index 0 of the returned array will be an empty array.
|
||||
Any other passed values (other than empty array "[]") will be added to the end of the returned array.
|
||||
|
||||
Usage:
|
||||
[
|
||||
_findSafePosParams, // ARRAY: If a new mission position has to be generated, these values are passed to "DMS_fnc_FindSafePos" if the provided _missionPosition is improperly defined, or if it doesn't have to spawn at the provided position and that position is invalid.
|
||||
[
|
||||
_missionPosition, // ARRAY (position ATL): Defines where the mission will spawn
|
||||
_forceSpawn // (OPTIONAL) BOOL: Whether or not to force the mission to spawn at that location. Setting "_forceSpawn" to true means that the "DMS_fnc_IsValidPosition" check will be skipped, and the provided _missionPosition will be used regardless.
|
||||
],
|
||||
[
|
||||
_extraParam_1, // (OPTIONAL) ANY: Extra parameter(s) that may be used by the mission.
|
||||
_extraParam_2, // (OPTIONAL) ANY: Extra parameter(s) that may be used by the mission.
|
||||
...
|
||||
_extraParam_N // (OPTIONAL) ANY: Extra parameter(s) that may be used by the mission.
|
||||
]
|
||||
] call DMS_fnc_MissionParams;
|
||||
|
||||
or
|
||||
|
||||
_extraParams call DMS_fnc_MissionParams; // This will simply cause the function to use the default values for "DMS_fnc_FindSafePos" to generate a mission position. The "_extraParam" will be added to the back.
|
||||
|
||||
NOTE: If you pass an array with more than 1 element as an argument, the array must be in the form of the first example or the example below, or else you may get unexpected results.
|
||||
If you want to pass some _extraParams as an array but spawn the mission at a random (valid) position, then call it as:
|
||||
[
|
||||
_findSafePosParams,
|
||||
[
|
||||
[],
|
||||
],
|
||||
_extraParams_ARRAY
|
||||
] call DMS_fnc_MissionParams;
|
||||
|
||||
|
||||
|
||||
Returns an array in the form
|
||||
[
|
||||
_missionPos,
|
||||
_extraParams
|
||||
]
|
||||
*/
|
||||
|
||||
private ["_parsedParams", "_extraParams", "_missionPosition", "_OK", "_posInfo", "_forceSpawn", "_findSafePosParams"];
|
||||
|
||||
|
||||
_extraParams = [];
|
||||
|
||||
if (isNil "_this") then
|
||||
{
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["MissionParams :: Calling with nil parameter; Setting _missionPosition to generated position with default values."]) call DMS_fnc_DebugLog;
|
||||
};
|
||||
|
||||
// Simply use generated position with default values.
|
||||
_missionPosition =
|
||||
[
|
||||
25,DMS_WaterNearBlacklist,DMS_MaxSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_TerritoryNearBlacklist,DMS_ThrottleBlacklists
|
||||
] call DMS_fnc_FindSafePos;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (((typeName _this)=="ARRAY") && {(count _this)>1}) then
|
||||
{
|
||||
_OK = params
|
||||
[
|
||||
["_findSafePosParams",[25,DMS_WaterNearBlacklist,DMS_MaxSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_TerritoryNearBlacklist,DMS_ThrottleBlacklists],[[]]],
|
||||
["_posInfo",[],[[]],[1,2]]
|
||||
];
|
||||
|
||||
if (_OK) then
|
||||
{
|
||||
_missionPosition = _posInfo select 0;
|
||||
_forceSpawn = if ((count _posInfo)>1) then {_posInfo select 1} else {false};
|
||||
|
||||
if (((typeName _missionPosition)!="ARRAY") || {(count _missionPosition)<2}) then
|
||||
{
|
||||
// Empty array means that you want to generate a mission position.
|
||||
if !(_missionPosition isEqualTo []) then
|
||||
{
|
||||
diag_log format ["DMS ERROR :: Calling MissionParams with invalid _missionPosition: %1 | Generating new one with _findSafePosParams: %2",_missionPosition,_findSafePosParams];
|
||||
};
|
||||
|
||||
// Passed _missionPosition parameter is invalid, so we just find a position the regular way.
|
||||
_missionPosition = _findSafePosParams call DMS_fnc_FindSafePos;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Make sure z-pos is defined.
|
||||
if ((count _missionPosition) isEqualTo 2) then
|
||||
{
|
||||
_missionPosition set [2,0];
|
||||
};
|
||||
|
||||
if (!_forceSpawn && {!([_missionPosition,DMS_WaterNearBlacklist,DMS_MaxSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_TerritoryNearBlacklist] call DMS_fnc_IsValidPosition)}) then
|
||||
{
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["MissionParams :: Finding new position as provided non-mandatory _missionPosition (%1) is invalid. Finding new position.",_missionPosition]) call DMS_fnc_DebugLog;
|
||||
};
|
||||
// Passed _missionPosition parameter is not mandatory and doesn't meet requirements, so we just find a new position.
|
||||
_missionPosition = _findSafePosParams call DMS_fnc_FindSafePos;
|
||||
};
|
||||
};
|
||||
|
||||
// Assign "_extraParams" if they exist.
|
||||
_extraParams = if ((count _this)>2) then {_this select 2} else {[]};
|
||||
}
|
||||
else
|
||||
{
|
||||
diag_log format ["DMS ERROR :: Calling MissionParams with invalid _findSafePosParams or _posInfo: %1 | Generating _missionPosition with _findSafePosParams params: %2. Setting _this as _extraParams: %3",_posInfo,_findSafePosParams,_this];
|
||||
|
||||
_missionPosition = _findSafePosParams call DMS_fnc_FindSafePos;
|
||||
_extraParams = _this;
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
_missionPosition =
|
||||
[
|
||||
25,DMS_WaterNearBlacklist,DMS_MaxSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_TerritoryNearBlacklist,DMS_ThrottleBlacklists
|
||||
] call DMS_fnc_FindSafePos;
|
||||
|
||||
_extraParams = _this;
|
||||
};
|
||||
};
|
||||
|
||||
_parsedParams =
|
||||
[
|
||||
_missionPosition,
|
||||
_extraParams
|
||||
];
|
||||
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["MissionParams :: Returning _parsedParams: %1 | Calling params: %2",_parsedParams,_this]) call DMS_fnc_DebugLog;
|
||||
};
|
||||
|
||||
_parsedParams
|
@ -41,11 +41,7 @@ _exit = false;
|
||||
};
|
||||
|
||||
|
||||
_absoluteWinCondition = false;
|
||||
if (((count _x)>2) && {_x select 2}) then
|
||||
{
|
||||
_absoluteWinCondition = true;
|
||||
};
|
||||
_absoluteWinCondition = if ((count _x)>2) then {_x select 2} else {false};
|
||||
|
||||
if (!_success && {!_absoluteWinCondition}) then
|
||||
{
|
||||
@ -53,7 +49,10 @@ _exit = false;
|
||||
};
|
||||
|
||||
|
||||
(format ["MissionSuccessState :: Checking completion type ""%1"" with argument |%2|. Absolute: %3",_completionType,_completionArgs,_absoluteWinCondition]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["MissionSuccessState :: Checking completion type ""%1"" with argument |%2|. Absolute: %3",_completionType,_completionArgs,_absoluteWinCondition]) call DMS_fnc_DebugLog;
|
||||
};
|
||||
|
||||
switch (toLower _completionType) do
|
||||
{
|
||||
@ -87,7 +86,10 @@ _exit = false;
|
||||
}
|
||||
catch
|
||||
{
|
||||
(format ["MissionSuccessState :: %1",_exception]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["MissionSuccessState :: %1",_exception]) call DMS_fnc_DebugLog;
|
||||
};
|
||||
};
|
||||
} forEach _this;
|
||||
|
||||
|
@ -45,8 +45,15 @@ private ["_pos", "_success", "_timeStarted", "_timeUntilFail", "_units", "_build
|
||||
_msgLose = _x select 5 select 2;
|
||||
_markers = _x select 6;
|
||||
_missionSide = _x select 7;
|
||||
_missionDifficulty = _x select 8;
|
||||
_missionEvents = _x select 9;
|
||||
_onSuccessScripts = _x select 10 select 0;
|
||||
_onFailScripts = _x select 10 select 1;
|
||||
|
||||
(format ["MissionStatusCheck :: Checking Mission Status (index %1): ""%2"" at %3",_forEachIndex,_missionName,_pos]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["MissionsMonitor :: Checking Mission Status (index %1): ""%2"" at %3",_forEachIndex,_missionName,_pos]) call DMS_fnc_DebugLog;
|
||||
};
|
||||
|
||||
if (_success) then
|
||||
{
|
||||
@ -100,6 +107,15 @@ private ["_pos", "_success", "_timeStarted", "_timeUntilFail", "_units", "_build
|
||||
} forEach _mines;
|
||||
};
|
||||
|
||||
{
|
||||
_code = _x;
|
||||
if ((typeName _code)=="STRING") then
|
||||
{
|
||||
_code = compile _code;
|
||||
};
|
||||
call _code;
|
||||
} forEach _onSuccessScripts;
|
||||
|
||||
[_missionName,_msgWIN] call DMS_fnc_BroadcastMissionStatus;
|
||||
[_markers,"win"] call DMS_fnc_RemoveMarkers;
|
||||
|
||||
@ -138,6 +154,15 @@ private ["_pos", "_success", "_timeStarted", "_timeUntilFail", "_units", "_build
|
||||
|
||||
_arr = DMS_Mission_Arr deleteAt _forEachIndex;
|
||||
|
||||
{
|
||||
_code = _x;
|
||||
if ((typeName _code)=="STRING") then
|
||||
{
|
||||
_code = compile _code;
|
||||
};
|
||||
call _code;
|
||||
} forEach _onFailScripts;
|
||||
|
||||
[_missionName,_msgLose] call DMS_fnc_BroadcastMissionStatus;
|
||||
[_markers,"lose"] call DMS_fnc_RemoveMarkers;
|
||||
|
||||
@ -158,9 +183,18 @@ private ["_pos", "_success", "_timeStarted", "_timeUntilFail", "_units", "_build
|
||||
|
||||
_dot setMarkerText (format ["%1 (%2 %3 remaining)",_text,{alive _x} count _units,DMS_MarkerText_AIName]);
|
||||
};
|
||||
|
||||
if !(_missionEvents isEqualTo []) then
|
||||
{
|
||||
// Coming soon...
|
||||
//_x call DMS_fnc_HandleMissionEvents;
|
||||
};
|
||||
}
|
||||
catch
|
||||
{
|
||||
(format ["MissionStatusCheck :: %1",_exception]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["MissionsMonitor :: %1",_exception]) call DMS_fnc_DebugLog;
|
||||
};
|
||||
};
|
||||
} forEach DMS_Mission_Arr;
|
@ -18,7 +18,10 @@
|
||||
private ["_unit", "_killer", "_side", "_type", "_launcher", "_launcherVar", "_playerObj", "_removeAll", "_rockets", "_grpUnits", "_av", "_memCount", "_gunner", "_driver", "_gunnerIsAlive", "_driverIsAlive", "_grp", "_owner", "_start", "_roadKilled", "_veh", "_boom", "_revealAmount", "_silencer", "_moneyChange", "_repChange", "_money", "_respect", "_msgType", "_msgParams"];
|
||||
|
||||
|
||||
(format ["OnKilled :: Logging AI death with parameters: %1",_this]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["OnKilled :: Logging AI death with parameters: %1",_this]) call DMS_fnc_DebugLog;
|
||||
};
|
||||
|
||||
_unit = _this select 0 select 0;
|
||||
_killer = _this select 0 select 1;
|
||||
@ -109,7 +112,10 @@ if (!isNull _av) then
|
||||
_av spawn {sleep 1;_this enableSimulationGlobal false;};
|
||||
|
||||
|
||||
(format["OnKilled :: Destroying used AI vehicle %1, disabling simulation, and adding to cleanup.",typeOf _av]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format["OnKilled :: Destroying used AI vehicle %1, disabling simulation, and adding to cleanup.",typeOf _av]) call DMS_fnc_DebugLog;
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -182,7 +188,10 @@ if (!isNull _av) then
|
||||
|
||||
_driver enableCollisionWith _av;
|
||||
|
||||
(format["OnKilled :: Switched driver of AI Vehicle (%1) to gunner.",typeOf _av]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format["OnKilled :: Switched driver of AI Vehicle (%1) to gunner.",typeOf _av]) call DMS_fnc_DebugLog;
|
||||
};
|
||||
|
||||
if (_owner!=2) then
|
||||
{
|
||||
@ -254,7 +263,10 @@ if (isPlayer _killer) then
|
||||
{
|
||||
_boom = createVehicle ["SLAMDirectionalMine_Wire_Ammo", ASLToAGL(getPosWorld _unit), [], 0, "CAN_COLLIDE"];
|
||||
_boom setDamage 1;
|
||||
(format ["OnKilled :: %1 roadkilled an AI! Creating mine at the roadkilled AI's position!",name _killer]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["OnKilled :: %1 roadkilled an AI! Creating mine at the roadkilled AI's position!",name _killer]) call DMS_fnc_DebugLog;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
@ -20,7 +20,10 @@ _status = _this select 1;
|
||||
_text = missionNamespace getVariable [format ["%1_text",_markerDot],markerText _markerDot];
|
||||
|
||||
|
||||
(format ["RemoveMarkers :: Calling DMS_RemoveMarkers with parameters %1.",_this]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["RemoveMarkers :: Calling DMS_RemoveMarkers with parameters %1.",_this]) call DMS_fnc_DebugLog;
|
||||
};
|
||||
|
||||
|
||||
deleteMarker _markerCircle;
|
||||
@ -37,7 +40,10 @@ if (_status == "win") then
|
||||
_markerDot setMarkerColor DMS_MissionMarkerWinDotColor;
|
||||
//_markerDot spawn {sleep DMS_MissionMarkerWinDotTime;deleteMarker _this;};
|
||||
[DMS_MissionMarkerWinDotTime, {deleteMarker _this;}, _markerDot, false] call ExileServer_system_thread_addTask;
|
||||
(format ["RemoveMarkers :: %1 Marker will be removed in %2 seconds!",_markerDot,DMS_MissionMarkerWinDotTime]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["RemoveMarkers :: %1 Marker will be removed in %2 seconds!",_markerDot,DMS_MissionMarkerWinDotTime]) call DMS_fnc_DebugLog;
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -49,5 +55,8 @@ else
|
||||
_markerDot setMarkerColor DMS_MissionMarkerLoseDotColor;
|
||||
//_markerDot spawn {sleep DMS_MissionMarkerLoseDotTime;deleteMarker _this;};
|
||||
[DMS_MissionMarkerLoseDotTime, {deleteMarker _this;}, _markerDot, false] call ExileServer_system_thread_addTask;
|
||||
(format ["RemoveMarkers :: %1 Marker will be removed in %2 seconds!",_markerDot,DMS_MissionMarkerLoseDotTime]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["RemoveMarkers :: %1 Marker will be removed in %2 seconds!",_markerDot,DMS_MissionMarkerLoseDotTime]) call DMS_fnc_DebugLog;
|
||||
};
|
||||
};
|
@ -22,6 +22,16 @@ if (diag_fps >= DMS_MinServerFPS && {(count allPlayers) >= DMS_MinPlayerCount})
|
||||
private "_mission";
|
||||
_mission = DMS_BanditMissionTypesArray call BIS_fnc_selectRandom;
|
||||
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["SelectMission :: Selected bandit mission: %1"]) call DMS_fnc_DebugLog;
|
||||
};
|
||||
|
||||
[_mission] call DMS_fnc_SpawnBanditMission;
|
||||
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["SelectMission :: Spawning of bandit mission ""%1"" complete!"]) call DMS_fnc_DebugLog;
|
||||
};
|
||||
};
|
||||
};
|
@ -28,7 +28,7 @@ if (!_OK) exitWith
|
||||
[0,0,0]
|
||||
};
|
||||
|
||||
_npos = [(_pos select 0)+(sin(_dir)*_dis),(_pos select 1)+(cos(_dir)*_dis),0];
|
||||
_npos = [(_pos select 0)+(sin(_dir)*_dis),(_pos select 1)+(cos(_dir)*_dis),_pos select 2];
|
||||
|
||||
|
||||
_npos
|
@ -48,9 +48,15 @@ _client = objNull;
|
||||
if (!isNull _client) then
|
||||
{
|
||||
ExileServerOwnershipSwapQueue pushBack [_AI,_client];
|
||||
(format ["SetAILocality :: Ownership swap of %1 (%4) to %2 (%3) is added to ExileServerOwnershipSwapQueue.",_AI,name _client,getPlayerUID _client,typeName _AI]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["SetAILocality :: Ownership swap of %1 (%4) to %2 (%3) is added to ExileServerOwnershipSwapQueue.",_AI,name _client,getPlayerUID _client,typeName _AI]) call DMS_fnc_DebugLog;
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
(format ["SetAILocality :: No viable client found for the ownership of %1!",_AI]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["SetAILocality :: No viable client found for the ownership of %1!",_AI]) call DMS_fnc_DebugLog;
|
||||
};
|
||||
};
|
@ -8,59 +8,41 @@
|
||||
_pos, // Position of AI
|
||||
_count, // Number of AI
|
||||
_difficulty, // AI Difficulty: "random","hardcore","difficult","moderate", or "easy"
|
||||
_class, // AI Class: "random","assault","MG","sniper" or "unarmed" OR [_class,_launcher]
|
||||
_class, // AI Class: "random","assault","MG","sniper" or "unarmed" OR [_class,_launcherType]
|
||||
_side // Only "bandit" is supported atm
|
||||
] call DMS_fnc_SpawnAIGroup;
|
||||
|
||||
Returns AI Group
|
||||
*/
|
||||
private ["_OK", "_pos", "_count", "_difficulty", "_class", "_side", "_pos_x", "_pos_y", "_pos_z", "_launcher", "_unit", "_client"];
|
||||
private ["_OK", "_pos", "_count", "_difficulty", "_class", "_group", "_side", "_launcherType", "_launcher", "_unit", "_rocket"];
|
||||
|
||||
_OK = params
|
||||
[
|
||||
["_pos",[0,0,0],[[]],[3]],
|
||||
["_count",0,[0]],
|
||||
["_difficulty","random",[""]],
|
||||
["_class","random",[""]],
|
||||
["_side","bandit",[""]]
|
||||
["_pos","_pos ERROR",[[]],[3]],
|
||||
["_count","_count ERROR",[0]],
|
||||
["_difficulty","_difficulty ERROR",[""]],
|
||||
["_class","_class ERROR",[""]],
|
||||
["_side","_side ERROR",[""]]
|
||||
];
|
||||
|
||||
if (!_OK) then
|
||||
if (!_OK) exitWith
|
||||
{
|
||||
diag_log format ["DMS ERROR :: Calling DMS_SpawnAIGroup with invalid parameters: %1",_this];
|
||||
grpNull
|
||||
};
|
||||
|
||||
_pos_x = _pos select 0;
|
||||
_pos_y = _pos select 1;
|
||||
_pos_z = _pos select 2;
|
||||
|
||||
|
||||
(format["SpawnAIGroup :: Spawning %1 %2 %3 AI at %4 with %5 difficulty.",_count,_class,_side,_pos,_difficulty]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format["SpawnAIGroup :: Spawning %1 %2 %3 AI at %4 with %5 difficulty.",_count,_class,_side,_pos,_difficulty]) call DMS_fnc_DebugLog;
|
||||
};
|
||||
|
||||
// if soldier have AT/AA weapons
|
||||
if (typeName _class == "ARRAY") then
|
||||
{
|
||||
_launcher = _class select 1;
|
||||
_launcherType = _class select 1;
|
||||
_class = _class select 0;
|
||||
};
|
||||
|
||||
// Randomize position
|
||||
if(_pos_z == 0) then
|
||||
{
|
||||
if(round(random 1) == 1) then
|
||||
{
|
||||
_pos_x = _pos_x - (5 + random(10));
|
||||
} else {
|
||||
_pos_x = _pos_x + (5 + random(10));
|
||||
};
|
||||
|
||||
if(round(random 1) == 1) then
|
||||
{
|
||||
_pos_y = _pos_y - (5 + random(10));
|
||||
} else {
|
||||
_pos_y = _pos_y + (5 + random(10));
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
_group = createGroup (missionNamespace getVariable [format ["DMS_%1Side",_side],EAST]);
|
||||
@ -76,28 +58,41 @@ if (_count < 1) exitWith
|
||||
|
||||
for "_i" from 1 to _count do
|
||||
{
|
||||
_unit = [_group,[_pos_x,_pos_y,_pos_z],_class,_difficulty,_side,"Soldier"] call DMS_fnc_SpawnAISoldier;
|
||||
_unit = [_group,[_pos,random 5,random 360] call DMS_fnc_SelectOffsetPos,_class,_difficulty,_side,"Soldier"] call DMS_fnc_SpawnAISoldier;
|
||||
};
|
||||
|
||||
// An AI will definitely spawn with a launcher if you define type
|
||||
if ((!isNil "_launcher") || {DMS_ai_use_launchers && {(random 100) <= DMS_ai_use_launchers_chance}}) then
|
||||
if ((!isNil "_launcherType") || {DMS_ai_launchers_per_group>0}) then
|
||||
{
|
||||
if (isNil "_launcher") then
|
||||
if (isNil "_launcherType") then
|
||||
{
|
||||
_launcher = "AT";
|
||||
_launcherType = "AT";
|
||||
};
|
||||
|
||||
_launcher = ((missionNamespace getVariable [format ["DMS_AI_wep_launchers_%1",_launcher],["launch_NLAW_F"]]) call BIS_fnc_selectRandom);
|
||||
_units = units _group;
|
||||
|
||||
removeBackpackGlobal _unit;
|
||||
_unit addBackpack "B_Carryall_mcamo";
|
||||
_rocket = _launcher call DMS_fnc_selectMagazine;
|
||||
for "_i" from 0 to (((DMS_ai_launchers_per_group min _count)-1) max 0) do
|
||||
{
|
||||
if ((random 100)<DMS_ai_use_launchers_chance) then
|
||||
{
|
||||
_unit = _units select _i;
|
||||
|
||||
[_unit, _launcher, DMS_AI_launcher_ammo_count,_rocket] call BIS_fnc_addWeapon;
|
||||
_launcher = ((missionNamespace getVariable [format ["DMS_AI_wep_launchers_%1",_launcherType],["launch_NLAW_F"]]) call BIS_fnc_selectRandom);
|
||||
|
||||
_unit setVariable ["DMS_AI_Launcher",_launcher];
|
||||
|
||||
(format["SpawnAIGroup :: Giving %1 a %2 launcher with %3 %4 rockets",_unit,_launcher,DMS_AI_launcher_ammo_count,_rocket]) call DMS_fnc_DebugLog;
|
||||
removeBackpackGlobal _unit;
|
||||
_unit addBackpack "B_Carryall_mcamo";
|
||||
_rocket = _launcher call DMS_fnc_selectMagazine;
|
||||
|
||||
[_unit, _launcher, DMS_AI_launcher_ammo_count,_rocket] call BIS_fnc_addWeapon;
|
||||
|
||||
_unit setVariable ["DMS_AI_Launcher",_launcher];
|
||||
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format["SpawnAIGroup :: Giving %1 a %2 launcher with %3 %4 rockets",_unit,_launcher,DMS_AI_launcher_ammo_count,_rocket]) call DMS_fnc_DebugLog;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@ -105,10 +100,8 @@ _group selectLeader ((units _group) select 0);
|
||||
_group setFormation "WEDGE";
|
||||
|
||||
|
||||
if(_pos_z == 0) then
|
||||
{
|
||||
[_group,_pos,_difficulty,"COMBAT"] call DMS_fnc_SetGroupBehavior;
|
||||
};
|
||||
|
||||
[_group,_pos,_difficulty,"COMBAT"] call DMS_fnc_SetGroupBehavior;
|
||||
|
||||
|
||||
diag_log format ["DMS_SpawnAIGroup :: Spawned %1 AI at %2.",_count,_pos];
|
||||
|
@ -221,7 +221,10 @@ else
|
||||
diag_log format ["DMS ERROR :: Calling DMS_SpawnAISoldier with invalid _customGearSet: %1 | _this: %2",_customGearSet,_this];
|
||||
};
|
||||
|
||||
(format ["SpawnAISoldier :: Equipping unit %1 with _customGearSet: %2",_unit,_customGearSet]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["SpawnAISoldier :: Equipping unit %1 with _customGearSet: %2",_unit,_customGearSet]) call DMS_fnc_DebugLog;
|
||||
};
|
||||
|
||||
// Clothes
|
||||
if !(_helmet isEqualTo "") then
|
||||
@ -304,16 +307,24 @@ else
|
||||
// Soldier killed event handler
|
||||
_unit addMPEventHandler ["MPKilled",'if (isServer) then {[_this, '+str _side+', '+str _type+'] call DMS_fnc_OnKilled;};'];
|
||||
|
||||
// Remove ramming damage from players. Will not work if unit is not local (offloaded)
|
||||
// Remove ramming damage from players. Also remove any damage within 5 seconds of spawning.
|
||||
// Will not work if unit is not local (offloaded)
|
||||
if (DMS_ai_disable_ramming_damage) then
|
||||
{
|
||||
_unit addEventHandler ["HandleDamage",
|
||||
{
|
||||
private ["_unit", "_dmg", "_source", "_projectile"];
|
||||
_unit = _this select 0;
|
||||
_dmg = _this select 2;
|
||||
if (isPlayer (_this select 3) && {(_this select 4)==""}) then
|
||||
_source = _this select 3;
|
||||
_projectile = _this select 4;
|
||||
_spawnTime = _unit getVariable ["DMS_AISpawnTime", time];
|
||||
|
||||
if (((_projectile=="") && {isPlayer _source}) || {((time - _spawnTime)<5) && {!(isPlayer _source)}}) then
|
||||
{
|
||||
_dmg = 0;
|
||||
};
|
||||
|
||||
_dmg
|
||||
}];
|
||||
};
|
||||
@ -324,12 +335,18 @@ _unit enableAI "MOVE";
|
||||
_unit enableAI "ANIM";
|
||||
_unit enableAI "FSM";
|
||||
|
||||
_unit setVariable ["DMS_AISpawnTime", time];
|
||||
|
||||
if (_type=="Soldier") then
|
||||
{
|
||||
_unit setVariable ["DMS_AISpawnPos",_pos];
|
||||
_unit setVariable ["DMS_LastAIDistanceCheck",time];
|
||||
};
|
||||
|
||||
(format ["SpawnAISoldier :: Spawned a %1 %2 %6 AI at %3 with %4 difficulty to group %5",_class,_side,_pos,_difficulty,_group,_type]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["SpawnAISoldier :: Spawned a %1 %2 %6 AI at %3 with %4 difficulty to group %5",_class,_side,_pos,_difficulty,_group,_type]) call DMS_fnc_DebugLog;
|
||||
};
|
||||
|
||||
|
||||
_unit
|
||||
|
@ -56,7 +56,7 @@ _guns = [];
|
||||
_MGClass = DMS_static_weapons call BIS_fnc_selectRandom;
|
||||
};
|
||||
|
||||
_gun = createVehicle [_MGClass, _pos, [], 0, "CAN_COLLIDE"];
|
||||
_gun = createVehicle [_MGClass, [0,0,0], [], 0, "CAN_COLLIDE"];
|
||||
_gun setDir (random 360);
|
||||
_gun setPosATL _pos;
|
||||
_gun addEventHandler ["GetOut",{(_this select 0) setDamage 1;}];
|
||||
@ -70,10 +70,16 @@ _guns = [];
|
||||
reload _unit;
|
||||
_unit setVariable ["DMS_AssignedVeh",_gun];
|
||||
|
||||
(format ["SpawnAIStatic :: Created unit %1 at %2 as static gunner in %3",_unit,_pos,_gun]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["SpawnAIStatic :: Created unit %1 at %2 as static gunner in %3",_unit,_pos,_gun]) call DMS_fnc_DebugLog;
|
||||
};
|
||||
} forEach _positions;
|
||||
|
||||
|
||||
(format ["SpawnAIStatic :: Created %1 static AI with parameters: %2",count _positions,_this]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["SpawnAIStatic :: Created %1 static AI with parameters: %2",count _positions,_this]) call DMS_fnc_DebugLog;
|
||||
};
|
||||
|
||||
_guns
|
@ -81,6 +81,9 @@ _gunner setVariable ["DMS_AssignedVeh",_veh];
|
||||
|
||||
[_driver,_gunner] joinSilent _group;
|
||||
|
||||
(format ["SpawnAIVehicle :: Created a %1 armed vehicle (%2) at %3 with %4 difficulty to group %5",_side,_vehClass,_spawnPos,_difficulty,_group]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["SpawnAIVehicle :: Created a %1 armed vehicle (%2) at %3 with %4 difficulty to group %5",_side,_vehClass,_spawnPos,_difficulty,_group]) call DMS_fnc_DebugLog;
|
||||
};
|
||||
|
||||
_veh
|
@ -23,12 +23,7 @@ if !(_missionType in DMS_BanditMissionTypesArray) then
|
||||
}
|
||||
else
|
||||
{
|
||||
_parameters = [];
|
||||
|
||||
if ((count _this)>1) then
|
||||
{
|
||||
_parameters = _this select 1;
|
||||
};
|
||||
_parameters = if ((count _this)>1) then {_this select 1} else {[]};
|
||||
|
||||
DMS_MissionCount = DMS_MissionCount + 1;
|
||||
DMS_RunningBMissionCount = DMS_RunningBMissionCount + 1;
|
||||
@ -39,5 +34,8 @@ else
|
||||
DMS_BMissionLastStart = diag_tickTime;
|
||||
|
||||
|
||||
(format ["SelectMission :: Spawned mission %1 with parameters (%2) | DMS_BMissionDelay set to %3 seconds",str _missionType,_parameters,DMS_BMissionDelay]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["SelectMission :: Spawned mission %1 with parameters (%2) | DMS_BMissionDelay set to %3 seconds",str _missionType,_parameters,DMS_BMissionDelay]) call DMS_fnc_DebugLog;
|
||||
};
|
||||
};
|
@ -4,8 +4,9 @@
|
||||
|
||||
Usage:
|
||||
[
|
||||
_crateClassName,
|
||||
_pos
|
||||
_crateClassName, // STRING: The classname of the crate you want to spawn.
|
||||
_pos, // ARRAY (position): Where to spawn the crate.
|
||||
_spawnATL // (OPTIONAL) BOOLEAN: Whether or not to spawn the crate ATL (Above Terrain Level) or ASL (Above Sea Level). Default: true (ATL)
|
||||
] call DMS_fnc_SpawnCrate;
|
||||
Returns crate object
|
||||
|
||||
@ -15,17 +16,37 @@ private ["_crateClassName", "_pos", "_crate"];
|
||||
|
||||
_OK = params
|
||||
[
|
||||
["_crateClassName","ERROR",[""]],
|
||||
["_pos","ERROR",[[]],[3]]
|
||||
["_crateClassName","_crateClassName ERROR",[""]],
|
||||
["_pos","_pos ERROR",[[]],[3]]
|
||||
];
|
||||
|
||||
if (!_OK) then
|
||||
if (!_OK) exitWith
|
||||
{
|
||||
diag_log format ["DMS ERROR :: Calling DMS_SpawnCrate with invalid parameters: %1",_this];
|
||||
objNull
|
||||
};
|
||||
|
||||
if !(isClass (configFile >> "CfgVehicles" >> _crateClassName)) exitWith
|
||||
{
|
||||
diag_log format ["DMS ERROR :: Calling DMS_fnc_SpawnCrate with non-existent vehicle className: %1",_crateClassName];
|
||||
objNull
|
||||
};
|
||||
|
||||
_spawnATL = if ((count _this)>2) then {_this select 2} else {true};
|
||||
|
||||
_crate = createVehicle [_crateClassName,_pos,[], 0, "CAN_COLLIDE"];
|
||||
|
||||
_crate setDir (random 360);
|
||||
|
||||
if (_spawnATL) then
|
||||
{
|
||||
_crate setPosATL _pos;
|
||||
}
|
||||
else
|
||||
{
|
||||
_crate setPosASL _pos;
|
||||
};
|
||||
|
||||
_crate allowDamage false;
|
||||
|
||||
clearWeaponCargoGlobal _crate;
|
||||
|
@ -7,7 +7,7 @@
|
||||
_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)
|
||||
_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;
|
||||
*/
|
||||
@ -43,6 +43,13 @@ if (DMS_SpawnMinesAroundMissions) then
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
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 ((typeName _difficulty)=="STRING") then
|
||||
{
|
||||
@ -61,7 +68,7 @@ if (DMS_SpawnMinesAroundMissions) then
|
||||
private ["_minePos", "_mine"];
|
||||
|
||||
_minePos = [_centerPos,random _radius,random 360] call DMS_fnc_SelectOffsetPos;
|
||||
_mine = createMine ["ATMine", _minePos, [], 0];
|
||||
_mine = createMine ["ATMine", [0,0,0], [], 0];
|
||||
|
||||
// Fixes players shooting the mine and causing premature 'splosions
|
||||
if (DMS_BulletProofMines) then
|
||||
@ -71,6 +78,7 @@ if (DMS_SpawnMinesAroundMissions) then
|
||||
|
||||
//In case you're using directional mines such as tripwires/SLAMs
|
||||
_mine setDir (random 360);
|
||||
_mine setPosATL _minePos;
|
||||
|
||||
_AISide revealMine _mine;
|
||||
|
||||
@ -83,8 +91,9 @@ if (DMS_SpawnMinesAroundMissions) then
|
||||
_randDirOffset = random 45;
|
||||
for "_i" from 0 to 359 step 90 do
|
||||
{
|
||||
_sign = createVehicle ["Land_Sign_Mines_F",[_centerPos, _radius+2, _randDirOffset+_i] call DMS_fnc_SelectOffsetPos, [], 0, "CAN_COLLIDE"];
|
||||
_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
|
||||
@ -92,7 +101,10 @@ if (DMS_SpawnMinesAroundMissions) 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;
|
||||
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;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
@ -1,7 +1,14 @@
|
||||
/*
|
||||
DMS_fnc_SpawnNonPersistentVehicle
|
||||
|
||||
Spawn a non-saved vehicle in Exile
|
||||
Spawns a vehicle, but it isn't saved to database by this function.
|
||||
This function takes into consideration Exile config settings for enabling/disabling Night Vision and Thermal Equipment on a vehicle.
|
||||
It will also apply all regular Exile EventHandlers, as well as an additional "RopeAttach" EventHandler that will enable simulation on a vehicle that is about to be lifted to prevent issues. (Only for helis)
|
||||
|
||||
The vehicle is LOCKED, has godmode, disabled simulation, and is not able to be slingloaded on spawn.
|
||||
|
||||
NOTE: This function only takes ATL, and will not necessarily spawn directly on the given pos. It will attempt to find a clear position for the given vehicle, and then spawn it at the "clear" position.
|
||||
If you want the vehicle to be placed precisely at the position provided, you will have to do a setPosXXX at that position on the vehicle after spawning.
|
||||
|
||||
Created by Zupa
|
||||
Edited by eraser1
|
||||
@ -29,7 +36,14 @@ _OK = params
|
||||
|
||||
if (!_OK) exitWith
|
||||
{
|
||||
diag_log format ["DMS ERROR :: Calling DMS_SpawnNonPersistentVehicle with invalid parameters: %1",_this];
|
||||
diag_log format ["DMS ERROR :: Calling DMS_fnc_SpawnNonPersistentVehicle with invalid parameters: %1",_this];
|
||||
objNull
|
||||
};
|
||||
|
||||
if !(isClass (configFile >> "CfgVehicles" >> _vehicleClass)) exitWith
|
||||
{
|
||||
diag_log format ["DMS ERROR :: Calling DMS_fnc_SpawnNonPersistentVehicle with non-existent vehicle className: %1",_vehicleClass];
|
||||
objNull
|
||||
};
|
||||
|
||||
_vehpos = [];
|
||||
@ -45,10 +59,10 @@ _vehpos set [2, 0.1];
|
||||
|
||||
_vehObj = createVehicle [_vehicleClass, _vehpos, [], 0, "CAN_COLLIDE"];
|
||||
|
||||
clearBackpackCargoGlobal _vehObj;
|
||||
clearItemCargoGlobal _vehObj;
|
||||
clearMagazineCargoGlobal _vehObj;
|
||||
clearWeaponCargoGlobal _vehObj;
|
||||
clearBackpackCargoGlobal _vehObj;
|
||||
clearItemCargoGlobal _vehObj;
|
||||
clearMagazineCargoGlobal _vehObj;
|
||||
clearWeaponCargoGlobal _vehObj;
|
||||
|
||||
if (_vehicleClass isKindOf "I_UGV_01_F") then
|
||||
{
|
||||
@ -65,8 +79,11 @@ if (getNumber (configFile >> "CfgSettings" >> "VehicleSpawn" >> "thermalVision")
|
||||
|
||||
_vehObj setFuel (0.75+(random 0.25));
|
||||
_vehObj setDir (random 360);
|
||||
_vehObj setPosATL _vehpos;
|
||||
_vehObj setVectorUp (surfaceNormal _vehpos);
|
||||
|
||||
if ((getTerrainHeightASL _vehpos)>0) then
|
||||
{
|
||||
_vehObj setVectorUp (surfaceNormal _vehpos);
|
||||
};
|
||||
|
||||
_vehObj setVariable ["ExileIsPersistent", false];
|
||||
_vehObj addMPEventHandler ["MPKilled", { if !(isServer) exitWith {}; _this call ExileServer_object_vehicle_event_onMPKilled;}];
|
||||
@ -85,9 +102,9 @@ if (_vehObj isKindOf "Helicopter") then
|
||||
}];
|
||||
};
|
||||
|
||||
if (!isNil "RS_VLS") then
|
||||
if (!isNil "AVS_Version") then
|
||||
{
|
||||
[_vehObj] call RS_VLS_sanitizeVehicle;
|
||||
_vehObj call AVS_fnc_sanitizeVehicle;
|
||||
};
|
||||
|
||||
_vehObj lock 2;
|
||||
@ -95,7 +112,10 @@ _vehObj allowDamage false;
|
||||
_vehObj enableRopeAttach false;
|
||||
_vehObj enableSimulationGlobal false;
|
||||
|
||||
(format ["SpawnNonPersistentVehicle :: Created %1 at %2 with calling parameters: %3",_vehObj,_vehpos,_this]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["SpawnNonPersistentVehicle :: Created %1 at %2 with calling parameters: %3",_vehObj,_vehpos,_this]) call DMS_fnc_DebugLog;
|
||||
};
|
||||
|
||||
|
||||
_vehObj
|
||||
|
@ -7,6 +7,7 @@
|
||||
_vehicleClass, // STRING: Vehicle classname to spawn.
|
||||
_pos, // ARRAY (positionATL or position2d): Where the vehicle will be spawned (strict)
|
||||
_pinCode // STRING or NUMBER: String has to be 4 digits. Number has to be between 0-9999, and will be automatically formatted.
|
||||
_spawnATL // (OPTIONAL) BOOLEAN: Whether or not to spawn the vehicle ATL (Above Terrain Level) or ASL (Above Sea Level). Default: true (ATL)
|
||||
] call DMS_fnc_SpawnPersistentVehicle;
|
||||
|
||||
Returns the created vehicle object.
|
||||
@ -31,6 +32,11 @@ try
|
||||
throw (format ["invalid parameters: %1",_this]);
|
||||
};
|
||||
|
||||
if !(isClass (configFile >> "CfgVehicles" >> _vehicleClass)) then
|
||||
{
|
||||
throw (format ["non-existent vehicle className: %1",_vehicleClass]);
|
||||
};
|
||||
|
||||
|
||||
if ((count _pos) isEqualTo 2) then
|
||||
{
|
||||
@ -74,9 +80,19 @@ try
|
||||
throw (format ["invalid STRING _pinCode value (must be 4 digits): %1",_pinCode]);
|
||||
};
|
||||
|
||||
_spawnATL = if ((count _this)>3) then {_this select 3} else {true};
|
||||
|
||||
// Create and set the vehicle
|
||||
_vehObj = [_vehicleClass,_pos] call DMS_fnc_SpawnNonPersistentVehicle;
|
||||
_vehObj setPosATL _pos;
|
||||
|
||||
if (_spawnATL) then
|
||||
{
|
||||
_vehObj setPosATL _pos;
|
||||
}
|
||||
else
|
||||
{
|
||||
_vehObj setPosASL _pos;
|
||||
};
|
||||
|
||||
// Save vehicle on exit.
|
||||
_vehObj addEventHandler ["GetOut", { _this call ExileServer_object_vehicle_event_onGetOut}];
|
||||
|
@ -80,7 +80,10 @@ try
|
||||
}
|
||||
catch
|
||||
{
|
||||
(format ["TargetsKilled :: %1 is still alive! All of %2 are not yet killed!",_exception,_this]) call DMS_fnc_DebugLog;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
(format ["TargetsKilled :: %1 is still alive! All of %2 are not yet killed!",_exception,_this]) call DMS_fnc_DebugLog;
|
||||
};
|
||||
};
|
||||
|
||||
_killed;
|
Binary file not shown.
38
README.md
38
README.md
@ -1,8 +1,8 @@
|
||||
# To the User:
|
||||
####Read through the instructions carefully. Before leaving any questions regarding DMS, please read through the [DMS "config.sqf"](https://github.com/Defent/DMS_Exile/blob/master/%40ExileServer/addons/a3_dms/config.sqf) ; the majority of the questions we receive are answered (directly or indirectly) by the config.
|
||||
####Read the instructions carefully. Before leaving any questions regarding DMS, please read through the [DMS "config.sqf"](https://github.com/Defent/DMS_Exile/blob/master/%40ExileServer/addons/a3_dms/config.sqf) ; the majority of the questions we receive are answered (directly or indirectly) by the config.
|
||||
|
||||
####Disclaimer:
|
||||
Defent's Mission System (DMS) is written from the ground up to be an efficient, easy to install, and vastly customizable mission system for the ArmA 3 [Exile Mod](http://www.exilemod.com/). You are perfectly welcome to port DMS or any of its functions for any other mod or (legal) purposes; and leaving credits is appreciated.
|
||||
Defent's Mission System (DMS) is written from the ground up to be an efficient, easy to install, and vastly customizable mission system for the ArmA 3 [Exile Mod](http://www.exilemod.com/). You are perfectly welcome to port DMS or any of its functions for any other mod or (legal) purposes. Providing credit is appreciated.
|
||||
|
||||
However, creating such a mission system takes a lot of time and testing. We (the authors of DMS) are not perfect, and as a result, there may be bugs, glitches, and/or errors within DMS. We appreciate your co-operation in identifying and resolving such issues to improve DMS; however we are not liable for any issues resulting from the usage of DMS on/by your server. We are also not liable to help you in resolving any issues that may arise, although we will attempt to help you to some degree in most cases.
|
||||
|
||||
@ -58,6 +58,7 @@ ___
|
||||
- [Defent](https://github.com/Defent) from [NumenaDayZ](http://numenadayz.com/).
|
||||
- [eraser1](https://github.com/eraser1) from [TrainwreckDayZ](http://www.trainwreckdayz.com/home).
|
||||
|
||||
|
||||
### Thanks:
|
||||
- [Zupa](https://github.com/Windmolders) for suggestions and coding help.
|
||||
- [Nawuko](https://github.com/Nawuko) for catching a silly mistake :P
|
||||
@ -68,6 +69,39 @@ ___
|
||||
___
|
||||
|
||||
# Changelog:
|
||||
#### October 17, 2015 (2:30 PM CST-America):
|
||||
* **NEW CONFIG VALUES**:
|
||||
|
||||
|DMS_TimeToFirstMission|
|
||||
|DMS_ShowDifficultyColorLegend|
|
||||
|DMS_TerritoryNearBlacklist|
|
||||
|DMS_MinSurfaceNormal| (Used to be DMS_MaxSurfaceNormal, simply renamed)
|
||||
|DMS_ai_launchers_per_group|
|
||||
* **UPDATING ALL OF YOUR MISSION FILES IS HIGHLY RECOMMENDED UNLESS YOU KNOW WHAT YOU'RE DOING**
|
||||
* RENAMED "DMS_MaxSurfaceNormal" to "DMS_MinSurfaceNormal". I must have been very tired when I named it...
|
||||
* DMS_MinSurfaceNormal is now 0.9 by default, but will be 0.95 for Altis and Bornholm (since they're relatively large/flat maps). Esseker is still 0.85. If you want to convert DMS_MinSurfaceNormal to degrees, you would take the arc-cosine of the surfaceNormal, and that will give you the degrees from horizontal. For example, arccos(0.9) is about 25 degrees. Google: "arccos(0.9) in degrees"
|
||||
* Tweaked and rebalanced "DMS_BanditMissionTypes". Most of the spawn chances are the same, they're just reduced in order to prevent the creation of arrays that are far larger than they need to be.
|
||||
* You can now manually define how long it takes for the first mission to spawn after a restart.
|
||||
* DMS will now by default create markers on the bottom left of the map to show which colors correspond to which difficulty. It isn't very pretty, but it gets the point across.
|
||||
* DMS will now manually calculate the center of the map and its radius, if it isn't preconfigured by DMS.
|
||||
* You can now specify the vehicles to spawn for missions: "bandits", "cardealer", "construction", "donthasslethehoff", and "thieves".
|
||||
* You can now specify the spawning location of any mission (and whether or not to use an alternative location if the provided location is invalid). This will allow for easy integration of DMS into admin tools.
|
||||
* Added support for scripts to be executed on mission completion or mission failure (this will allow you to have "multi-part" missions, where you would simply spawn the next part of the mission if the previous is completed).
|
||||
* Restructured DMS_DEBUG from the previous patch in favor of a more "optimized" method.
|
||||
* DMS_fnc_findSafePos is completely overhauled; DMS no longer uses "BIS_fnc_findSafePos". It also now throttles minSurfaceNormal on repeated failure. You can now determine whether or not the mission should spawn on water (however, I don't suggest you use this function for water spawns yet).
|
||||
* You can also now define a minimum distance from other territories for missions.
|
||||
* DMS_fnc_IsValidPosition will now check for water depth if the provided position is meant to be checked as a "water spawn". It will now also check for nearby missions from A3XAI or VEMF (untested).
|
||||
* DMS_fnc_IsValidPosition now checks whether or not the position is outside of the map borders.
|
||||
* DMS_fnc_SelectOffsetPos will now return the 3rd element of the provided position as-is.
|
||||
* You can now have multiple AI within a group with a launcher.
|
||||
* AI now have a 5-second godmode after spawning.
|
||||
* You can now spawn a crate using ASL pos. DMS_fnc_SpawnCrate will also make sure that the provided classname is valid.
|
||||
* Just like SpawnCrate, "DMS_fnc_SpawnNonPersistentVehicle" and "DMS_fnc_SpawnPersistentVehicle" will now make sure that the provided classname is valid.
|
||||
* "DMS_fnc_SpawnPersistentVehicle" now supports ASL spawning.
|
||||
* Added support for [Rod Serling's](https://github.com/Rod-Serling) AVS.
|
||||
* General optimization.
|
||||
|
||||
|
||||
#### October 9, 2015 (8:30 PM CST-America):
|
||||
* **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).
|
||||
|
Loading…
x
Reference in New Issue
Block a user