Hopefully final RC

This commit is contained in:
eraser1 2016-06-20 16:12:06 -05:00
parent e1f9a44604
commit 1f78dce76a
9 changed files with 95 additions and 32 deletions

View File

@ -4,7 +4,7 @@ class CfgPatches
{ {
units[] = {}; units[] = {};
weapons[] = {}; weapons[] = {};
a3_DMS_version = "June 12, 2016 (RC1.2)"; a3_DMS_version = "June 20, 2016 (RC1.5)";
requiredVersion = 1.36; requiredVersion = 1.36;
requiredAddons[] = {"exile_client","exile_server_config"}; requiredAddons[] = {"exile_client","exile_server_config"};
}; };
@ -30,6 +30,7 @@ class CfgFunctions
file = "\x\addons\dms\scripts"; file = "\x\addons\dms\scripts";
class AddMissionToMonitor {}; class AddMissionToMonitor {};
class AddMissionToMonitor_Static {}; class AddMissionToMonitor_Static {};
class AddWeapon {};
class AILocalityManager {}; class AILocalityManager {};
class BroadcastMissionStatus {}; class BroadcastMissionStatus {};
class CalcPos {}; class CalcPos {};

View File

@ -628,7 +628,8 @@ DMS_SpawnMissions_Scheduled = false; // Whether or not to spawn missions in a sc
"Exile_Item_EMRE", "Exile_Item_EMRE",
"Exile_Item_PlasticBottleCoffee", "Exile_Item_PlasticBottleCoffee",
"Exile_Item_CanOpener", "Exile_Item_CanOpener",
"Exile_Item_Instadoc" "Exile_Item_Instadoc",
"Exile_Item_DuctTape"
]; ];
DMS_sniper_helmets = [ // Helmets for Sniper Class DMS_sniper_helmets = [ // Helmets for Sniper Class
"H_HelmetSpecB_paint1", "H_HelmetSpecB_paint1",

View File

@ -129,6 +129,9 @@ publicVariable "DMS_CLIENT_fnc_hintSilent";
publicVariable "DMS_Version"; 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 // Add the weighted predefined locations to the list of predefined locations
{ {

View File

@ -7,7 +7,7 @@
*/ */
DMS_MinDistFromWestBorder = 2000; // Exclude the 3 small islands DMS_MinDistFromWestBorder = 1300;
DMS_MinDistFromEastBorder = 1700; // Mostly ocean and mountains in that area DMS_MinDistFromEastBorder = 800;
DMS_MinDistFromSouthBorder = 1500; // Exclude "Tuadua Island" DMS_MinDistFromSouthBorder = 1500;
DMS_MinDistFromNorthBorder = 2500; // Exclude the northern islands and airfields DMS_MinDistFromNorthBorder = 1900;

View File

@ -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, // <object> unit that is issued new equipment
_weapon, // <string> weapon classname
_magazineCount, // <scalar> number of magazines
_magClassname // (Optional): <scalar> index of magazine class in weapon's config (default 0) OR <string> 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];
};

View File

@ -22,7 +22,7 @@ exitWith
false false
}; };
private _result = false; private _result = false;
try try
{ {

View File

@ -169,17 +169,14 @@ if ((!isNull _playerObj) && {(_playerUID != "") && {_playerObj isKindOf "Exile_U
}; };
//DONKEYPUNCH CUSTOM KILL RANK CHANGE FOR AI KILL //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];
_playerRank = (_playerRank+_rankChange); format["modifyAccountHumanity:%1:%2",_rankChange,getPlayerUID _killer] call ExileServer_system_database_query_fireAndForget;
_killer setVariable ["ExileHumanity",_playerRank]; ExileClientPlayerHumanity = _playerRank;
format["modifyAccountHumanity:%1:%2",_rankChange,getPlayerUID _killer] call ExileServer_system_database_query_fireAndForget; (owner _playerObj) publicVariableClient "ExileClientPlayerHumanity";
ExileClientPlayerHumanity = _playerRank; ExileClientPlayerHumanity = nil;
(owner _playerObj) publicVariableClient "ExileClientPlayerHumanity";
ExileClientPlayerHumanity = nil;
};
}; };

View File

