mirror of
https://github.com/Defent/DMS_Exile.git
synced 2024-08-30 16:52:12 +00:00
Test pls
This commit is contained in:
parent
33e70014c9
commit
bbedb1e607
@ -49,6 +49,7 @@ class CfgFunctions
|
|||||||
class SetGroupBehavior {};
|
class SetGroupBehavior {};
|
||||||
class SpawnAIGroup {};
|
class SpawnAIGroup {};
|
||||||
class SpawnAISoldier {};
|
class SpawnAISoldier {};
|
||||||
|
class SpawnAIStatic {};
|
||||||
class SpawnCrate {};
|
class SpawnCrate {};
|
||||||
class SpawnNonPersistentVehicle {};
|
class SpawnNonPersistentVehicle {};
|
||||||
class TargetsKilled {};
|
class TargetsKilled {};
|
||||||
|
@ -21,8 +21,10 @@ DMS_DEBUG = false;
|
|||||||
|
|
||||||
DMS_AI_KillPercent = 100; // The percent amount of AI that need to be killed for "killPercent" mission requirement (NOT IMPLEMENTED)
|
DMS_AI_KillPercent = 100; // The percent amount of AI that need to be killed for "killPercent" mission requirement (NOT IMPLEMENTED)
|
||||||
|
|
||||||
DMS_BanditMoneyGainOnKill = 50; // The amount of Poptabs gained for killing a bandit
|
DMS_Bandit_Soldier_MoneyGain = 50; // The amount of Poptabs gained for killing a bandit soldier
|
||||||
DMS_BanditRepGainOnKill = 10; // The amount of Respect gained for killing a bandit
|
DMS_Bandit_Soldier_RepGain = 10; // The amount of Respect gained for killing a bandit soldier
|
||||||
|
DMS_Bandit_Static_MoneyGain = 100; // The amount of Poptabs gained for killing a bandit static gunner
|
||||||
|
DMS_Bandit_Static_RepGain = 25; // The amount of Respect gained for killing a bandit static gunner
|
||||||
|
|
||||||
DMS_MissionMarkerWinDot = true; // Keep the mission marker dot with a "win" message after mission is over
|
DMS_MissionMarkerWinDot = true; // Keep the mission marker dot with a "win" message after mission is over
|
||||||
DMS_MissionMarkerLoseDot = true; // Keep the mission marker dot with a "lose" message after mission is over
|
DMS_MissionMarkerLoseDot = true; // Keep the mission marker dot with a "lose" message after mission is over
|
||||||
@ -87,6 +89,7 @@ DMS_DEBUG = false;
|
|||||||
DMS_banditSide = EAST; // The side (team) that AI Bandits will spawn on
|
DMS_banditSide = EAST; // The side (team) that AI Bandits will spawn on
|
||||||
DMS_clear_AI_body = false; // Clear AI body as soon as they die
|
DMS_clear_AI_body = false; // Clear AI body as soon as they die
|
||||||
DMS_clear_AI_body_chance = 50; // Percentage chance that AI bodies will be cleared when they die
|
DMS_clear_AI_body_chance = 50; // Percentage chance that AI bodies will be cleared when they die
|
||||||
|
DMS_ai_disable_ramming_damage = true; // Disables damage due to ramming into AI. !!!NOTE: THIS WILL NOT BE RELIABLE WITH "DMS_ai_offload_to_client"!!!
|
||||||
DMS_credit_roadkill = false; // Credit players with respect/poptabs if they kill an AI by running it over
|
DMS_credit_roadkill = false; // Credit players with respect/poptabs if they kill an AI by running it over
|
||||||
DMS_remove_roadkill = true; // Remove gear from AI bodies that are roadkilled
|
DMS_remove_roadkill = true; // Remove gear from AI bodies that are roadkilled
|
||||||
DMS_remove_roadkill_chance = 50; // Percentage chance that roadkilled AI bodies will be deleted
|
DMS_remove_roadkill_chance = 50; // Percentage chance that roadkilled AI bodies will be deleted
|
||||||
@ -101,7 +104,6 @@ DMS_DEBUG = false;
|
|||||||
DMS_ai_enable_water_equipment = true; // Enable/disable overriding default weapons of an AI if it spawns on/in water
|
DMS_ai_enable_water_equipment = true; // Enable/disable overriding default weapons of an AI if it spawns on/in water
|
||||||
|
|
||||||
// https://community.bistudio.com/wiki/AI_Sub-skills#general
|
// https://community.bistudio.com/wiki/AI_Sub-skills#general
|
||||||
DMS_ai_static_skills = true; // Use "DMS_ai_skill_static" for AI on static guns
|
|
||||||
DMS_ai_skill_static = [["aimingAccuracy",0.20],["aimingShake",0.70],["aimingSpeed",0.75],["spotDistance",0.70],["spotTime",0.50],["courage",1.00],["reloadSpeed",1.00],["commanding",1.00],["general",1.00]]; // Static AI Skills
|
DMS_ai_skill_static = [["aimingAccuracy",0.20],["aimingShake",0.70],["aimingSpeed",0.75],["spotDistance",0.70],["spotTime",0.50],["courage",1.00],["reloadSpeed",1.00],["commanding",1.00],["general",1.00]]; // Static AI Skills
|
||||||
DMS_ai_skill_easy = [["aimingAccuracy",0.30],["aimingShake",0.50],["aimingSpeed",0.50],["spotDistance",0.50],["spotTime",0.50],["courage",1.00],["reloadSpeed",1.00],["commanding",1.00],["general",0.50]]; // Easy
|
DMS_ai_skill_easy = [["aimingAccuracy",0.30],["aimingShake",0.50],["aimingSpeed",0.50],["spotDistance",0.50],["spotTime",0.50],["courage",1.00],["reloadSpeed",1.00],["commanding",1.00],["general",0.50]]; // Easy
|
||||||
DMS_ai_skill_moderate = [["aimingAccuracy",0.60],["aimingShake",0.60],["aimingSpeed",0.60],["spotDistance",0.60],["spotTime",0.60],["courage",1.00],["reloadSpeed",1.00],["commanding",1.00],["general",0.60]]; // Moderate
|
DMS_ai_skill_moderate = [["aimingAccuracy",0.60],["aimingShake",0.60],["aimingSpeed",0.60],["spotDistance",0.60],["spotTime",0.60],["courage",1.00],["reloadSpeed",1.00],["commanding",1.00],["general",0.60]]; // Moderate
|
||||||
|
@ -10,12 +10,12 @@
|
|||||||
_killer
|
_killer
|
||||||
],
|
],
|
||||||
_side, // "bandit" only for now
|
_side, // "bandit" only for now
|
||||||
_type // not currently used
|
_type // Type of AI: "soldier","static","vehicle","heli", etc.
|
||||||
] call DMS_fnc_OnKilled;
|
] call DMS_fnc_OnKilled;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
private ["_unit", "_player", "_playerObj", "_side", "_type", "_launcher", "_rockets", "_money", "_respect", "_moneyGain", "_repGain"];
|
private ["_unit", "_player", "_side", "_type", "_launcher", "_playerObj", "_rockets", "_grpUnits", "_veh", "_moneyGain", "_repGain", "_money", "_respect"];
|
||||||
|
|
||||||
|
|
||||||
if (DMS_DEBUG) then
|
if (DMS_DEBUG) then
|
||||||
@ -124,8 +124,8 @@ if (isPlayer _player) then
|
|||||||
|
|
||||||
if ((!isNull _playerObj) && {((getPlayerUID _playerObj) != "")}) then
|
if ((!isNull _playerObj) && {((getPlayerUID _playerObj) != "")}) then
|
||||||
{
|
{
|
||||||
_moneyGain = missionNamespace getVariable [format ["DMS_%1MoneyGainOnKill",_side],0];
|
_moneyGain = missionNamespace getVariable [format ["DMS_%1_%2_MoneyGain",_side,_type],0];
|
||||||
_repGain = missionNamespace getVariable [format ["DMS_%1RepGainOnKill",_side],0];
|
_repGain = missionNamespace getVariable [format ["DMS_%1_%2_RepGain",_side,_type],0];
|
||||||
|
|
||||||
if ((_moneyGain>0) || (_repGain>0)) then
|
if ((_moneyGain>0) || (_repGain>0)) then
|
||||||
{
|
{
|
||||||
|
@ -7,21 +7,21 @@
|
|||||||
[
|
[
|
||||||
_pos, // Position of AI
|
_pos, // Position of AI
|
||||||
_count, // Number of AI
|
_count, // Number of AI
|
||||||
_difficulty, // "random","hardcore","difficult","moderate", or "easy"
|
_difficulty, // AI Difficulty: "random","hardcore","difficult","moderate", or "easy"
|
||||||
_type // "random","assault","MG","sniper" or "unarmed" OR [_type,_launcher]
|
_class // AI Class: "random","assault","MG","sniper" or "unarmed" OR [_class,_launcher]
|
||||||
_side // Only "bandit" is supported atm
|
_side // Only "bandit" is supported atm
|
||||||
] call DMS_fnc_SpawnAIGroup;
|
] call DMS_fnc_SpawnAIGroup;
|
||||||
|
|
||||||
Returns AI Group
|
Returns AI Group
|
||||||
*/
|
*/
|
||||||
private ["_OK", "_pos", "_count", "_difficulty", "_type", "_side", "_pos_x", "_pos_y", "_pos_z", "_launcher", "_unit", "_client"];
|
private ["_OK", "_pos", "_count", "_difficulty", "_class", "_side", "_pos_x", "_pos_y", "_pos_z", "_launcher", "_unit", "_client"];
|
||||||
|
|
||||||
_OK = params
|
_OK = params
|
||||||
[
|
[
|
||||||
["_pos",[0,0,0],[[]],[3]],
|
["_pos",[0,0,0],[[]],[3]],
|
||||||
["_count",0,[0]],
|
["_count",0,[0]],
|
||||||
["_difficulty","random",[""]],
|
["_difficulty","random",[""]],
|
||||||
["_type","random",[""]],
|
["_class","random",[""]],
|
||||||
["_side","bandit",[""]]
|
["_side","bandit",[""]]
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -42,14 +42,14 @@ _pos_z = _pos select 2;
|
|||||||
|
|
||||||
if(DMS_DEBUG) then
|
if(DMS_DEBUG) then
|
||||||
{
|
{
|
||||||
diag_log format["DMS_DEBUG SpawnAIGroup :: Spawning %1 %2 %3 AI at %4 with %5 difficulty.",_count,_type,_side,_pos,_difficulty];
|
diag_log format["DMS_DEBUG SpawnAIGroup :: Spawning %1 %2 %3 AI at %4 with %5 difficulty.",_count,_class,_side,_pos,_difficulty];
|
||||||
};
|
};
|
||||||
|
|
||||||
// if soldier have AT/AA weapons
|
// if soldier have AT/AA weapons
|
||||||
if (typeName _type == "ARRAY") then
|
if (typeName _class == "ARRAY") then
|
||||||
{
|
{
|
||||||
_launcher = _type select 1;
|
_launcher = _class select 1;
|
||||||
_type = _type select 0;
|
_class = _class select 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Randomize position
|
// Randomize position
|
||||||
@ -74,7 +74,7 @@ if(_pos_z == 0) then
|
|||||||
_group = createGroup (missionNamespace getVariable [format ["DMS_%1Side",_side],EAST]);
|
_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],_type,_difficulty,_side] call DMS_fnc_SpawnAISoldier;
|
_unit = [_group,[_pos_x,_pos_y,_pos_z],_class,_difficulty,_side,"Soldier"] call DMS_fnc_SpawnAISoldier;
|
||||||
};
|
};
|
||||||
|
|
||||||
// An AI will definitely spawn with a launcher if you define type
|
// An AI will definitely spawn with a launcher if you define type
|
||||||
|
@ -7,10 +7,11 @@
|
|||||||
[
|
[
|
||||||
_group, // Group the AI will belong to
|
_group, // Group the AI will belong to
|
||||||
_pos, // Position of AI
|
_pos, // Position of AI
|
||||||
_type, // "random","assault","MG","sniper" or "unarmed"
|
_class, // Classname: "random","assault","MG","sniper" or "unarmed"
|
||||||
_difficulty, // "random","hardcore","difficult","moderate", or "easy"
|
_difficulty, // Difficulty: "random","static","hardcore","difficult","moderate", or "easy"
|
||||||
_side, // "bandit","hero", etc.
|
_side, // "bandit","hero", etc.
|
||||||
_customGearSet // OPTIONAL: Manually defined AI gear.
|
_type, // Type of AI: "soldier","static","vehicle","heli", etc.
|
||||||
|
_customGearSet // OPTIONAL: Manually defined AI gear.
|
||||||
] call DMS_fnc_SpawnAIGroup;
|
] call DMS_fnc_SpawnAIGroup;
|
||||||
|
|
||||||
Usage for _customGearSet:
|
Usage for _customGearSet:
|
||||||
@ -21,6 +22,7 @@
|
|||||||
_pistol, // String | EG: "hgun_Pistol_heavy_01_snds_F"
|
_pistol, // String | EG: "hgun_Pistol_heavy_01_snds_F"
|
||||||
_pistolAttachments, // Array of strings | EG: ["optic_MRD","muzzle_snds_acp"]
|
_pistolAttachments, // Array of strings | EG: ["optic_MRD","muzzle_snds_acp"]
|
||||||
_items, // Array of strings | EG: ["Rangefinder","ItemGPS","Exile_Item_InstaDoc"]
|
_items, // Array of strings | EG: ["Rangefinder","ItemGPS","Exile_Item_InstaDoc"]
|
||||||
|
_launcher, // String | EG: "launch_RPG32_F"
|
||||||
_helmet, // String | EG: "H_HelmetLeaderO_ocamo"
|
_helmet, // String | EG: "H_HelmetLeaderO_ocamo"
|
||||||
_uniform, // String | EG: "U_O_GhillieSuit"
|
_uniform, // String | EG: "U_O_GhillieSuit"
|
||||||
_vest, // String | EG: "V_PlateCarrierGL_blk"
|
_vest, // String | EG: "V_PlateCarrierGL_blk"
|
||||||
@ -30,16 +32,18 @@
|
|||||||
Returns AI Unit
|
Returns AI Unit
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private ["_OK", "_useCustomGear", "_unarmed", "_type", "_customGear", "_unit", "_side", "_nighttime", "_weapon", "_muzzle", "_suppressor", "_pistols", "_pistol", "_customGearSet", "_helmet", "_uniform", "_vest", "_backpack", "_magazines", "_weaponAttachments", "_pistolAttachments", "_items", "_difficulty", "_skillArray"];
|
private ["_OK", "_useCustomGear", "_unarmed", "_class", "_customGear", "_type", "_unit", "_side", "_nighttime", "_weapon", "_muzzle", "_suppressor", "_pistols", "_pistol", "_customGearSet", "_helmet", "_uniform", "_vest", "_backpack", "_launcher", "_magazines", "_weaponAttachments", "_pistolAttachments", "_items", "_difficulty", "_skillArray"];
|
||||||
|
|
||||||
_OK = params
|
_OK = params
|
||||||
[
|
[
|
||||||
["_group",grpNull,[grpNull]],
|
["_group",grpNull,[grpNull]],
|
||||||
["_pos",[0,0,0],[[]],[3]],
|
["_pos",[0,0,0],[[]],[3]],
|
||||||
["_type","random",[""]],
|
["_class","random",[""]],
|
||||||
["_difficulty","random",[""]],
|
["_difficulty","random",[""]],
|
||||||
["_side","bandit",[""]]
|
["_side","bandit",[""]],
|
||||||
|
["_type","soldier",[""]]
|
||||||
];
|
];
|
||||||
|
|
||||||
_useCustomGear = false;
|
_useCustomGear = false;
|
||||||
_unarmed = false;
|
_unarmed = false;
|
||||||
|
|
||||||
@ -49,7 +53,7 @@ if (!_OK) then
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ((_type == "custom") && {((count _this)>5)}) then
|
if ((_class == "custom") && {((count _this)>6)}) then
|
||||||
{
|
{
|
||||||
_customGear = _this select 5;
|
_customGear = _this select 5;
|
||||||
_useCustomGear = true;
|
_useCustomGear = true;
|
||||||
@ -93,20 +97,20 @@ if !(DMS_ai_default_items isEqualTo []) then
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
switch (toLower _type) do
|
switch (toLower _class) do
|
||||||
{
|
{
|
||||||
case "random" : {_type = DMS_random_AI call BIS_fnc_selectRandom;};
|
case "random" : {_class = DMS_random_AI call BIS_fnc_selectRandom;};
|
||||||
case "unarmed" : {_type = "assault";_unarmed = true;};
|
case "unarmed" : {_class = "assault";_unarmed = true;};
|
||||||
};
|
};
|
||||||
|
|
||||||
// Unit name
|
// Unit name
|
||||||
_unit setName format["[DMS_Unit_%1%2]",_type,floor(random 1000)];
|
_unit setName format["[DMS_Unit_%1%2]",_class,floor(random 1000)];
|
||||||
|
|
||||||
if (!_useCustomGear) then
|
if (!_useCustomGear) then
|
||||||
{
|
{
|
||||||
if !(_type in DMS_ai_SupportedClasses) exitWith
|
if !(_class in DMS_ai_SupportedClasses) exitWith
|
||||||
{
|
{
|
||||||
diag_log format ["DMS ERROR :: DMS_SpawnAISoldier called with unsupported _type: %1 | _this: %2",_type,_this];
|
diag_log format ["DMS ERROR :: DMS_SpawnAISoldier called with unsupported _class: %1 | _this: %2",_class,_this];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -120,18 +124,18 @@ if (!_useCustomGear) then
|
|||||||
{
|
{
|
||||||
_unit linkItem _x;
|
_unit linkItem _x;
|
||||||
};
|
};
|
||||||
} forEach (missionNamespace getVariable [format ["DMS_%1_equipment",_type],[]]);
|
} forEach (missionNamespace getVariable [format ["DMS_%1_equipment",_class],[]]);
|
||||||
|
|
||||||
|
|
||||||
// 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",_type],[]]);
|
{_unit addItem _x;} forEach (missionNamespace getVariable [format ["DMS_%1_items",_class],[]]);
|
||||||
|
|
||||||
|
|
||||||
// Clothes
|
// Clothes
|
||||||
_unit addHeadgear ((missionNamespace getVariable [format ["DMS_%1_helmets",_type],[]]) call BIS_fnc_selectRandom);
|
_unit addHeadgear ((missionNamespace getVariable [format ["DMS_%1_helmets",_class],[]]) call BIS_fnc_selectRandom);
|
||||||
_unit forceAddUniform ((missionNamespace getVariable [format ["DMS_%1_clothes",_type],[]]) call BIS_fnc_selectRandom);
|
_unit forceAddUniform ((missionNamespace getVariable [format ["DMS_%1_clothes",_class],[]]) call BIS_fnc_selectRandom);
|
||||||
_unit addVest ((missionNamespace getVariable [format ["DMS_%1_vests",_type],[]]) call BIS_fnc_selectRandom);
|
_unit addVest ((missionNamespace getVariable [format ["DMS_%1_vests",_class],[]]) call BIS_fnc_selectRandom);
|
||||||
_unit addBackpack ((missionNamespace getVariable [format ["DMS_%1_backpacks",_type],[]]) call BIS_fnc_selectRandom);
|
_unit addBackpack ((missionNamespace getVariable [format ["DMS_%1_backpacks",_class],[]]) call BIS_fnc_selectRandom);
|
||||||
|
|
||||||
// Make AI effective at night
|
// Make AI effective at night
|
||||||
_nighttime = (sunOrMoon != 1);
|
_nighttime = (sunOrMoon != 1);
|
||||||
@ -142,14 +146,14 @@ if (!_useCustomGear) then
|
|||||||
|
|
||||||
if (!_unarmed) then
|
if (!_unarmed) then
|
||||||
{
|
{
|
||||||
_weapon = (missionNamespace getVariable [format ["DMS_%1_weps",_type],[]]) call BIS_fnc_selectRandom;
|
_weapon = (missionNamespace getVariable [format ["DMS_%1_weps",_class],[]]) call BIS_fnc_selectRandom;
|
||||||
[_unit, _weapon, 6 + floor(random 3)] call BIS_fnc_addWeapon;
|
[_unit, _weapon, 6 + floor(random 3)] call BIS_fnc_addWeapon;
|
||||||
_unit selectWeapon _weapon;
|
_unit selectWeapon _weapon;
|
||||||
|
|
||||||
|
|
||||||
if((random 100) <= (missionNamespace getVariable [format["DMS_%1_optic_chance",_type],0])) then
|
if((random 100) <= (missionNamespace getVariable [format["DMS_%1_optic_chance",_class],0])) then
|
||||||
{
|
{
|
||||||
_unit addPrimaryWeaponItem ((missionNamespace getVariable [format ["DMS_%1_optics",_type],[]]) call BIS_fnc_selectRandom);
|
_unit addPrimaryWeaponItem ((missionNamespace getVariable [format ["DMS_%1_optics",_class],[]]) call BIS_fnc_selectRandom);
|
||||||
};
|
};
|
||||||
|
|
||||||
if (_nighttime && {(random 100) <= DMS_ai_nighttime_accessory_chance}) then
|
if (_nighttime && {(random 100) <= DMS_ai_nighttime_accessory_chance}) then
|
||||||
@ -157,12 +161,12 @@ if (!_useCustomGear) then
|
|||||||
_unit addPrimaryWeaponItem (["acc_pointer_IR","acc_flashlight"] call BIS_fnc_selectRandom);
|
_unit addPrimaryWeaponItem (["acc_pointer_IR","acc_flashlight"] call BIS_fnc_selectRandom);
|
||||||
};
|
};
|
||||||
|
|
||||||
if((random 100) <= (missionNamespace getVariable [format["DMS_%1_bipod_chance",_type],0])) then
|
if((random 100) <= (missionNamespace getVariable [format["DMS_%1_bipod_chance",_class],0])) then
|
||||||
{
|
{
|
||||||
_unit addPrimaryWeaponItem (DMS_ai_BipodList call BIS_fnc_selectRandom);
|
_unit addPrimaryWeaponItem (DMS_ai_BipodList call BIS_fnc_selectRandom);
|
||||||
};
|
};
|
||||||
|
|
||||||
if((random 100) <= (missionNamespace getVariable [format["DMS_%1_suppressor_chance",_type],0])) then
|
if((random 100) <= (missionNamespace getVariable [format["DMS_%1_suppressor_chance",_class],0])) then
|
||||||
{
|
{
|
||||||
_suppressor = _weapon call DMS_fnc_FindSuppressor;
|
_suppressor = _weapon call DMS_fnc_FindSuppressor;
|
||||||
if(_suppressor != "") then
|
if(_suppressor != "") then
|
||||||
@ -182,7 +186,7 @@ if (!_useCustomGear) then
|
|||||||
[_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 BIS_fnc_addWeapon;
|
||||||
};
|
};
|
||||||
|
|
||||||
_pistols = missionNamespace getVariable [format ["DMS_%1_pistols",_type],[]];
|
_pistols = missionNamespace getVariable [format ["DMS_%1_pistols",_class],[]];
|
||||||
if !(_pistols isEqualTo []) then
|
if !(_pistols isEqualTo []) then
|
||||||
{
|
{
|
||||||
_pistol = _pistols call BIS_fnc_selectRandom;
|
_pistol = _pistols call BIS_fnc_selectRandom;
|
||||||
@ -204,6 +208,7 @@ else
|
|||||||
["_pistol","",[""]],
|
["_pistol","",[""]],
|
||||||
["_pistolAttachments",[],[[]]],
|
["_pistolAttachments",[],[[]]],
|
||||||
["_items",[],[[]]],
|
["_items",[],[[]]],
|
||||||
|
["_launcher","",[""]],
|
||||||
["_helmet","",[""]],
|
["_helmet","",[""]],
|
||||||
["_uniform","",[""]],
|
["_uniform","",[""]],
|
||||||
["_vest","",[""]],
|
["_vest","",[""]],
|
||||||
@ -241,6 +246,11 @@ else
|
|||||||
_unit addBackpack _backpack;
|
_unit addBackpack _backpack;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if !(_launcher isEqualTo "") then
|
||||||
|
{
|
||||||
|
[_unit, _launcher, 0] call BIS_fnc_addWeapon;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// Add Magazines before weapon so that gun will be loaded
|
// Add Magazines before weapon so that gun will be loaded
|
||||||
{
|
{
|
||||||
@ -255,7 +265,7 @@ else
|
|||||||
// Add gun and attachments
|
// Add gun and attachments
|
||||||
if !(_weapon isEqualTo "") then
|
if !(_weapon isEqualTo "") then
|
||||||
{
|
{
|
||||||
_muzzle = [_unit, _weapon, 0] call BIS_fnc_addWeapon;
|
[_unit, _weapon, 0] call BIS_fnc_addWeapon;
|
||||||
|
|
||||||
{
|
{
|
||||||
_unit addPrimaryWeaponItem _x;
|
_unit addPrimaryWeaponItem _x;
|
||||||
@ -268,7 +278,7 @@ else
|
|||||||
// Add pistol and attachments
|
// Add pistol and attachments
|
||||||
if !(_pistol isEqualTo "") then
|
if !(_pistol isEqualTo "") then
|
||||||
{
|
{
|
||||||
_muzzle = [_unit, _pistol, 0] call BIS_fnc_addWeapon;
|
[_unit, _pistol, 0] call BIS_fnc_addWeapon;
|
||||||
|
|
||||||
{
|
{
|
||||||
_unit addPrimaryWeaponItem _x;
|
_unit addPrimaryWeaponItem _x;
|
||||||
@ -287,7 +297,21 @@ else
|
|||||||
|
|
||||||
|
|
||||||
// Soldier killed event handler
|
// Soldier killed event handler
|
||||||
_unit addMPEventHandler ["MPKilled",'if (isServer) then {[_this, '+str _side+', "soldier"] call DMS_fnc_OnKilled;};'];
|
_unit addMPEventHandler ["MPKilled",'if (isServer) then {[_this, '+str _side+', '+str _type+'] call DMS_fnc_OnKilled;};'];
|
||||||
|
|
||||||
|
// Remove ramming damage from players. Will not work if unit is not local (offloaded)
|
||||||
|
if (DMS_ai_disable_ramming_damage) then
|
||||||
|
{
|
||||||
|
_unit addEventHandler ["HandleDamage",
|
||||||
|
{
|
||||||
|
_dmg = _this select 2;
|
||||||
|
if (isPlayer (_this select 3) && {(_this select 4)==""}) then
|
||||||
|
{
|
||||||
|
_dmg = 0;
|
||||||
|
};
|
||||||
|
_dmg
|
||||||
|
}];
|
||||||
|
};
|
||||||
|
|
||||||
_unit enableAI "TARGET";
|
_unit enableAI "TARGET";
|
||||||
_unit enableAI "AUTOTARGET";
|
_unit enableAI "AUTOTARGET";
|
||||||
@ -297,7 +321,7 @@ _unit enableAI "FSM";
|
|||||||
|
|
||||||
if (DMS_DEBUG) then
|
if (DMS_DEBUG) then
|
||||||
{
|
{
|
||||||
diag_log format ["DMS_DEBUG SpawnAISoldier :: Spawned a %1 %2 AI at %3 with %4 difficulty to group %5",_type,_side,_pos,_difficulty,_group];
|
diag_log format ["DMS_DEBUG SpawnAISoldier :: Spawned a %1 %2 %6 AI at %3 with %4 difficulty to group %5",_class,_side,_pos,_difficulty,_group,_type];
|
||||||
};
|
};
|
||||||
|
|
||||||
_unit
|
_unit
|
||||||
|
69
@ExileServer/addons/a3_dms/scripts/fn_SpawnAIStatic.sqf
Normal file
69
@ExileServer/addons/a3_dms/scripts/fn_SpawnAIStatic.sqf
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
/*
|
||||||
|
DMS_fnc_SpawnAIStatic
|
||||||
|
Created by eraser1
|
||||||
|
Influenced by WAI
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
[
|
||||||
|
[ // Array of static gun positions
|
||||||
|
_pos1,
|
||||||
|
_pos2,
|
||||||
|
...
|
||||||
|
_pos3
|
||||||
|
],
|
||||||
|
_group, // Group to which the AI unit(s) belongs to
|
||||||
|
_class, // Class: "random","assault","MG","sniper" or "unarmed"
|
||||||
|
_difficulty, // Difficulty: "random","static","hardcore","difficult","moderate", or "easy"
|
||||||
|
_side // "bandit","hero", etc.
|
||||||
|
] call DMS_fnc_SpawnAIStatic;
|
||||||
|
|
||||||
|
Returns an array of static gun objects.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
_OK = params
|
||||||
|
[
|
||||||
|
["_positions",[],[[]]],
|
||||||
|
["_group",grpNull,[grpNull]],
|
||||||
|
["_class","random",[""]],
|
||||||
|
["_difficulty","static",[""]],
|
||||||
|
["_side","bandit",[""]]
|
||||||
|
];
|
||||||
|
|
||||||
|
if (!_OK) exitWith
|
||||||
|
{
|
||||||
|
diag_log format ["DMS ERROR :: Calling DMS_fnc_SpawnAIStatic with invalid parameters: %1",_this];
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
_guns = [];
|
||||||
|
|
||||||
|
{
|
||||||
|
_pos = _x;
|
||||||
|
|
||||||
|
_gun = createVehicle [(DMS_static_weapons call BIS_fnc_selectRandom), _pos, [], 0, "CAN_COLLIDE"];
|
||||||
|
_gun setDir (random 360);
|
||||||
|
_gun setPosATL _pos;
|
||||||
|
_gun addEventHandler ["GetOut",{(_this select 0) setDamage 1;}];
|
||||||
|
_gun lock 2;
|
||||||
|
|
||||||
|
_guns pushBack _gun;
|
||||||
|
|
||||||
|
_unit = [_group,_pos,_class,_difficulty,_side,"Static"] call DMS_fnc_SpawnAISoldier;
|
||||||
|
|
||||||
|
_unit moveingunner _gun;
|
||||||
|
reload _unit;
|
||||||
|
|
||||||
|
if (DMS_DEBUG) then
|
||||||
|
{
|
||||||
|
diag_log format ["DMS_DEBUG SpawnAIStatic :: Created unit %1 at %2 as static gunner in %3",_unit,_pos,_gun];
|
||||||
|
};
|
||||||
|
} forEach _positions;
|
||||||
|
|
||||||
|
|
||||||
|
if (DMS_DEBUG) then
|
||||||
|
{
|
||||||
|
diag_log format ["DMS_DEBUG SpawnAIStatic :: Created %1 static AI with parameters: %2",count _positions,_this];
|
||||||
|
};
|
||||||
|
|
||||||
|
_guns
|
Loading…
Reference in New Issue
Block a user