Some more required changes... sorry

* **You must update all of your mission files; the mission message
system as well as the calling parameters for DMS_fnc_FindSafePos have
been overhauled and will be incompatible with previous versions.**
* NEW CONFIG VALUES:

|DMS_ThrottleBlacklists|
|DMS_AttemptsUntilThrottle|
|DMS_ThrottleCoefficient|
|DMS_MinThrottledDistance|
* Decreased
"DMS_TraderZoneNearBlacklist","DMS_MissionNearBlacklist","DMS_WaterNearBlacklist"
* Changed "DMS_dynamicText_Color" to "#FFFFFF" (white)
* Replaced weapon classes in "DMS_CrateCase_Sniper" to the base classes;
all attachments should now spawn in the box separately.
* New function DMS_fnc_IsValidPosition (uses logic that was previously
from "DMS_fnc_FindSafePos").
* You can now manually define every individual parameter for
DMS_fnc_findSafePos per-mission, instead of using global parameters.
* AI will now be offloaded to an HC even with "DMS_ai_offload_to_client"
set to false.
* All of the previously "supported" values for
"DMS_PlayerNotificationTypes" are now PROPERLY supported.
DMS_PlayerNotificationTypes is now set to default "dynamicTextRequest"
and "systemChatRequest".
* Tweaked "cardealer" mission, the cars should no longer spawn inside of
each other.
This commit is contained in:
eraser1 2015-10-03 22:32:42 -05:00
parent 1997fb7614
commit 8562289765
31 changed files with 441 additions and 212 deletions

View File

@ -44,6 +44,7 @@ class CfgFunctions
class ImportFromM3E_Convert {};
class IsPlayerNearby {};
class IsNearWater {};
class IsValidPosition {};
class MissionsMonitor {};
class MissionSuccessState {};
class OnKilled {};

View File

