From dae2d2a54ff80868fdf2cae294c1c960f5798d1f Mon Sep 17 00:00:00 2001 From: eraser1 Date: Tue, 1 Sep 2015 01:24:42 -0500 Subject: [PATCH] Fix launchers Launchers should now spawn on AI if you set the config value to true and set the spawn percentage correctly. Launchers will always spawn if you define it in the AI type --- @ExileServer/addons/a3_dms/config.sqf | 6 +++--- @ExileServer/addons/a3_dms/fn_DMS_preInit.sqf | 2 +- @ExileServer/addons/a3_dms/scripts/SpawnAIGroup.sqf | 9 ++++++--- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/@ExileServer/addons/a3_dms/config.sqf b/@ExileServer/addons/a3_dms/config.sqf index 78071d9..9e4d6c0 100644 --- a/@ExileServer/addons/a3_dms/config.sqf +++ b/@ExileServer/addons/a3_dms/config.sqf @@ -1,5 +1,5 @@ /* - A lot of these configs are influenced from WAI :P + A lot of these configs are influenced by WAI :P https://github.com/nerdalertdk/WICKED-AI Created by eraser1 @@ -76,7 +76,7 @@ DMS_DEBUG = false; DMS_remove_roadkill_chance = 0; // Percentage chance that roadkilled AI bodies will be deleted DMS_RemoveNVG = false; // Remove NVGs from AI bodies - DMS_ai_offload_to_client = false; // Offload spawned AI groups to random clients. Helps with server performance. + DMS_ai_offload_to_client = true; // Offload spawned AI groups to random clients. Helps with server performance. DMS_ai_share_info = true; // Share info about killer DMS_ai_share_info_distance = 300; // The distance killer's info will be shared to other AI @@ -381,7 +381,7 @@ DMS_DEBUG = false; DMS_ai_use_launchers = true; // Enable/disable spawning an AI in a group with a launcher DMS_ai_use_launchers_chance = 50; // Percentage chance to actually spawn the launcher (per-group) DMS_AI_launcher_ammo_count = 2; // How many rockets an AI will get with its launcher - DMS_ai_remove_launchers = false; // Remove rocket launchers on AI death + DMS_ai_remove_launchers = true; // Remove rocket launchers on AI death DMS_AI_wep_launchers_AT = [ // AT Launchers "launch_NLAW_F", diff --git a/@ExileServer/addons/a3_dms/fn_DMS_preInit.sqf b/@ExileServer/addons/a3_dms/fn_DMS_preInit.sqf index 5d6dad6..6543701 100644 --- a/@ExileServer/addons/a3_dms/fn_DMS_preInit.sqf +++ b/@ExileServer/addons/a3_dms/fn_DMS_preInit.sqf @@ -31,7 +31,7 @@ DMS_OnKilled = compileFinal preprocessFileLineNumbers "\x\addons\dms\script DMS_SetGroupBehavior = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\SetGroupBehavior.sqf"; DMS_AddMissionToMonitor = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\AddMissionToMonitor.sqf"; DMS_CreateMarker = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\CreateMarker.sqf"; -DMS_FindSuppressor = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\FindSuppressor.sqf";//<--- TODO add new suppressors +DMS_FindSuppressor = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\FindSuppressor.sqf"; DMS_SpawnCrate = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\SpawnCrate.sqf"; //Load config diff --git a/@ExileServer/addons/a3_dms/scripts/SpawnAIGroup.sqf b/@ExileServer/addons/a3_dms/scripts/SpawnAIGroup.sqf index 65d7ed8..3b6cb71 100644 --- a/@ExileServer/addons/a3_dms/scripts/SpawnAIGroup.sqf +++ b/@ExileServer/addons/a3_dms/scripts/SpawnAIGroup.sqf @@ -9,7 +9,7 @@ _count, // Number of AI _difficulty, // "random","hardcore","difficult","moderate", or "easy" _type // "random","assault","MG","sniper" or "unarmed" OR [_type,_launcher] - _side // "bandit","hero", etc. + _side // Only "bandit" is supported atm ] call DMS_SpawnAIGroup; Returns AI Group @@ -77,9 +77,12 @@ for "_i" from 1 to _count do { _unit = [_group,[_pos_x,_pos_y,_pos_z],_type,_difficulty,_side] call DMS_SpawnAISoldier; }; - -if (DMS_ai_use_launchers && {(!isNil "_launcher") && {(random 100) <= DMS_ai_use_launchers_chance}}) then { + if (!isNil "_launcher") then + { + _launcher = "AT"; + }; + _launcher = ((missionNamespace getVariable [format ["DMS_AI_wep_launchers_%1",_launcher],["launch_NLAW_F"]]) call BIS_fnc_selectRandom); _unit addBackpack "B_Carryall_mcamo";