From 86a4ad9b77aad93b655139a98a0a89c4732a63f4 Mon Sep 17 00:00:00 2001 From: eraser1 Date: Sun, 13 Sep 2015 23:52:02 -0500 Subject: [PATCH] Minor Update for today... --- @ExileServer/addons/a3_dms/config.sqf | 4 +-- .../addons/a3_dms/scripts/fn_OnKilled.sqf | 28 ++++++++++-------- .../a3_dms/scripts/fn_SetAILocality.sqf | 3 +- .../addons/a3_dms/scripts/fn_SpawnAIGroup.sqf | 10 ++++--- Pre-Packed PBO/a3_dms.pbo | Bin 181844 -> 182110 bytes README.md | 5 ++++ 6 files changed, 30 insertions(+), 20 deletions(-) diff --git a/@ExileServer/addons/a3_dms/config.sqf b/@ExileServer/addons/a3_dms/config.sqf index ed948bc..b7a7bd4 100644 --- a/@ExileServer/addons/a3_dms/config.sqf +++ b/@ExileServer/addons/a3_dms/config.sqf @@ -52,11 +52,11 @@ DMS_DEBUG = false; //Mission notification settings DMS_PlayerNotificationTypes = [ // Notification types. Supported values are: ["dynamicTextRequest", "standardHintRequest", "systemChatRequest"] - //"dynamicTextRequest", <--- Won't work in Exile v0.9.19 + //"dynamicTextRequest", <--- Text formatting makes this weird... "standardHintRequest" //"systemChatRequest" ]; - DMS_dynamicText_Size = "0.65"; // Dynamic Text size for "dynamicTextRequest" notification type. + DMS_dynamicText_Size = 0.65; // Dynamic Text size for "dynamicTextRequest" notification type. DMS_dynamicText_Color = "#FFCC00"; // Dynamic Text color for "dynamicTextRequest" notification type. DMS_MissionTypes = [ // List of missions with spawn chances. If they add up to 100%, they represent the percentage chance each one will spawn diff --git a/@ExileServer/addons/a3_dms/scripts/fn_OnKilled.sqf b/@ExileServer/addons/a3_dms/scripts/fn_OnKilled.sqf index 2ea30bc..3951f93 100644 --- a/@ExileServer/addons/a3_dms/scripts/fn_OnKilled.sqf +++ b/@ExileServer/addons/a3_dms/scripts/fn_OnKilled.sqf @@ -30,16 +30,24 @@ _type = _this select 2; _launcher = secondaryWeapon _unit; _playerObj = objNull; -// Remove gear according to configs -if (DMS_clear_AI_body && {(random 100) <= DMS_clear_AI_body_chance}) then +// Some of the previously used functions work with non-local argument. Some don't. BIS is annoying +_removeAll = { - removeAllWeapons _unit; - removeAllAssignedItems _unit; + {_this removeWeaponGlobal _x;} forEach (weapons _this); + {_this unlinkItem _x;} forEach (assignedItems _this); + {_this removeItem _x;} forEach (items _this); + removeAllItemsWithMagazines _unit; removeHeadgear _unit; removeUniform _unit; removeVest _unit; - removeBackpack _unit; + removeBackpackGlobal _unit; +}; + +// Remove gear according to configs +if (DMS_clear_AI_body && {(random 100) <= DMS_clear_AI_body_chance}) then +{ + _unit call _removeAll; }; if(DMS_ai_remove_launchers && {_launcher != ""}) then @@ -50,7 +58,7 @@ if(DMS_ai_remove_launchers && {_launcher != ""}) then { if(_x == _rockets) then { - _unit removeMagazine _x; + _unit removeMagazineGlobal _x; }; } forEach magazines _unit; }; @@ -112,13 +120,7 @@ if (isPlayer _player) then // Remove gear from roadkills if configured to do so if (DMS_remove_roadkill && {(random 100) <= DMS_remove_roadkill_chance}) then { - removeAllWeapons _unit; - removeAllAssignedItems _unit; - removeAllItemsWithMagazines _unit; - removeHeadgear _unit; - removeUniform _unit; - removeVest _unit; - removeBackpack _unit; + _unit call _removeAll; }; };}; diff --git a/@ExileServer/addons/a3_dms/scripts/fn_SetAILocality.sqf b/@ExileServer/addons/a3_dms/scripts/fn_SetAILocality.sqf index a829c12..df3a459 100644 --- a/@ExileServer/addons/a3_dms/scripts/fn_SetAILocality.sqf +++ b/@ExileServer/addons/a3_dms/scripts/fn_SetAILocality.sqf @@ -45,7 +45,8 @@ _client = objNull; }; } forEach allPlayers; -if (!isNull _client) then{ +if (!isNull _client) then +{ ExileServerOwnershipSwapQueue pushBack [_AI,_client]; if (DMS_DEBUG) then { diff --git a/@ExileServer/addons/a3_dms/scripts/fn_SpawnAIGroup.sqf b/@ExileServer/addons/a3_dms/scripts/fn_SpawnAIGroup.sqf index c1d2abb..1f0d489 100644 --- a/@ExileServer/addons/a3_dms/scripts/fn_SpawnAIGroup.sqf +++ b/@ExileServer/addons/a3_dms/scripts/fn_SpawnAIGroup.sqf @@ -73,7 +73,8 @@ if(_pos_z == 0) then _group = createGroup (missionNamespace getVariable [format ["DMS_%1Side",_side],EAST]); -for "_i" from 1 to _count do { +for "_i" from 1 to _count do +{ _unit = [_group,[_pos_x,_pos_y,_pos_z],_class,_difficulty,_side,"Soldier"] call DMS_fnc_SpawnAISoldier; }; @@ -87,14 +88,15 @@ if ((!isNil "_launcher") || {DMS_ai_use_launchers && {(random 100) <= DMS_ai_use _launcher = ((missionNamespace getVariable [format ["DMS_AI_wep_launchers_%1",_launcher],["launch_NLAW_F"]]) call BIS_fnc_selectRandom); - removeBackpack _unit; + removeBackpackGlobal _unit; _unit addBackpack "B_Carryall_mcamo"; + _rocket = _launcher call DMS_fnc_selectMagazine; - [_unit, _launcher, DMS_AI_launcher_ammo_count] call BIS_fnc_addWeapon; + [_unit, _launcher, DMS_AI_launcher_ammo_count,_rocket] call BIS_fnc_addWeapon; if(DMS_DEBUG) then { - diag_log format["DMS_DEBUG SpawnAIGroup :: Giving %1 a %2 launcher.",_unit,_launcher]; + diag_log format["DMS_DEBUG SpawnAIGroup :: Giving %1 a %2 launcher with %3 %4 rockets",_unit,_launcher,DMS_AI_launcher_ammo_count,_rocket]; }; }; diff --git a/Pre-Packed PBO/a3_dms.pbo b/Pre-Packed PBO/a3_dms.pbo index 4886b5758ded4bf83d6e1f8311ee971d9af36b53..6bc1ad4d14eda6811cf058c459d2697243d77f29 100644 GIT binary patch delta 925 zcmZva%}*0S7{={r3vFHS3yehV8x2t6veY89N+f=Ogaal78ZKa2xQdp}Ut6SdE^)tt1Z(-8iP`vIQsKNb2oKmn35}q>SpwM_+CUKAn^bL)` zv`J!yOo=YQXhPN@BP$AsicUcllNeN4*DGDnQ(}gINF*?16;smym1-Dnn{q6vWWitX zy>GZ7aGs71=#%xzg%IW6-gd#+uH9Nf?U`S!zO(&(oBpvlsa0P^#>5vpRK)65M+O2cWHnmQZ8)UmW12xO?1WO*0~ zAe6K#G$yiSw798aVhB+6kSJ+o>uZA}z-AQ*p;^Ytd7>ItX&PT;SzhKmvz*608?DAs zt>^F<7E_cAD0GT>MrV5FDwFn$u>|-t)s_y`^KCu5QWl&{l7j|T_b5d6L~(+pO6xy5 z8|80Z< z6XRW6okHC=hYH5>Nr&g>sh22}=NDxwWacTjR%8OzmKo?->KR&2zAB&3revUJW~$We zq0sK3z_{H*foUB-pP`9~jv0`M)iKa9Go9|M&y=t|$AC#gXS#13Q=wo{YHog6s$))0 zcxqw+$l22$#xe;@0RwvVETm>Ofu8E`k3N{^pteKDs