@ -46,11 +46,17 @@ DMS_DEBUG = false;
/*Mission Cleanup/Timeout settings*/
/*Mission spawn location settings*/
DMS_ThrottleBlacklists = true; // Whether or not to "throttle" the blacklist distance parameters in DMS_fnc_FindSafePos. This will reduce the values of the minimum
//distances for some of the below parameters if several attempts have been made, but a suitable position was not yet found. This
//should help with server performance drops when spawning a mission, as DMS_fnc_findSafePos is the most resource-intensive function.
DMS_AttemptsUntilThrottle = 15; // How many attempts until the parameters are throttled.
DMS_ThrottleCoefficient = 0.9; // How much the parameters are throttled. The parameters are multiplied by the coefficient, so 0.9 means 90% of whatever the parameter was.
DMS_MinThrottledDistance = 100; // The minimum distance to which it will throttle. If the throttled value is less than this, then this value is used instead.
DMS_PlayerNearBlacklist = 2000; // Missions won't spawn in a position this many meters close to a player
DMS_SpawnZoneNearBlacklist = 2500; // Missions won't spawn in a position this many meters close to a spawn zone
DMS_TraderZoneNearBlacklist = 3000; // Missions won't spawn in a position this many meters close to a trader zone
DMS_MissionNearBlacklist = 4000; // Missions won't spawn in a position this many meters close to another mission
DMS_WaterNearBlacklist = 750; // Missions won't spawn in a position this many meters close to water
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
/*Mission spawn location settings*/
@ -79,12 +85,12 @@ DMS_DEBUG = false;
/*Mission notification settings*/
DMS_PlayerNotificationTypes = [ // Notification types. Supported values are: ["dynamicTextRequest", "standardHintRequest", "systemChatRequest"]
//"dynamicTextRequest", <--- Text formatting makes this weird...
"standardHintRequest"
//"systemChatRequest"
"dynamicTextRequest",
//"standardHintRequest",
"systemChatRequest"
];
DMS_dynamicText_Size = 0.65; // Dynamic Text size for "dynamicTextRequest" notification type.
DMS_dynamicText_Color = "#FFCC00"; // Dynamic Text color for "dynamicTextRequest" notification type.
DMS_dynamicText_Color = "#FFFFFF"; // Dynamic Text color for "dynamicTextRequest" notification type.
/*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
@ -467,9 +473,9 @@ DMS_DEBUG = false;
["Rangefinder",1],
["srifle_GM6_F",1],
["srifle_LRR_F",1],
["srifle_EBR_DMS_pointer_snds_F",1],
["hgun_Pistol_heavy_01_MRD_F",1],
["hgun_PDW2000_Holo_snds_F",1]
["srifle_EBR_F",1],
["hgun_Pistol_heavy_01_F",1],
["hgun_PDW2000_F",1]
],
[
["ItemGPS",1],
@ -482,8 +488,14 @@ DMS_DEBUG = false;
["Exile_Item_InstaDoc",3],
["Exile_Item_Surstromming_Cooked",5],
["Exile_Item_PlasticBottleFreshWater",5],
["optic_DMS",1],
["acc_pointer_IR",1],
["muzzle_snds_B",1],
["optic_LRPS",1],
["optic_MRD",1],
["muzzle_snds_acp",1],
["optic_Holosight_smg",1],
["muzzle_snds_L",1],
["5Rnd_127x108_APDS_Mag",3],
["7Rnd_408_Mag",3],
["20Rnd_762x51_Mag",5],

View File

@ -26,6 +26,7 @@ if(DMS_StaticMission) then
if (DMS_DynamicMission) then
{
DMS_AttemptsUntilThrottle = DMS_AttemptsUntilThrottle + 1;
call compileFinal preprocessFileLineNumbers "\x\addons\dms\missions\mission_init.sqf";
execFSM "\x\addons\dms\FSM\missions.fsm";
};

View File

@ -13,7 +13,10 @@ _side = "bandit";
// find position
_pos = call DMS_fnc_findSafePos;
_pos =
[
25,DMS_WaterNearBlacklist,DMS_MaxSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_ThrottleBlacklists
]call DMS_fnc_findSafePos;
// Set general mission difficulty
@ -62,15 +65,15 @@ _missionObjs =
];
// Define Mission Start message
_msgStart = format["<t color='#FFFF00' size='1.25'>Armed Bandits! </t><br/> A heavily armed bandit group has been spotted, take them out and claim their vehicle!"];
_msgStart = ['#FFFF00',"A heavily armed bandit group has been spotted, take them out and claim their vehicle!"];
// Define Mission Win message
_msgWIN = format["<t color='#0080ff' size='1.25'>Armed Bandits! </t><br/> Convicts have successfully taken care of the bandit group!"];
_msgWIN = ['#0080ff',"Convicts have successfully taken care of the bandit group!"];
// Define Mission Lose message
_msgLOSE = format["<t color='#FF0000' size='1.25'>Armed Bandits! </t><br/> The bandits have taken their vehicle and drove off, no loot today!"];
_msgLOSE = ['#FF0000',"The bandits have taken their vehicle and drove off, no loot today!"];
// Define mission name (for map marker and logging)
// Define mission name (for map markers, mission messages, and logging)
_missionName = "Armed Bandits";
// Create Markers
@ -104,7 +107,7 @@ _added =
],
_missionAIUnits,
_missionObjs,
[_msgWIN,_msgLOSE],
[_missionName,_msgWIN,_msgLOSE],
_markers,
_side,
_difficulty,
@ -141,7 +144,7 @@ if !(_added) exitWith
// Notify players
_msgStart call DMS_fnc_BroadcastMissionStatus;
[_missionName,_msgStart] call DMS_fnc_BroadcastMissionStatus;

View File

@ -16,7 +16,10 @@ _side = "bandit";
// find position
_pos = [10] call DMS_fnc_findSafePos;
_pos =
[
10,DMS_WaterNearBlacklist,DMS_MaxSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_ThrottleBlacklists
]call DMS_fnc_findSafePos;
// Set general mission difficulty
@ -73,13 +76,13 @@ _missionObjs =
];
_msgStart = format["<t color='#FFFF00' size='1.25'>Bauhaus Truck </t><br/> A Bauhaus truck has crashed and lost all its building supplies, get there quickly!"];
_msgStart = ['#FFFF00',"A Bauhaus truck has crashed and lost all its building supplies, get there quickly!"];
// Define Mission Win message
_msgWIN = format["<t color='#0080ff' size='1.25'>Bauhaus Truck </t><br/> Convicts have successfully claimed the crashed Buahaus truck!"];
_msgWIN = ['#0080ff',"Convicts have successfully claimed the crashed Bauhaus truck!"];
// Define Mission Lose message
_msgLOSE = format["<t color='#FF0000' size='1.25'>Bauhaus Truck! </t><br/> The Bauhause truck has been repaired and escaped!"];
_msgLOSE = ['#FF0000',"The Bauhaus truck has been repaired and escaped!"];
// Define mission name (for map marker and logging)
_missionName = "Bauhaus Truck";
@ -115,7 +118,7 @@ _added =
],
_missionAIUnits,
_missionObjs,
[_msgWIN,_msgLOSE],
[_missionName,_msgWIN,_msgLOSE],
_markers,
_side,
_difficulty,
@ -152,7 +155,7 @@ if !(_added) exitWith
// Notify players
_msgStart call DMS_fnc_BroadcastMissionStatus;
[_missionName,_msgStart] call DMS_fnc_BroadcastMissionStatus;

View File

@ -16,7 +16,10 @@ _side = "bandit";
// find position
_pos = [10] call DMS_fnc_findSafePos;
_pos =
[
10,DMS_WaterNearBlacklist,DMS_MaxSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_ThrottleBlacklists
]call DMS_fnc_findSafePos;
// Set general mission difficulty
@ -66,16 +69,16 @@ _missionObjs =
];
// Define Mission Start message
_msgStart = format["<t color='#FFFF00' size='1.25'>Beer transport! </t><br/> A transport truck carrying beer and guns is being robbed, stop the robbers and steal the loot!"];
_msgStart = ['#FFFF00',"A transport truck carrying beer and guns is being robbed, stop the robbers and steal the loot!"];
// Define Mission Win message
_msgWIN = format["<t color='#0080ff' size='1.25'>Beer transport! </t><br/> Convicts have successfully claimed all of the beer and guns. 'Murica."];
_msgWIN = ['#0080ff',"Convicts have successfully claimed all of the beer and guns. 'Murica."];
// Define Mission Lose message
_msgLOSE = format["<t color='#FF0000' size='1.25'>Beer transport! </t><br/> The robbers have taken off with all the beer and all the guns, what a travesty!"];
_msgLOSE = ['#FF0000',"The robbers have taken off with all the beer and all the guns, what a travesty!"];
// Define mission name (for map marker and logging)
_missionName = "Beer & Guns Truck";
_missionName = "Beer N' Guns Truck";
// Create Markers
_markers =
@ -108,7 +111,7 @@ _added =
],
_missionAIUnits,
_missionObjs,
[_msgWIN,_msgLOSE],
[_missionName,_msgWIN,_msgLOSE],
_markers,
_side,
_difficulty,
@ -145,7 +148,7 @@ if !(_added) exitWith
// Notify players
_msgStart call DMS_fnc_BroadcastMissionStatus;
[_missionName,_msgStart] call DMS_fnc_BroadcastMissionStatus;

View File

@ -16,7 +16,10 @@ _side = "bandit";
// find position
_pos = [10] call DMS_fnc_findSafePos;
_pos =
[
10,DMS_WaterNearBlacklist,DMS_MaxSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_ThrottleBlacklists
]call DMS_fnc_findSafePos;
// Set general mission difficulty
@ -66,13 +69,13 @@ _missionObjs =
];
// Define Mission Start message
_msgStart = format["<t color='#FFFF00' size='1.25'>Enemy Bunker! </t><br/> A team of soldiers have set up a bunker inside convict land. Rid them from this place!"];
_msgStart = ['#FFFF00',"A team of soldiers have set up a bunker inside convict land. Rid them from this place!"];
// Define Mission Win message
_msgWIN = format["<t color='#0080ff' size='1.25'>Enemy Bunker! </t><br/> Convicts have successfully taken care of the enemies and their bunker!"];
_msgWIN = ['#0080ff',"Convicts have successfully taken care of the enemies and their bunker!"];
// Define Mission Lose message
_msgLOSE = format["<t color='#FF0000' size='1.25'>Enemy Bunker! </t><br/> The soldiers became impatient and have escaped the area!"];
_msgLOSE = ['#FF0000',"The soldiers became impatient and have escaped the area!"];
// Define mission name (for map marker and logging)
_missionName = "Enemy Bunker";
@ -108,7 +111,7 @@ _added =
],
_missionAIUnits,
_missionObjs,
[_msgWIN,_msgLOSE],
[_missionName,_msgWIN,_msgLOSE],
_markers,
_side,
_difficulty,
@ -145,7 +148,7 @@ if !(_added) exitWith
// Notify players
_msgStart call DMS_fnc_BroadcastMissionStatus;
[_missionName,_msgStart] call DMS_fnc_BroadcastMissionStatus;

View File

@ -16,7 +16,10 @@ _side = "bandit";
// find position
_pos = [10] call DMS_fnc_findSafePos;
_pos =
[
10,DMS_WaterNearBlacklist,DMS_MaxSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_ThrottleBlacklists
]call DMS_fnc_findSafePos;
// Set general mission difficulty
@ -66,13 +69,13 @@ _missionObjs =
];
// Define Mission Start message
_msgStart = format["<t color='#FFFF00' size='1.25'>Blackhawk down! </t><br/> We got a Blackhawk down, Super 6-1 is down, secure the perimeter and claim what can be claimed!"];
_msgStart = ['#FFFF00',"We got a Blackhawk down, Super 6-1 is down, secure the perimeter and claim what can be claimed!"];
// Define Mission Win message
_msgWIN = format["<t color='#0080ff' size='1.25'>Blackhawk down! </t><br/> Convicts have secured the blackhawk and claimed the remaining loot!"];
_msgWIN = ['#0080ff',"Convicts have secured the blackhawk and claimed the remaining loot!"];
// Define Mission Lose message
_msgLOSE = format["<t color='#FF0000' size='1.25'>Blackhawk down! </t><br/> The blackhawk has been sized by the enemy and the loot has been destroyed!"];
_msgLOSE = ['#FF0000',"The blackhawk has been sized by the enemy and the loot has been destroyed!"];
// Define mission name (for map marker and logging)
_missionName = "Blackhawk Down";
@ -108,7 +111,7 @@ _added =
],
_missionAIUnits,
_missionObjs,
[_msgWIN,_msgLOSE],
[_missionName,_msgWIN,_msgLOSE],
_markers,
_side,
_difficulty,
@ -145,7 +148,7 @@ if !(_added) exitWith
// Notify players
_msgStart call DMS_fnc_BroadcastMissionStatus;
[_missionName,_msgStart] call DMS_fnc_BroadcastMissionStatus;

View File

@ -16,7 +16,10 @@ _side = "bandit";
// find position
_pos = [10] call DMS_fnc_findSafePos;
_pos =
[
10,DMS_WaterNearBlacklist,DMS_MaxSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_ThrottleBlacklists
]call DMS_fnc_findSafePos;
// Set general mission difficulty
@ -40,10 +43,16 @@ _group =
// Create Crates
_crate1 = ["Box_NATO_Wps_F",_pos] call DMS_fnc_SpawnCrate;
_wreck = createVehicle ["Land_FuelStation_Build_F",[(_pos select 0) - 10, (_pos select 1),-0.2],[], 0, "CAN_COLLIDE"];
_rndDir = random 180;
_vehicle1 = ["Exile_Car_SUV_Red",[(_pos select 0) + -1*(5+(random 5)),(_pos select 1) + -1*(5+(random 5)),0]] call DMS_fnc_SpawnNonPersistentVehicle;
_vehicle2 = ["Exile_Car_SUV_Grey",[(_pos select 0)+(5+(random 5)),(_pos select 1)+(5+(random 5)),0]] call DMS_fnc_SpawnNonPersistentVehicle;
_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;
//_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 setPosATL ([_pos,5+(random 3),_rndDir+180] call DMS_fnc_SelectOffsetPos);
@ -71,13 +80,13 @@ _missionObjs =
];
// Define Mission Start message
_msgStart = format["<t color='#FFFF00' size='1.25'>Car Dealer Robbery! </t><br/> A local car dealership is being robbed by bandits, stop them!"];
_msgStart = ['#FFFF00',"A local car dealership is being robbed by bandits, stop them!"];
// Define Mission Win message
_msgWIN = format["<t color='#0080ff' size='1.25'>Car Dealer Robbery! </t><br/> Convicts have secured the local dealership and removed the bandits!"];
_msgWIN = ['#0080ff',"Convicts have secured the local dealership and removed the bandits!"];
// Define Mission Lose message
_msgLOSE = format["<t color='#FF0000' size='1.25'>Car Dealer Robbery! </t><br/> The bandits have escaped with the cars and left nothing but a trail of smoke behind!"];
_msgLOSE = ['#FF0000',"The bandits have escaped with the cars and left nothing but a trail of smoke behind!"];
// Define mission name (for map marker and logging)
_missionName = "Car Dealer Robbery";
@ -113,7 +122,7 @@ _added =
],
_missionAIUnits,
_missionObjs,
[_msgWIN,_msgLOSE],
[_missionName,_msgWIN,_msgLOSE],
_markers,
_side,
_difficulty,
@ -150,7 +159,7 @@ if !(_added) exitWith
// Notify players
_msgStart call DMS_fnc_BroadcastMissionStatus;
[_missionName,_msgStart] call DMS_fnc_BroadcastMissionStatus;

View File

@ -13,7 +13,10 @@ _side = "bandit";
// find position
_pos = call DMS_fnc_findSafePos;
_pos =
[
25,DMS_WaterNearBlacklist,DMS_MaxSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_ThrottleBlacklists
]call DMS_fnc_findSafePos;
// Set general mission difficulty
@ -68,13 +71,13 @@ _missionObjs =
];
// Define Mission Start message
_msgStart = format["<t color='#FFFF00' size='1.25'>Construction Site! </t><br/> A group of mercenaries have set up a construction site, clear them out!"];
_msgStart = ['#FFFF00',"A group of mercenaries have set up a construction site, clear them out!"];
// Define Mission Win message
_msgWIN = format["<t color='#0080ff' size='1.25'>Construction Site! </t><br/> Convicts have successfully demolished the construction site!"];
_msgWIN = ['#0080ff',"Convicts have successfully demolished the construction site!"];
// Define Mission Lose message
_msgLOSE = format["<t color='#FF0000' size='1.25'>Construction Site! </t><br/> The mercenaries have dismantled their construction site and escaped!"];
_msgLOSE = ['#FF0000',"The mercenaries have dismantled their construction site and escaped!"];
// Define mission name (for map marker and logging)
@ -111,7 +114,7 @@ _added =
],
_missionAIUnits,
_missionObjs,
[_msgWIN,_msgLOSE],
[_missionName,_msgWIN,_msgLOSE],
_markers,
_side,
_difficulty,
@ -148,7 +151,7 @@ if !(_added) exitWith
// Notify players
_msgStart call DMS_fnc_BroadcastMissionStatus;
[_missionName,_msgStart] call DMS_fnc_BroadcastMissionStatus;

View File

@ -16,7 +16,10 @@ _side = "bandit";
// find position
_pos = [10] call DMS_fnc_findSafePos;
_pos =
[
10,DMS_WaterNearBlacklist,DMS_MaxSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_ThrottleBlacklists
]call DMS_fnc_findSafePos;
// Set general mission difficulty
@ -80,13 +83,13 @@ _missionObjs =
];
// Define Mission Start message
_msgStart = format["<t color='#FFFF00' size='1.25'>Knight Rider! </t><br/> KITT has been kidnapped, secure the position and reclaim KITT!"];
_msgStart = ['#FFFF00',"KITT has been kidnapped, secure the position and reclaim KITT!"];
// Define Mission Win message
_msgWIN = format["<t color='#0080ff' size='1.25'>Knight Rider! </t><br/> Convicts secured KITT, that will show the bandits not to Hassle the Hoff!"];
_msgWIN = ['#0080ff',"Convicts secured KITT, that will show the bandits not to Hassle the Hoff!"];
// Define Mission Lose message
_msgLOSE = format["<t color='#FF0000' size='1.25'>Knight Rider!</t><br/> KITT was never secured and has now been dismantled by the bandits, what a grim fate."];
_msgLOSE = ['#FF0000',"KITT was never secured and has now been dismantled by the bandits, what a grim fate."];
// Define mission name (for map marker and logging)
_missionName = "KITT's Location";
@ -122,7 +125,7 @@ _added =
],
_missionAIUnits,
_missionObjs,
[_msgWIN,_msgLOSE],
[_missionName,_msgWIN,_msgLOSE],
_markers,
_side,
_difficulty,
@ -159,7 +162,7 @@ if !(_added) exitWith
// Notify players
_msgStart call DMS_fnc_BroadcastMissionStatus;
[_missionName,_msgStart] call DMS_fnc_BroadcastMissionStatus;

View File

@ -16,7 +16,10 @@ _side = "bandit";
// find position
_pos = [10] call DMS_fnc_findSafePos;
_pos =
[
10,DMS_WaterNearBlacklist,DMS_MaxSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_ThrottleBlacklists
]call DMS_fnc_findSafePos;
// Set general mission difficulty
@ -66,13 +69,13 @@ _missionObjs =
];
// Define Mission Start message
_msgStart = format["<t color='#FFFF00' size='1.25'>Food Supplies! </t><br/> A food supply truck has been sized by ruthless bandits, stop them!"];
_msgStart = ['#FFFF00',"A food supply truck has been sized by ruthless bandits, stop them!"];
// Define Mission Win message
_msgWIN = format["<t color='#0080ff' size='1.25'>Food Supplies! </t><br/> Convicts have successfully claimed the food supplies for themselves!"];
_msgWIN = ['#0080ff',"Convicts have successfully claimed the food supplies for themselves!"];
// Define Mission Lose message
_msgLOSE = format["<t color='#FF0000' size='1.25'>Food Supplies! </t><br/> The bandits have taken the food supplies and escaped!"];
_msgLOSE = ['#FF0000',"The bandits have taken the food supplies and escaped!"];
// Define mission name (for map marker and logging)
_missionName = "Food Supplies";
@ -108,7 +111,7 @@ _added =
],
_missionAIUnits,
_missionObjs,
[_msgWIN,_msgLOSE],
[_missionName,_msgWIN,_msgLOSE],
_markers,
_side,
_difficulty,
@ -145,7 +148,7 @@ if !(_added) exitWith
// Notify players
_msgStart call DMS_fnc_BroadcastMissionStatus;
[_missionName,_msgStart] call DMS_fnc_BroadcastMissionStatus;

View File

@ -16,7 +16,10 @@ _side = "bandit";
// find position
_pos = [10] call DMS_fnc_findSafePos;
_pos =
[
10,DMS_WaterNearBlacklist,DMS_MaxSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_ThrottleBlacklists
]call DMS_fnc_findSafePos;
// Set general mission difficulty
@ -66,13 +69,13 @@ _missionObjs =
];
// Define Mission Start message
_msgStart = format["<t color='#FFFF00' size='1.25'>Gun Transport! </t><br/> A gun transport truck has crashed, secure the crash site and the guns!"];
_msgStart = ['#FFFF00',"A gun transport truck has crashed, secure the crash site and the guns!"];
// Define Mission Win message
_msgWIN = format["<t color='#0080ff' size='1.25'>Gun Transport! </t><br/> Convicts have successfully secured the area and claimed the guns for their own!"];
_msgWIN = ['#0080ff',"Convicts have successfully secured the area and claimed the guns for their own!"];
// Define Mission Lose message
_msgLOSE = format["<t color='#FF0000' size='1.25'>Gun Transport! </t><br/> The transport truck has been repaired and escaped the area!"];
_msgLOSE = ['#FF0000',"The transport truck has been repaired and escaped the area!"];
// Define mission name (for map marker and logging)
_missionName = "Gun Transport";
@ -108,7 +111,7 @@ _added =
],
_missionAIUnits,
_missionObjs,
[_msgWIN,_msgLOSE],
[_missionName,_msgWIN,_msgLOSE],
_markers,
_side,
_difficulty,
@ -145,7 +148,7 @@ if !(_added) exitWith
// Notify players
_msgStart call DMS_fnc_BroadcastMissionStatus;
[_missionName,_msgStart] call DMS_fnc_BroadcastMissionStatus;

View File

@ -16,7 +16,10 @@ _side = "bandit";
// find position
_pos = [10] call DMS_fnc_findSafePos;
_pos =
[
10,DMS_WaterNearBlacklist,DMS_MaxSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_ThrottleBlacklists
]call DMS_fnc_findSafePos;
// Set general mission difficulty
@ -66,13 +69,13 @@ _missionObjs =
];
// Define Mission Start message
_msgStart = format["<t color='#FFFF00' size='1.25'>Humanitarian Supplies! </t><br/> A truck carrying humanitarian supplies has been sized by bandits, stop them!"];
_msgStart = ['#FFFF00',"A truck carrying humanitarian supplies has been sized by bandits, stop them!"];
// Define Mission Win message
_msgWIN = format["<t color='#0080ff' size='1.25'>Humanitarian Supplies! </t><br/> Convicts have successfully claimed the humanitarian supplies for themselves!"];
_msgWIN = ['#0080ff',"Convicts have successfully claimed the humanitarian supplies for themselves!"];
// Define Mission Lose message
_msgLOSE = format["<t color='#FF0000' size='1.25'>Humanitarian Supplies! </t><br/> The bandits have taken the humanitarian supplies and escaped!"];
_msgLOSE = ['#FF0000',"The bandits have taken the humanitarian supplies and escaped!"];
// Define mission name (for map marker and logging)
_missionName = "Humanitarian Supplies";
@ -108,7 +111,7 @@ _added =
],
_missionAIUnits,
_missionObjs,
[_msgWIN,_msgLOSE],
[_missionName,_msgWIN,_msgLOSE],
_markers,
_side,
_difficulty,
@ -145,7 +148,7 @@ if !(_added) exitWith
// Notify players
_msgStart call DMS_fnc_BroadcastMissionStatus;
[_missionName,_msgStart] call DMS_fnc_BroadcastMissionStatus;

View File

@ -16,7 +16,10 @@ _side = "bandit";
// find position
_pos = [10] call DMS_fnc_findSafePos;
_pos =
[
10,DMS_WaterNearBlacklist,DMS_MaxSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_ThrottleBlacklists
]call DMS_fnc_findSafePos;
// Set general mission difficulty
@ -64,13 +67,13 @@ _missionObjs =
];
// Define Mission Start message
_msgStart = format["<t color='#FFFF00' size='1.25'>Lost Battalion! </t><br/> A battalion of soldiers have gotten lost in convict land! Eliminate them!"];
_msgStart = ['#FFFF00',"A battalion of soldiers have gotten lost in convict land! Eliminate them!"];
// Define Mission Win message
_msgWIN = format["<t color='#0080ff' size='1.25'>Lost Battalion! </t><br/> Convicts have successfully eliminated the lost battalion!"];
_msgWIN = ['#0080ff',"Convicts have successfully eliminated the lost battalion!"];
// Define Mission Lose message
_msgLOSE = format["<t color='#FF0000' size='1.25'>Lost Battalion! </t><br/> Whittlesey escaped with his Lost Battalion!"];
_msgLOSE = ['#FF0000',"Whittlesey escaped with his Lost Battalion!"];
// Define mission name (for map marker and logging)
_missionName = "Lost Battalion";
@ -106,7 +109,7 @@ _added =
],
_missionAIUnits,
_missionObjs,
[_msgWIN,_msgLOSE],
[_missionName,_msgWIN,_msgLOSE],
_markers,
_side,
_difficulty,
@ -143,7 +146,7 @@ if !(_added) exitWith
// Notify players
_msgStart call DMS_fnc_BroadcastMissionStatus;
[_missionName,_msgStart] call DMS_fnc_BroadcastMissionStatus;

View File

@ -13,7 +13,10 @@ _side = "bandit";
// find position
_pos = call DMS_fnc_findSafePos;
_pos =
[
10,DMS_WaterNearBlacklist,DMS_MaxSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_ThrottleBlacklists
]call DMS_fnc_findSafePos;
// Set general mission difficulty
@ -66,13 +69,13 @@ _missionObjs =
];
// Define Mission Start message
_msgStart = format["<t color='#FFFF00' size='1.25'>Deranged Doctors! </t><br/> A group of deranged doctors have set up a field hospital, sieze it for your own!"];
_msgStart = ['#FFFF00',"A group of deranged doctors have set up a field hospital, sieze it for your own!"];
// Define Mission Win message
_msgWIN = format["<t color='#0080ff' size='1.25'>Deranged Doctors! </t><br/> Convicts have claimed the medical supplies for their own!"];
_msgWIN = ['#0080ff',"Convicts have claimed the medical supplies for their own!"];
// Define Mission Lose message
_msgLOSE = format["<t color='#FF0000' size='1.25'>Deranged Doctors! </t><br/> Hawkeye has ran off with the medical supplies, everything is gone!"];
_msgLOSE = ['#FF0000',"Hawkeye has ran off with the medical supplies, everything is gone!"];
// Define mission name (for map marker and logging)
_missionName = "Deranged Doctors";
@ -108,7 +111,7 @@ _added =
],
_missionAIUnits,
_missionObjs,
[_msgWIN,_msgLOSE],
[_missionName,_msgWIN,_msgLOSE],
_markers,
_side,
_difficulty,
@ -145,7 +148,7 @@ if !(_added) exitWith
// Notify players
_msgStart call DMS_fnc_BroadcastMissionStatus;
[_missionName,_msgStart] call DMS_fnc_BroadcastMissionStatus;

View File

@ -13,7 +13,10 @@ _side = "bandit";
// find position
_pos = call DMS_fnc_findSafePos;
_pos =
[
25,DMS_WaterNearBlacklist,DMS_MaxSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_ThrottleBlacklists
]call DMS_fnc_findSafePos;
// Set general mission difficulty
@ -97,13 +100,13 @@ _missionObjs =
];
// Define Mission Start message
_msgStart = format["<t color='#FFFF00' size='1.25'> Mercenary Base </t><br/> A mercenary base has been located at %1! There's reports of a dandy crate inside of it...",mapGridPosition _pos];
_msgStart = ['#FFFF00',format ["A mercenary base has been located at %1! There are reports of a dandy crate inside of it...",mapGridPosition _pos]];
// Define Mission Win message
_msgWIN = format["<t color='#0080ff' size='1.25'> Mercenary Base </t><br/> Convicts have successfully assaulted the Mercenary Base and obtained the dandy crate!"];
_msgWIN = ['#0080ff',"Convicts have successfully assaulted the Mercenary Base and obtained the dandy crate!"];
// Define Mission Lose message
_msgLOSE = format["<t color='#FF0000' size='1.25'> Mercenary Base </t><br/> Seems like the Mercenaries packed up and drove away..."];
_msgLOSE = ['#FF0000',"Seems like the Mercenaries packed up and drove away..."];
// Define mission name (for map marker and logging)
_missionName = "Mercenary Base";
@ -139,7 +142,7 @@ _added =
],
_missionAIUnits,
_missionObjs,
[_msgWIN,_msgLOSE],
[_missionName,_msgWIN,_msgLOSE],
_markers,
_side,
_difficulty,
@ -176,7 +179,7 @@ if !(_added) exitWith
// Notify players
_msgStart call DMS_fnc_BroadcastMissionStatus;
[_missionName,_msgStart] call DMS_fnc_BroadcastMissionStatus;

View File

@ -16,7 +16,10 @@ _side = "bandit";
// find position
_pos = [10] call DMS_fnc_findSafePos;
_pos =
[
10,DMS_WaterNearBlacklist,DMS_MaxSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_ThrottleBlacklists
]call DMS_fnc_findSafePos;
// Set general mission difficulty
@ -64,13 +67,13 @@ _missionObjs =
];
// Define Mission Start message
_msgStart = format["<t color='#FFFF00' size='1.25'>Mercenary Group! </t><br/> A group of mercenaries has been spotted. Kill them and take their equipment!"];
_msgStart = ['#FFFF00',"A group of mercenaries has been spotted. Kill them and take their equipment!"];
// Define Mission Win message
_msgWIN = format["<t color='#0080ff' size='1.25'>Mercenary Group! </t><br/> Convicts have successfully eliminated the mercenaries"];
_msgWIN = ['#0080ff',"Convicts have successfully eliminated the mercenaries"];
// Define Mission Lose message
_msgLOSE = format["<t color='#FF0000' size='1.25'>Mercenary Group! </t><br/> The mercenaries have escaped and they took all their loot with them!"];
_msgLOSE = ['#FF0000',"The mercenaries have escaped and they took all their loot with them!"];
// Define mission name (for map marker and logging)
_missionName = "Mercenary Group";
@ -106,7 +109,7 @@ _added =
],
_missionAIUnits,
_missionObjs,
[_msgWIN,_msgLOSE],
[_missionName,_msgWIN,_msgLOSE],
_markers,
_side,
_difficulty,
@ -143,7 +146,7 @@ if !(_added) exitWith
// Notify players
_msgStart call DMS_fnc_BroadcastMissionStatus;
[_missionName,_msgStart] call DMS_fnc_BroadcastMissionStatus;

View File

@ -16,7 +16,10 @@ _side = "bandit";
// find position
_pos = [10] call DMS_fnc_findSafePos;
_pos =
[
10,DMS_WaterNearBlacklist,DMS_MaxSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_ThrottleBlacklists
]call DMS_fnc_findSafePos;
// Set general mission difficulty
@ -64,13 +67,13 @@ _missionObjs =
];
// Define Mission Start message
_msgStart = format["<t color='#FFFF00' size='1.25'>Navy Seals! </t><br/> A squad of professional Navy Seals team is performing gorilla warfare in convict land, deal with them!"];
_msgStart = ['#FFFF00',"A squad of professional Navy Seals team is performing gorilla warfare in convict land, deal with them!"];
// Define Mission Win message
_msgWIN = format["<t color='#0080ff' size='1.25'>Navy Seals! </t><br/> Convicts have successfully taken care of the Navy Seals, you must be the top of your class!"];
_msgWIN = ['#0080ff',"Convicts have successfully taken care of the Navy Seals, you must be the top of your class!"];
// Define Mission Lose message
_msgLOSE = format["<t color='#FF0000' size='1.25'>Navy Seals! </t><br/> The Navy Seals have escaped and are now planning their next raid!"];
_msgLOSE = ['#FF0000',"The Navy Seals have escaped and are now planning their next raid!"];
// Define mission name (for map marker and logging)
_missionName = "Rogue Navy Seals";
@ -106,7 +109,7 @@ _added =
],
_missionAIUnits,
_missionObjs,
[_msgWIN,_msgLOSE],
[_missionName,_msgWIN,_msgLOSE],
_markers,
_side,
_difficulty,
@ -143,7 +146,7 @@ if !(_added) exitWith
// Notify players
_msgStart call DMS_fnc_BroadcastMissionStatus;
[_missionName,_msgStart] call DMS_fnc_BroadcastMissionStatus;

View File

@ -13,7 +13,10 @@ _side = "bandit";
// find position
_pos = [10] call DMS_fnc_findSafePos;
_pos =
[
10,DMS_WaterNearBlacklist,DMS_MaxSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_ThrottleBlacklists
]call DMS_fnc_findSafePos;
// Set general mission difficulty
@ -109,13 +112,13 @@ _missionObjs =
];
// Define Mission Start message
_msgStart = format["<t color='#FFFF00' size='1.25'>Armed Bandits! </t><br/> A heavily armed bandit group has been spotted, take them out and claim their vehicle!"];
_msgStart = ['#FFFF00',"A heavily armed bandit group has been spotted, take them out and claim their vehicle!"];
// Define Mission Win message
_msgWIN = format["<t color='#0080ff' size='1.25'>Armed Bandits! </t><br/> Convicts have successfully taken care of the bandit group!"];
_msgWIN = ['#0080ff',"Convicts have successfully taken care of the bandit group!"];
// Define Mission Lose message
_msgLOSE = format["<t color='#FF0000' size='1.25'>Armed Bandits! </t><br/> The bandits have taken their vehicle and drove off, no loot today!"];
_msgLOSE = ['#FF0000',"The bandits have taken their vehicle and drove off, no loot today!"];
// Define mission name (for map marker and logging)
_missionName = "Armed Bandits";
@ -153,7 +156,7 @@ _added =
],
_missionAIUnits,
_missionObjs,
[_msgWIN,_msgLOSE],
[_missionName,_msgWIN,_msgLOSE],
_markers,
_side,
_difficulty,
@ -190,7 +193,7 @@ if !(_added) exitWith
// Notify players
_msgStart call DMS_fnc_BroadcastMissionStatus;
[_missionName,_msgStart] call DMS_fnc_BroadcastMissionStatus;

View File

@ -16,7 +16,10 @@ _side = "bandit";
// find position
_pos = [10] call DMS_fnc_findSafePos;
_pos =
[
10,DMS_WaterNearBlacklist,DMS_MaxSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_ThrottleBlacklists
]call DMS_fnc_findSafePos;
// Set general mission difficulty
@ -69,13 +72,13 @@ _missionObjs =
];
// Define Mission Start message
_msgStart = format["<t color='#FFFF00' size='1.25'>Walmart Riot! </t><br/> A local Walmart shop is being raided, stop the raiders and take the loot!"];
_msgStart = ['#FFFF00',"A local Walmart shop is being raided, stop the raiders and take the loot!"];
// Define Mission Win message
_msgWIN = format["<t color='#0080ff' size='1.25'>Walmart Riot! </t><br/> Convicts have done a good deed and stopped the raiders!"];
_msgWIN = ['#0080ff',"Convicts have done a good deed and stopped the raiders!"];
// Define Mission Lose message
_msgLOSE = format["<t color='#FF0000' size='1.25'>Walmart Riot! </t><br/> The raiders has looted everything from Walmart and escaped!"];
_msgLOSE = ['#FF0000',"The raiders has looted everything from Walmart and escaped!"];
// Define mission name (for map marker and logging)
_missionName = "Walmart Riot";
@ -111,7 +114,7 @@ _added =
],
_missionAIUnits,
_missionObjs,
[_msgWIN,_msgLOSE],
[_missionName,_msgWIN,_msgLOSE],
_markers,
_side,
_difficulty,
@ -144,7 +147,7 @@ if !(_added) exitWith
// Notify players
_msgStart call DMS_fnc_BroadcastMissionStatus;
[_missionName,_msgStart] call DMS_fnc_BroadcastMissionStatus;

View File

@ -2,11 +2,11 @@
DMS_fnc_AILocalityManager
Created by Defent and eraser1
Offloads AI groups to a nearby client in order to improve server performance.
Offloads AI groups to a nearby client or HC in order to improve server performance.
*/
if !(DMS_ai_offload_to_client) exitWith {};
if (!DMS_ai_offload_to_client && {isNull DMS_HC_Object}) exitWith {};
{
if (((count (units _x))>1) && {!((DMS_ai_offload_Only_DMS_AI && {!(_x getVariable ["DMS_SpawnedGroup",false])}) || {(_x getVariable ["DMS_LockLocality",false])})}) then

View File

@ -41,7 +41,7 @@
]
],
[_msgWIN,_msgLose],
[_markerDot,_markerCircle],
[_missionName,_markerDot,_markerCircle],
_side,
_difficulty,
_missionEvents
@ -63,7 +63,7 @@ _OK = params
["_timeOutInfo","",[[]],[1,2]],
["_inputUnits","",[[]]],
["_missionObjs","",[[]],[3,4]],
["_messages","",[[]],[2]],
["_messages","",[[]],[3]],
["_markers","",[[]],[2]],
["_side","bandit",[""]],
["_difficulty","moderate",[""]],
@ -136,8 +136,9 @@ try
_OK = _messages params
[
["_msgWIN","",[""]],
["_msgLose","",[""]]
["_missionName","",[""]],
["_msgWIN",[],[[]],[2]],
["_msgLose",[],[[]],[2]]
];
if (!_OK) then
@ -172,6 +173,7 @@ try
_mines
],
[
_missionName,
_msgWIN,
_msgLose
],

