diff --git a/@ExileServer/addons/a3_dms/config.cpp b/@ExileServer/addons/a3_dms/config.cpp index 3a736ae..249319a 100644 --- a/@ExileServer/addons/a3_dms/config.cpp +++ b/@ExileServer/addons/a3_dms/config.cpp @@ -4,7 +4,7 @@ class CfgPatches { units[] = {}; weapons[] = {}; - a3_DMS_version = "June 12, 2016 (RC1.2)"; + a3_DMS_version = "June 20, 2016 (RC1.5)"; requiredVersion = 1.36; requiredAddons[] = {"exile_client","exile_server_config"}; }; @@ -30,6 +30,7 @@ class CfgFunctions file = "\x\addons\dms\scripts"; class AddMissionToMonitor {}; class AddMissionToMonitor_Static {}; + class AddWeapon {}; class AILocalityManager {}; class BroadcastMissionStatus {}; class CalcPos {}; diff --git a/@ExileServer/addons/a3_dms/config.sqf b/@ExileServer/addons/a3_dms/config.sqf index d09a021..4d83649 100644 --- a/@ExileServer/addons/a3_dms/config.sqf +++ b/@ExileServer/addons/a3_dms/config.sqf @@ -628,7 +628,8 @@ DMS_SpawnMissions_Scheduled = false; // Whether or not to spawn missions in a sc "Exile_Item_EMRE", "Exile_Item_PlasticBottleCoffee", "Exile_Item_CanOpener", - "Exile_Item_Instadoc" + "Exile_Item_Instadoc", + "Exile_Item_DuctTape" ]; DMS_sniper_helmets = [ // Helmets for Sniper Class "H_HelmetSpecB_paint1", diff --git a/@ExileServer/addons/a3_dms/fn_DMS_postInit.sqf b/@ExileServer/addons/a3_dms/fn_DMS_postInit.sqf index 710cf7c..94d97a5 100644 --- a/@ExileServer/addons/a3_dms/fn_DMS_postInit.sqf +++ b/@ExileServer/addons/a3_dms/fn_DMS_postInit.sqf @@ -129,6 +129,9 @@ publicVariable "DMS_CLIENT_fnc_hintSilent"; publicVariable "DMS_Version"; +format["DMS_Version: %1",DMS_Version] remoteExecCall ["diag_log", -2, "DMS_LogVersion_JIP_ID"]; + + // Add the weighted predefined locations to the list of predefined locations { diff --git a/@ExileServer/addons/a3_dms/map_configs/tanoa_config.sqf b/@ExileServer/addons/a3_dms/map_configs/tanoa_config.sqf index ee971eb..4497775 100644 --- a/@ExileServer/addons/a3_dms/map_configs/tanoa_config.sqf +++ b/@ExileServer/addons/a3_dms/map_configs/tanoa_config.sqf @@ -7,7 +7,7 @@ */ -DMS_MinDistFromWestBorder = 2000; // Exclude the 3 small islands -DMS_MinDistFromEastBorder = 1700; // Mostly ocean and mountains in that area -DMS_MinDistFromSouthBorder = 1500; // Exclude "Tuadua Island" -DMS_MinDistFromNorthBorder = 2500; // Exclude the northern islands and airfields +DMS_MinDistFromWestBorder = 1300; +DMS_MinDistFromEastBorder = 800; +DMS_MinDistFromSouthBorder = 1500; +DMS_MinDistFromNorthBorder = 1900; diff --git a/@ExileServer/addons/a3_dms/scripts/fn_AddWeapon.sqf b/@ExileServer/addons/a3_dms/scripts/fn_AddWeapon.sqf new file mode 100644 index 0000000..9675f62 --- /dev/null +++ b/@ExileServer/addons/a3_dms/scripts/fn_AddWeapon.sqf @@ -0,0 +1,52 @@ +/* + DMS_fnc_AddWeapon + created by eraser1 - based off of BIS_fnc_AddWeapon + + Description: + Add a weapon to a unit with the right magazines. Magazine class is obtained from the weapon's config. + + Usage: + [ + _unit, // unit that is issued new equipment + _weapon, // weapon classname + _magazineCount, // number of magazines + _magClassname // (Optional): index of magazine class in weapon's config (default 0) OR magazine classname + ] call DMS_fnc_AddWeapon; + + Nothing is returned +*/ + +if (params +[ + "_unit", + "_weapon", + "_magazineCount" +]) +then +{ + //Add magazines + if (_magazineCount > 0) then + { + private _magazine = + if ((count _this) > 3) then + { + _this select 3 + } + else + { + (getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines")) select 0 + }; + + for "_i" from 1 to _magazineCount do + { + _unit addMagazine _magazine; + }; + }; + + //Add weapon + _unit addWeapon _weapon; +} +else +{ + diag_log format["DMS ERROR :: Calling DMS_fnc_AddWeapon with invalid parameters: %1",_this]; +}; diff --git a/@ExileServer/addons/a3_dms/scripts/fn_IsNearWater.sqf b/@ExileServer/addons/a3_dms/scripts/fn_IsNearWater.sqf index 20d1595..2ba6e8c 100644 --- a/@ExileServer/addons/a3_dms/scripts/fn_IsNearWater.sqf +++ b/@ExileServer/addons/a3_dms/scripts/fn_IsNearWater.sqf @@ -22,7 +22,7 @@ exitWith false }; -private _result = false; +private _result = false; try { diff --git a/@ExileServer/addons/a3_dms/scripts/fn_PlayerAwardOnAIKill.sqf b/@ExileServer/addons/a3_dms/scripts/fn_PlayerAwardOnAIKill.sqf index 05385bb..cb2860d 100644 --- a/@ExileServer/addons/a3_dms/scripts/fn_PlayerAwardOnAIKill.sqf +++ b/@ExileServer/addons/a3_dms/scripts/fn_PlayerAwardOnAIKill.sqf @@ -169,17 +169,14 @@ if ((!isNull _playerObj) && {(_playerUID != "") && {_playerObj isKindOf "Exile_U }; //DONKEYPUNCH CUSTOM KILL RANK CHANGE FOR AI KILL - if (DMS_Enable_RankChange) then + if (DMS_Enable_RankChange && {_rankChange!=0}) then { - if (_rankChange!=0) then - { - _playerRank = (_playerRank+_rankChange); - _killer setVariable ["ExileHumanity",_playerRank]; - format["modifyAccountHumanity:%1:%2",_rankChange,getPlayerUID _killer] call ExileServer_system_database_query_fireAndForget; - ExileClientPlayerHumanity = _playerRank; - (owner _playerObj) publicVariableClient "ExileClientPlayerHumanity"; - ExileClientPlayerHumanity = nil; - }; + _playerRank = (_playerRank+_rankChange); + _killer setVariable ["ExileHumanity",_playerRank]; + format["modifyAccountHumanity:%1:%2",_rankChange,getPlayerUID _killer] call ExileServer_system_database_query_fireAndForget; + ExileClientPlayerHumanity = _playerRank; + (owner _playerObj) publicVariableClient "ExileClientPlayerHumanity"; + ExileClientPlayerHumanity = nil; }; diff --git a/@ExileServer/addons/a3_dms/scripts/fn_SpawnAISoldier.sqf b/@ExileServer/addons/a3_dms/scripts/fn_SpawnAISoldier.sqf index 9cee6d7..07f067c 100644 --- a/@ExileServer/addons/a3_dms/scripts/fn_SpawnAISoldier.sqf +++ b/@ExileServer/addons/a3_dms/scripts/fn_SpawnAISoldier.sqf @@ -89,7 +89,6 @@ _difficulty = //Create unit private _unit = _group createUnit [DMS_AI_Classname, _pos, [], 0,"FORM"]; _unit allowFleeing 0; -[_unit] joinSilent _group; // Remove existing gear {_unit removeWeaponGlobal _x;} forEach (weapons _unit); @@ -156,11 +155,18 @@ if (_customGearSet isEqualTo []) then } forEach (missionNamespace getVariable [format ["DMS_%1_equipment",_class],[]]); + // Clothes + _unit addHeadgear (selectRandom (missionNamespace getVariable [format ["DMS_%1_helmets",_class],DMS_assault_helmets])); + _unit forceAddUniform (selectRandom (missionNamespace getVariable [format ["DMS_%1_clothes",_class],DMS_assault_clothes])); + _unit addVest (selectRandom (missionNamespace getVariable [format ["DMS_%1_vests",_class],DMS_assault_vests])); + _unit addBackpackGlobal (selectRandom (missionNamespace getVariable [format ["DMS_%1_backpacks",_class],DMS_assault_backpacks])); + + // Random items that can be added to the unit's inventory, such as food, meds, etc. private _randItemCount = missionNamespace getVariable [format ["DMS_%1_RandItemCount",_class],0]; if (_randItemCount>0) then { - private _randItems = missionNamespace getVariable [format ["DMS_%1_RandItems",_class],0]; + private _randItems = missionNamespace getVariable [format ["DMS_%1_RandItems",_class],["Exile_Item_PlasticBottleFreshWater"]]; for "_i" from 1 to _randItemCount do { _unit addItem (selectRandom _randItems); @@ -171,13 +177,6 @@ if (_customGearSet isEqualTo []) then // Items (Loot stuff that goes in uniform/vest/backpack) {_unit addItem _x;} forEach (missionNamespace getVariable [format ["DMS_%1_items",_class],[]]); - - // Clothes - _unit addHeadgear (selectRandom (missionNamespace getVariable [format ["DMS_%1_helmets",_class],DMS_assault_helmets])); - _unit forceAddUniform (selectRandom (missionNamespace getVariable [format ["DMS_%1_clothes",_class],DMS_assault_clothes])); - _unit addVest (selectRandom (missionNamespace getVariable [format ["DMS_%1_vests",_class],DMS_assault_vests])); - _unit addBackpackGlobal (selectRandom (missionNamespace getVariable [format ["DMS_%1_backpacks",_class],DMS_assault_backpacks])); - // Make AI effective at night private _nighttime = (sunOrMoon != 1); if (_nighttime) then @@ -188,7 +187,7 @@ if (_customGearSet isEqualTo []) then if (!_unarmed) then { private _weapon = selectRandom (missionNamespace getVariable [format ["DMS_%1_weps",_class],DMS_assault_weps]); - [_unit, _weapon, 6 + floor(random 3)] call BIS_fnc_addWeapon; + [_unit, _weapon, 6 + floor(random 3)] call DMS_fnc_AddWeapon; _unit selectWeapon _weapon; @@ -216,6 +215,7 @@ if (_customGearSet isEqualTo []) then }; }; + /* // In case spawn position is water if (DMS_ai_enable_water_equipment && {surfaceIsWater _pos}) then { @@ -224,14 +224,15 @@ if (_customGearSet isEqualTo []) then _unit forceAddUniform "U_O_Wetsuit"; _unit addVest "V_RebreatherIA"; _unit addGoggles "G_Diving"; - [_unit, "arifle_SDAR_F", 4 + floor(random 3), "20Rnd_556x45_UW_mag"] call BIS_fnc_addWeapon; + [_unit, "arifle_SDAR_F", 4 + floor(random 3), "20Rnd_556x45_UW_mag"] call DMS_fnc_AddWeapon; }; + */ private _pistols = missionNamespace getVariable [format ["DMS_%1_pistols",_class],[]]; if !(_pistols isEqualTo []) then { private _pistol = selectRandom _pistols; - [_unit, _pistol, 2 + floor(random 2)] call BIS_fnc_addWeapon; + [_unit, _pistol, 2 + floor(random 2)] call DMS_fnc_AddWeapon; }; // Infinite Ammo @@ -288,14 +289,14 @@ else if !(_launcher isEqualTo "") then { - [_unit, _launcher, 0] call BIS_fnc_addWeapon; + _unit addWeapon _launcher; }; // Add pistol and attachments if !(_pistol isEqualTo "") then { - [_unit, _pistol, 0] call BIS_fnc_addWeapon; + _unit addWeapon _pistol; { _unit addHandgunItem _x; @@ -306,7 +307,7 @@ else // Add gun and attachments if !(_weapon isEqualTo "") then { - [_unit, _weapon, 0] call BIS_fnc_addWeapon; + _unit addWeapon _weapon; { _unit addPrimaryWeaponItem _x; @@ -420,5 +421,7 @@ if (DMS_DEBUG) then }; +[_unit] joinSilent _group; + _unit diff --git a/README.md b/README.md index acf6251..3ba181c 100644 --- a/README.md +++ b/README.md @@ -150,6 +150,12 @@ ___ # Changelog: ### Test Branch: +#### June 16, 2016 (1:55 PM CST-America) **Release Candidate 1.5**: +* New function: DMS_fnc_AddWeapon. More efficient version of BIS_fnc_AddWeapon, and removed almost all error-checking. +* DMS will now log the DMS version to the client RPT on login. +* Fixed a couple issues in fn_SpawnAISoldier.sqf. +* Updated Tanoa config, missions should now be (somewhat) less likely to spawn in the center valley of the main island. + #### June 16, 2016 (1:55 PM CST-America) **Release Candidate 1.3**: * Renamed the "mercbase.sqf" mission title to "Mercenary Outpost" to avoid confusion with the salt flats mission. * Fixed an issue with fn_SpawnMineField.sqf (thanks to CEN for providing important info)