DMS_Exile/@ExileServer/addons/a3_dms/fn_DMS_postInit.sqf
eraser1 78aa0f8667 Say bye-bye to the pre-packed PBO ;)
#### November 14, 2015 (8:30 PM CST-America):
* **NEW CONFIG VALUES:**

DMS_AllowStaticReinforcements
DMS_MarkerText_ShowAICount_Static
DMS_PredefinedMissionLocations_WEIGHTED
DMS_AIKill_DistanceBonusMinDistance
DMS_AIKill_DistanceBonusCoefficient
* You can now manually disable Static Mission AI reinforcements using
"DMS_AllowStaticReinforcements"
* You can now choose whether or not to show AI count for map markers for
both Static and Dynamic missions separately.
* DMS will now check to see if the config.sqf didn't load properly, and
for the presence of RyanZombies.
* You can now make predefined locations weighted.
* Some optimization + code clarity.
* Added ```taviana_config.sqf``` (identical to ```tavi_config.sqf```)
for the latest version of Taviana.
* **saltflats mission**:
* The AI will now initially spawn randomly across the compound. This
should help with the issue of some AI spawning outside of the compound.
* Added more static guns: 4 around the flagpole (5 meters north, south,
east, and west). One on top of the tower in each corner, and another on
the top of the concrete water tower.
* When an AI group is offloaded to a client and he gets out of range AND
no other viable client is found, the AI locality should now revert to
the server (it used to just stay with the original client).
* Added extra measures to prevent the creation of 2 markers with the
same name.
* fn_FillCrate.sqf:
* Fixed the issue where DMS would complain about incorrect parameters
when using custom code to generate loot.
* DMS now has debug logging to tell you exactly what it spawns in the
crate when using a crate case or custom code.
* "DMS_PredefinedMissionLocations" itself will now be shuffled when
finding a position. This should make the generated positions even more
random.
* Added new Group Reinforcement Types: "armed_vehicle_replace" and
"static_gunner"
* Potentially resolved the issue with launchers not being deleted from
AI bodies when they're killed sometimes.
* **fn_PlayerAwardOnAIKill.sqf**: Created a separate function to handle
poptabs/respect of a player when he/she kills an AI.
* Added a "distance bonus" for respect when killing AI.
* Added logging for player rewards on AI kills.
* DMS now lets Exile's body cleanup handle dead AIs.
* Fixed the issue where DMS would spawn static missions even when
"DMS_StaticMission" is set to false.
* fn_SetAILocality.sqf now returns true/false if it does/doesn't find an
owner.
* New function "fn_SpawnAIGroup_MultiPos.sqf". Almost identical to
SpawnAIGroup, except it spawns each AI along a list of locations.
* **Removed the pre-packed PBO. Too many people were having issues with
their PBO tool removing the prefix and repacking it would result in DMS
not working.**
2015-11-14 20:08:41 -06:00

178 lines
4.3 KiB
Plaintext

/*
DMS post-init
Created by eraser1 and Defent
*/
if !(isServer) exitWith
{
for "_i" from 0 to 99 do
{
diag_log "The DMS PBO is for the SERVER ONLY. It will NOT work for any form of client! DMS launch cancelled.";
};
};
if (isNil "DMS_DynamicMission") exitWith
{
for "_i" from 0 to 99 do
{
diag_log "DMS ERROR :: You have made an error in your DMS config.sqf! Cancelling DMS Launch.";
};
};
RESISTANCE setFriend[WEST,0];
WEST setFriend[RESISTANCE,0];
RESISTANCE setFriend[EAST,0];
EAST setFriend[RESISTANCE,0];
EAST setFriend[WEST,0];
WEST setFriend[EAST,0];
if ((!isNil "A3XAI_isActive") && {!DMS_ai_offload_Only_DMS_AI}) then
{
diag_log 'DMS DETECTED A3XAI. Enabling "DMS_ai_offload_Only_DMS_AI"!';
DMS_ai_offload_Only_DMS_AI = true;
};
if ((isClass (configFile >> "CfgPatches" >> "Ryanzombies")) && {!DMS_ai_offload_Only_DMS_AI}) then
{
diag_log 'DMS DETECTED RyanZombies. Enabling "DMS_ai_offload_Only_DMS_AI"!';
DMS_ai_offload_Only_DMS_AI = true;
};
DMS_A3_AllMarkerColors = [];
for "_i" from 0 to ((count(configfile >> "CfgMarkerColors"))-1) do
{
DMS_A3_AllMarkerColors pushBack (toLower (configName ((configfile >> "CfgMarkerColors") select _i)));
};
if !((toLower DMS_MissionMarkerWinDotColor) in DMS_A3_AllMarkerColors) then
{
diag_log format ["DMS ERROR :: Unsupported color for DMS_MissionMarkerWinDotColor (""%1""). Switching color to ""ColorBlue"".",DMS_MissionMarkerWinDotColor];
DMS_MissionMarkerWinDotColor = "ColorBlue";
};
if !((toLower DMS_MissionMarkerLoseDotColor) in DMS_A3_AllMarkerColors) then
{
diag_log format ["DMS ERROR :: Unsupported color for DMS_MissionMarkerLoseDotColor (""%1""). Switching color to ""ColorRed"".",DMS_MissionMarkerLoseDotColor];
DMS_MissionMarkerLoseDotColor = "ColorRed";
};
// Create and send Client Functions using compileFinal for security.
DMS_CLIENT_fnc_spawnDynamicText = compileFinal
("
[
_this,
0,
safeZoneY,
"+str DMS_dynamicText_Duration+",
"+str DMS_dynamicText_FadeTime+",
0,
24358
] spawn BIS_fnc_dynamicText;
");
publicVariable "DMS_CLIENT_fnc_spawnDynamicText";
DMS_CLIENT_fnc_spawnTextTiles = compileFinal
("
[
parseText _this,
[
0,
safeZoneY,
1,
1
],
[10,10],
"+str DMS_textTiles_Duration+",
"+str DMS_textTiles_FadeTime+",
0
] spawn BIS_fnc_textTiles;
");
publicVariable "DMS_CLIENT_fnc_spawnTextTiles";
// Add the weighted predefined locations to the list of predefined locations
{
for "_i" from 1 to (_x select 1) do
{
DMS_PredefinedMissionLocations pushBack (_x select 0);
};
} forEach DMS_PredefinedMissionLocations_WEIGHTED;
// Set up the minimum/maximum co-ordinate values for x and y...
DMS_MinMax_X_Coords = [DMS_MinDistFromWestBorder, worldSize - DMS_MinDistFromEastBorder];
DMS_MinMax_Y_Coords = [DMS_MinDistFromSouthBorder, worldSize - DMS_MinDistFromNorthBorder];
if (DMS_DynamicMission || {DMS_StaticMission}) then
{
call compileFinal preprocessFileLineNumbers "\x\addons\dms\missions\static_init.sqf";
call compileFinal preprocessFileLineNumbers "\x\addons\dms\missions\mission_init.sqf";
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"];
};
execFSM "\x\addons\dms\FSM\missions.fsm";
}
else
{
diag_log "Enjoy the DMS functions! :)";
};
DMS_Version = "November 14 2015";
"DMS post-init complete." call DMS_fnc_DebugLog;