View File

@ -11,24 +11,64 @@
*/
if (DMS_DEBUG) then
private ["_missionName", "_messageInfo", "_titleColor", "_message"];
_OK = params
[
["_missionName","",[""]],
["_messageInfo",[],[[]],[2]]
];
if (!_OK) exitWith
{
diag_log format["DMS_DEBUG BroadcastMissionStatus :: Notification types: |%1| for broadcasting mission status: %2",DMS_PlayerNotificationTypes,_this];
diag_log format ["DMS ERROR :: Calling DMS_fnc_BroadcastMissionStatus with invalid parameters: %1",_this];
};
if ((typeName _this) != "STRING") then
_messageInfo params
[
["_titleColor","#FFFF00",[""]],
["_message","",[""]]
];
if (DMS_DEBUG) then
{
_this = str _this;
diag_log format["DMS_DEBUG BroadcastMissionStatus :: Notification types: |%1| for broadcasting mission status: %2",DMS_PlayerNotificationTypes,_message];
};
if ((typeName _message) != "STRING") then
{
_message = str _message;
};
{
private "_args";
_args = // Only include extra parameters if using "dynamicTextRequest"
[
[_x, [_this]],
[_x, [_this,0,DMS_dynamicText_Size,DMS_dynamicText_Color]]
] select (_x == "dynamicTextRequest");
switch (toLower _x) do
{
case "systemchatrequest":
{
[_x, [format ["%1: %2",toUpper _missionName,_message]]] call ExileServer_system_network_send_broadcast;
};
_args call ExileServer_system_network_send_broadcast;
case "standardhintrequest":
{
[_x, [format ["<t color='%1' size='1.25'>%2</t><br/> %3",_titleColor,_missionName,_message]]] call ExileServer_system_network_send_broadcast;
};
case "dynamictextrequest":
{
//Unfortunately that doesn't work, so I have to do some funky stuff...
//[_x, [format ["%1<br/>%2",toUpper _missionName,_message], 0, DMS_dynamicText_Size, DMS_dynamicText_Color]] call ExileServer_system_network_send_broadcast;
[
format ['<t color="%1" size="1" >%2</t><br/><t color="%3" size="%4" >%5</t>',_titleColor,_missionName,DMS_dynamicText_Color,DMS_dynamicText_Size,_message],
0,
0,
10,
1
] remoteExec ["BIS_fnc_dynamicText", -2];
};
default { diag_log format ["DMS ERROR :: Unsupported Notification Type in DMS_PlayerNotificationTypes: %1 | Calling parameters: %2",_x,_this]; };
};
} forEach DMS_PlayerNotificationTypes;