@ -89,7 +89,6 @@ _difficulty =
//Create unit //Create unit
private _unit = _group createUnit [DMS_AI_Classname, _pos, [], 0,"FORM"]; private _unit = _group createUnit [DMS_AI_Classname, _pos, [], 0,"FORM"];
_unit allowFleeing 0; _unit allowFleeing 0;
[_unit] joinSilent _group;
// Remove existing gear // Remove existing gear
{_unit removeWeaponGlobal _x;} forEach (weapons _unit); {_unit removeWeaponGlobal _x;} forEach (weapons _unit);
@ -156,11 +155,18 @@ if (_customGearSet isEqualTo []) then
} forEach (missionNamespace getVariable [format ["DMS_%1_equipment",_class],[]]); } 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. // 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]; private _randItemCount = missionNamespace getVariable [format ["DMS_%1_RandItemCount",_class],0];
if (_randItemCount>0) then 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 for "_i" from 1 to _randItemCount do
{ {
_unit addItem (selectRandom _randItems); _unit addItem (selectRandom _randItems);
@ -171,13 +177,6 @@ if (_customGearSet isEqualTo []) then
// Items (Loot stuff that goes in uniform/vest/backpack) // Items (Loot stuff that goes in uniform/vest/backpack)
{_unit addItem _x;} forEach (missionNamespace getVariable [format ["DMS_%1_items",_class],[]]); {_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 // Make AI effective at night
private _nighttime = (sunOrMoon != 1); private _nighttime = (sunOrMoon != 1);
if (_nighttime) then if (_nighttime) then
@ -188,7 +187,7 @@ if (_customGearSet isEqualTo []) then
if (!_unarmed) then if (!_unarmed) then
{ {
private _weapon = selectRandom (missionNamespace getVariable [format ["DMS_%1_weps",_class],DMS_assault_weps]); 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; _unit selectWeapon _weapon;
@ -216,6 +215,7 @@ if (_customGearSet isEqualTo []) then
}; };
}; };
/*
// In case spawn position is water // In case spawn position is water
if (DMS_ai_enable_water_equipment && {surfaceIsWater _pos}) then if (DMS_ai_enable_water_equipment && {surfaceIsWater _pos}) then
{ {
@ -224,14 +224,15 @@ if (_customGearSet isEqualTo []) then
_unit forceAddUniform "U_O_Wetsuit"; _unit forceAddUniform "U_O_Wetsuit";
_unit addVest "V_RebreatherIA"; _unit addVest "V_RebreatherIA";
_unit addGoggles "G_Diving"; _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],[]]; private _pistols = missionNamespace getVariable [format ["DMS_%1_pistols",_class],[]];
if !(_pistols isEqualTo []) then if !(_pistols isEqualTo []) then
{ {
private _pistol = selectRandom _pistols; 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 // Infinite Ammo
@ -288,14 +289,14 @@ else
if !(_launcher isEqualTo "") then if !(_launcher isEqualTo "") then
{ {
[_unit, _launcher, 0] call BIS_fnc_addWeapon; _unit addWeapon _launcher;
}; };
// Add pistol and attachments // Add pistol and attachments
if !(_pistol isEqualTo "") then if !(_pistol isEqualTo "") then
{ {
[_unit, _pistol, 0] call BIS_fnc_addWeapon; _unit addWeapon _pistol;
{ {
_unit addHandgunItem _x; _unit addHandgunItem _x;
@ -306,7 +307,7 @@ else
// Add gun and attachments // Add gun and attachments
if !(_weapon isEqualTo "") then if !(_weapon isEqualTo "") then
{ {
[_unit, _weapon, 0] call BIS_fnc_addWeapon; _unit addWeapon _weapon;
{ {
_unit addPrimaryWeaponItem _x; _unit addPrimaryWeaponItem _x;
@ -420,5 +421,7 @@ if (DMS_DEBUG) then
}; };
[_unit] joinSilent _group;
_unit _unit

View File

@ -150,6 +150,12 @@ ___
# Changelog: # Changelog:
### Test Branch: ### 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**: #### 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. * 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) * Fixed an issue with fn_SpawnMineField.sqf (thanks to CEN for providing important info)