View File

@ -31,6 +31,10 @@ _skippedObjects = [];
_clean =
{
{
detach _x;
_x call _clean;
} forEach (attachedObjects _x);
_this enableSimulationGlobal false;
_this removeAllMPEventHandlers "mpkilled";
_this removeAllMPEventHandlers "mphit";

View File

@ -1,21 +1,37 @@
/*
DMS_fnc_findSafePos
DMS_fnc_FindSafePos
Created by eraser1
ALL PARAMETERS ARE OPTIONAL (as long as configs are properly defined).
Excluding parameters will create some RPT spam, but it's not too much of an issue.
Usage:
[
_nearestObjectMinDistance, // (OPTIONAL) Number: Minimum distance from nearest object
_maxTerrainGradient // (OPTIONAL) Number: Maximum terrain gradient (slope)
_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
_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.
] call DMS_fnc_findSafePos;
*/
private ["_nearestObjectMinDistance","_maxTerrainGradient","_safePosParams","_validspot","_i","_pos","_missionPos"];
private ["_nearestObjectMinDistance", "_waterNearLimit", "_maxSurfaceNormal", "_spawnZoneNearLimit", "_traderZoneNearLimit", "_missionNearLimit", "_playerNearLimit", "_throttleParams", "_safePosParams", "_validspot", "_attempts", "_pos"];
params
[
["_nearestObjectMinDistance",25,[0]],
["_maxTerrainGradient",10,[0]]
["_nearestObjectMinDistance", 25, [0] ],
["_waterNearLimit", DMS_WaterNearBlacklist, [0] ],
["_maxSurfaceNormal", DMS_MaxSurfaceNormal, [0] ],
["_spawnZoneNearLimit", DMS_SpawnZoneNearBlacklist, [0] ],
["_traderZoneNearLimit", DMS_TraderZoneNearBlacklist,[0] ],
["_missionNearLimit", DMS_MissionNearBlacklist, [0] ],
["_playerNearLimit", DMS_PlayerNearBlacklist, [0] ],
["_throttleParams", DMS_ThrottleBlacklists, [true]]
];
@ -23,77 +39,46 @@ params
// 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,_nearestObjectMinDistance,0,_maxTerrainGradient,0,DMS_findSafePosBlacklist]; }; //[16000,16000] w/ radius of 16000 works well for Altis
case "bornholm" : { _safePosParams = [[11264,11264],0,12000,_nearestObjectMinDistance,0,_maxTerrainGradient,0,DMS_findSafePosBlacklist]; }; // Thanks to thirdhero for testing this info
case "esseker" : { _safePosParams = [[6276.77,6352.98,0],0,5000,_nearestObjectMinDistance,0,_maxTerrainGradient,0,DMS_findSafePosBlacklist]; }; // Thanks to Flowrider for this info
case "tavi" : { _safePosParams = [[12800,12800],0,12800,_nearestObjectMinDistance,0,_maxTerrainGradient,0,DMS_findSafePosBlacklist]; }; // Thanks to JamieKG for this info
default { _safePosParams = [[],0,-1,_nearestObjectMinDistance,0,_maxTerrainGradient,0,DMS_findSafePosBlacklist]; };
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)
};
_safePosParams append [_nearestObjectMinDistance,0,9999,0,DMS_findSafePosBlacklist];
_validspot = false;
_i = 0;
_attempts = 0;
while{!_validspot} do
{
_pos = _safePosParams call BIS_fnc_findSafePos;
_i = _i+1;
try
_pos = _safePosParams call BIS_fnc_findSafePos;
_attempts = _attempts+1;
// 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
{
// Check for nearby water
if ((DMS_WaterNearBlacklist>0) && {[_pos,DMS_WaterNearBlacklist] call DMS_fnc_isNearWater}) then
{
throw ("water");
};
// Check for nearby players
if ((DMS_PlayerNearBlacklist>0) && {[_pos,DMS_PlayerNearBlacklist] call DMS_fnc_IsPlayerNearby}) then
{
throw ("players");
};
_missionNearLimit = (DMS_ThrottleCoefficient * _missionNearLimit) max DMS_MinThrottledDistance;
_playerNearLimit = (DMS_ThrottleCoefficient * _playerNearLimit) max DMS_MinThrottledDistance;
// Terrain steepness check
if (((surfaceNormal _pos) select 2)<DMS_MaxSurfaceNormal) then
{
throw ("a steep location");
};
{
// Check for nearby spawn points
if ((DMS_SpawnZoneNearBlacklist>0) && {((markertype _x) == "ExileSpawnZone") && {((getMarkerPos _x) distance2D _pos)<=DMS_SpawnZoneNearBlacklist}}) then
{
throw ("a spawn zone");
};
// Check for nearby trader zones
if ((DMS_TraderZoneNearBlacklist>0) && {((markertype _x) == "ExileTraderZone") && {((getMarkerPos _x) distance2D _pos)<=DMS_TraderZoneNearBlacklist}}) then
{
throw ("a trader zone");
};
// Check for nearby missions
if (DMS_MissionNearBlacklist>0) then
{
_missionPos = missionNamespace getVariable [format ["%1_pos",_x], []];
if (!(_missionPos isEqualTo []) && {(_missionPos distance2D _pos)<=DMS_MissionNearBlacklist}) then
{
throw ("another mission");
};
};
} forEach allMapMarkers;
// No exceptions found
_validspot = true;
}
catch
{
if (DMS_DEBUG) then
{
diag_log format ["DMS_DEBUG findSafePos :: Exception in attempt %1 | Position %2 is too close to %3!",_i,_pos,_exception];
diag_log format ["DMS_DEBUG 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];
};
};
_validspot = [_pos, _waterNearLimit, _maxSurfaceNormal, _spawnZoneNearLimit, _traderZoneNearLimit, _missionNearLimit, _playerNearLimit] call DMS_fnc_IsValidPosition;
};
if(DMS_DEBUG) then {
diag_log format["DMS_DEBUG findSafePos :: Mission position %1 with %2 params found in %3 attempts.",_pos,_safePosParams,_i];
if(DMS_DEBUG) then
{
diag_log format["DMS_DEBUG FindSafePos :: Found mission position %1 with %2 params in %3 attempts. _this: %4",_pos,_safePosParams,_attempts,_this];
};
_pos set [2, 0];
_pos;

View File

@ -0,0 +1,100 @@
/*
DMS_fnc_IsValidPosition
Created by eraser1
Usage:
[
_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
_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.
] call DMS_fnc_IsValidPosition;
*/
private ["_pos", "_waterNearLimit", "_maxSurfaceNormal", "_spawnZoneNearLimit", "_traderZoneNearLimit", "_missionNearLimit", "_playerNearLimit"];
_OK = params
[
["_pos", [0,0,0], [[]], [2,3]],
["_waterNearLimit", DMS_WaterNearBlacklist, [0] ],
["_maxSurfaceNormal", DMS_MaxSurfaceNormal, [0] ],
["_spawnZoneNearLimit", DMS_SpawnZoneNearBlacklist, [0] ],
["_traderZoneNearLimit", DMS_TraderZoneNearBlacklist,[0] ],
["_missionNearLimit", DMS_MissionNearBlacklist, [0] ],
["_playerNearLimit", DMS_PlayerNearBlacklist, [0] ]
];
_isValidPos = false;
if (!_OK) then
{
diag_log format ["DMS ERROR :: Calling DMS_fnc_isValidPosition with invalid parameters: %1",_this];
}
else
{
try
{
// Check for nearby water
if ((_waterNearLimit>0) && {[_pos,_waterNearLimit] call DMS_fnc_isNearWater}) then
{
throw ("water");
};
// Terrain steepness check
if (((surfaceNormal _pos) select 2)<_maxSurfaceNormal) then
{
throw ("a steep location");
};
{
// Check for nearby spawn points
if ((_spawnZoneNearLimit>0) && {((markertype _x) == "ExileSpawnZone") && {((getMarkerPos _x) distance2D _pos)<=_spawnZoneNearLimit}}) then
{
throw ("a spawn zone");
};
// Check for nearby trader zones
if ((_traderZoneNearLimit>0) && {((markertype _x) == "ExileTraderZone") && {((getMarkerPos _x) distance2D _pos)<=_traderZoneNearLimit}}) then
{
throw ("a trader zone");
};
// Check for nearby missions
if (_missionNearLimit>0) then
{
_missionPos = missionNamespace getVariable [format ["%1_pos",_x], []];
if (!(_missionPos isEqualTo []) && {(_missionPos distance2D _pos)<=_missionNearLimit}) then
{
throw ("another 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");
};
// No exceptions found
_isValidPos = true;
}
catch
{
if (DMS_DEBUG) then
{
diag_log format ["DMS_DEBUG IsValidPosition :: Exception in attempt %1 | Position %2 is too close to %3!",_attempts,_pos,_exception];
};
};
};
_isValidPos;

View File

@ -25,7 +25,7 @@
*/
if (DMS_Mission_Arr isEqualTo []) exitWith {}; // Empty array, no missions running
private ["_pos", "_success", "_timeStarted", "_timeUntilFail", "_units", "_buildings", "_vehs", "_crate_info_array", "_mines", "_msgWIN", "_msgLose", "_markers", "_missionSide", "_arr", "_cleanupList"];
private ["_pos", "_success", "_timeStarted", "_timeUntilFail", "_units", "_buildings", "_vehs", "_crate_info_array", "_mines", "_missionName", "_msgWIN", "_msgLose", "_markers", "_missionSide", "_arr", "_cleanupList"];
{
@ -44,8 +44,9 @@ private ["_pos", "_success", "_timeStarted", "_timeUntilFail", "_units", "_build
_vehs = _x select 4 select 1;
_crate_info_array = _x select 4 select 2;
_mines = _x select 4 select 3;
_msgWIN = _x select 5 select 0;
_msgLose = _x select 5 select 1;
_missionName = _x select 5 select 0;
_msgWIN = _x select 5 select 1;
_msgLose = _x select 5 select 2;
_markers = _x select 6;
_missionSide = _x select 7;
@ -83,10 +84,10 @@ private ["_pos", "_success", "_timeStarted", "_timeUntilFail", "_units", "_build
} forEach _mines;
};
_msgWIN call DMS_fnc_BroadcastMissionStatus;
[_missionName,_msgWIN] call DMS_fnc_BroadcastMissionStatus;
[_markers,"win"] call DMS_fnc_RemoveMarkers;
throw format ["Mission Success at %1 with message %2.",_pos,_msgWIN];
throw format ["Mission (%1) Success at %2 with message %3.",_missionName,_pos,_msgWIN];
};
if (DMS_MissionTimeoutReset && {[_pos,DMS_MissionTimeoutResetRange] call DMS_fnc_IsPlayerNearby}) then
@ -119,10 +120,10 @@ private ["_pos", "_success", "_timeStarted", "_timeUntilFail", "_units", "_build
_arr = DMS_Mission_Arr deleteAt _forEachIndex;
_msgLose call DMS_fnc_BroadcastMissionStatus;
[_missionName,_msgLose] call DMS_fnc_BroadcastMissionStatus;
[_markers,"lose"] call DMS_fnc_RemoveMarkers;
throw format ["Mission Fail at %1 with message %2.",_pos,_msgLose];
throw format ["Mission (%1) Fail at %2 with message %3.",_missionName,_pos,_msgLose];
};
}
catch

View File

@ -26,6 +26,7 @@ if (DMS_DEBUG) then
deleteMarker _markerCircle;
missionNamespace setVariable [format ["%1_pos",_markerDot], nil];
if (_status == "win") then
{
@ -35,7 +36,8 @@ if (_status == "win") then
};
_markerDot setMarkerText ("COMPLETED: "+markerText _markerDot);
_markerDot setMarkerColor DMS_MissionMarkerWinDotColor;
_markerDot spawn {sleep DMS_MissionMarkerWinDotTime;deleteMarker _this;};
//_markerDot spawn {sleep DMS_MissionMarkerWinDotTime;deleteMarker _this;};
[DMS_MissionMarkerWinDotTime, {deleteMarker _this;}, _markerDot, false] call ExileServer_system_thread_addTask;
if (DMS_DEBUG) then
{
diag_log format ["DMS_DEBUG RemoveMarkers :: %1 Marker will be removed in %2 seconds!",_markerDot,DMS_MissionMarkerWinDotTime];
@ -49,7 +51,8 @@ else
};
_markerDot setMarkerText ("FAILED: "+markerText _markerDot);
_markerDot setMarkerColor DMS_MissionMarkerLoseDotColor;
_markerDot spawn {sleep DMS_MissionMarkerLoseDotTime;deleteMarker _this;};
//_markerDot spawn {sleep DMS_MissionMarkerLoseDotTime;deleteMarker _this;};
[DMS_MissionMarkerLoseDotTime, {deleteMarker _this;}, _markerDot, false] call ExileServer_system_thread_addTask;
if (DMS_DEBUG) then
{
diag_log format ["DMS_DEBUG RemoveMarkers :: %1 Marker will be removed in %2 seconds!",_markerDot,DMS_MissionMarkerLoseDotTime];

Binary file not shown.

View File

@ -52,6 +52,25 @@ if (!hasInterface && !isServer) then
## Changelog:
#### October 3, 2015 (10:30 PM CST-America):
* **You must update all of your mission files; the mission message system as well as the calling parameters for DMS_fnc_FindSafePos have been overhauled and will be incompatible with previous versions.**
* NEW CONFIG VALUES:
|DMS_ThrottleBlacklists|
|DMS_AttemptsUntilThrottle|
|DMS_ThrottleCoefficient|
|DMS_MinThrottledDistance|
* Decreased "DMS_TraderZoneNearBlacklist","DMS_MissionNearBlacklist","DMS_WaterNearBlacklist"
* Changed "DMS_dynamicText_Color" to "#FFFFFF" (white)
* Replaced weapon classes in "DMS_CrateCase_Sniper" to the base classes; all attachments should now spawn in the box separately.
* New function DMS_fnc_IsValidPosition (uses logic that was previously from "DMS_fnc_FindSafePos").
* You can now manually define every individual parameter for DMS_fnc_findSafePos per-mission, instead of using global parameters.
* AI will now be offloaded to an HC even with "DMS_ai_offload_to_client" set to false.
* All of the previously "supported" values for "DMS_PlayerNotificationTypes" are now PROPERLY supported. DMS_PlayerNotificationTypes is now set to default "dynamicTextRequest" and "systemChatRequest".
* Tweaked "cardealer" mission, the cars should no longer spawn inside of each other.
#### September 30, 2015 (9:30 PM CST-America):
* NEW CONFIG VALUE: DMS_SpawnMinefieldForEveryMission
* You can now force-spawn an AT mine minefield on every mission with the above config. These mines will only blow up on Tanks, APCs, and MRAPs (Ifrits, Hunters, Striders).
@ -64,6 +83,7 @@ if (!hasInterface && !isServer) then
* When revealing a player to AI, the reveal amount will be reduced if the player has a suppressor.
* DMS_fnc_SetGroupBehavior will now remove all previous waypoints from the AI group.
* Improved logging message for DMS_fnc_SpawnMinefield. Also, the mine warning signs should be on a random offset (instead of always spawning at 0, 90, 180, and 270 degrees)
* Removed obsolete DMS_DEBUG overrides in config. "DMS_fnc_SpawnBanditMission" called from console works great.
#### September 25, 2015 (11:30 PM CST-America):