Skip to content

Commit

Permalink
IFA Statics buildings update
Browse files Browse the repository at this point in the history
  • Loading branch information
ante185 committed Jan 2, 2024
1 parent b92cff7 commit 0f014e6
Show file tree
Hide file tree
Showing 5 changed files with 228 additions and 72 deletions.
2 changes: 1 addition & 1 deletion A3A/addons/core/Templates/Templates/IFA/IFA_AI_WEH.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ for "_i" from 1 to _tankRatio do { _tanks append _mediumTanks; };
["vehiclesPolice", ["LIB_Kfz1_Hood_sernyt","LIB_Kfz1_sernyt", "LIB_Kfz1_MG42_sernyt"]] call _fnc_saveToTemplate;

["staticMGs", ["LIB_MG42_Lafette_low_Deployed","LIB_MG34_Lafette_low_Deployed"]] call _fnc_saveToTemplate;
["staticAT", ["LIB_Pak40_g","LIB_Pak40_g","LIB_FlaK_36","LIB_leFH18_AT"]] call _fnc_saveToTemplate;
["staticAT", ["LIB_Pak40_g","LIB_Pak40_g","LIB_leFH18_AT"]] call _fnc_saveToTemplate;
["staticAA", ["LIB_FlaK_36_AA","LIB_FlaK_30","LIB_FlaK_30","LIB_FlaK_38","LIB_FlaK_38","LIB_Flakvierling_38","LIB_Flakvierling_38"]] call _fnc_saveToTemplate;
["staticMortars", ["LIB_GrWr34","LIB_GrWr34_g"]] call _fnc_saveToTemplate;

Expand Down
11 changes: 6 additions & 5 deletions A3A/addons/core/functions/CREATE/fn_createAIcontrols.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,20 @@ if (_isControl) then
_groupE = grpNull;
if !(A3A_hasIFA) then
{
private _IFAMaps = ["Hyde_Sark"];
private _IFAMaps = ["Hyde_Sark", "iron_excelsior_Tobruk"];
private _ifLowMGs = false;
private _bunkerClass = "Land_BagBunker_01_Small_green_F";
private _offset = [0,0, 0];
private _offset = [0, 0, 0];
_typeVehX = selectRandom (_faction get "staticMGs");
if (worldname == "SPE_Normandy" || worldname in _IFAMaps) then {
_ifLowMGs = true;
if (worldname == "SPE_Normandy") then {
_bunkerClass = "Land_SPE_Sandbag_Nest";
_offset = [-0.200684,-0.91333,-0.421184]
} else {
_bunkerClass = "Fort_EnvelopeSmall";
_offset = [0,1.5,0]
_offset = [0,1.5,-0.15];
_offset = _offset vectorAdd ([[0,0,0], [0,0.2,0.17]] select (_typeVehX == "LIB_M1919_M2"));
};
} else {
if (A3A_climate == "arid") then
Expand All @@ -103,7 +105,6 @@ if (_isControl) then
_pos = getPosATL _bunker;
};
_vehiclesX pushBack _bunker;
_typeVehX = selectRandom (_faction get "staticMGs");
_veh = _typeVehX createVehicle _positionX;
_vehiclesX pushBack _veh;
_veh setPosATL _pos;
Expand All @@ -121,7 +122,7 @@ if (_isControl) then
_bunker setDir _dirveh + 180;
_pos = _bunker modelToWorld _offset;
_vehiclesX pushBack _bunker;
_typeVehX = selectRandom (_faction get "staticMGs");
//_typeVehX = selectRandom (_faction get "staticMGs");
_veh = _typeVehX createVehicle _positionX;
_vehiclesX pushBack _veh;
_veh setPosATL _pos;
Expand Down
97 changes: 97 additions & 0 deletions A3A/addons/core/functions/CREATE/fn_milBuildings.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,34 @@ for "_i" from 0 to (count _buildings) - 1 do
private _pos = _building modelToWorld [0.0065918,-0.489746,-0.417223];
[_type, _pos, _dir] call _fnc_spawnStatic;
};
if ((_typeB == "Fort_EnvelopeSmall") or (_typeB == "Fort_EnvelopeSmall_EP1")) exitWith
{
private _type = selectRandom (_faction get "staticMGs");
private _dir = (getDir _building);
private _pos = _building modelToWorld ([[0,1.5,-0.15], [0,1.7,0.02]] select (_type == "LIB_M1919_M2"));
[_type, _pos, _dir] call _fnc_spawnStatic;
};
if ((_typeB == "Land_WW2_BET_MG_Nest_Splinter_A") or (_typeB == "Land_WW2_BET_MG_Nest_Splinter_B")) exitWith
{
private _type = selectRandom (_faction get "staticMGs");
private _dir = (getDir _building);
private _pos = _building modelToWorld ([[0.0,2.6,0.4], [0.0,2.6,0.6]] select (_type == "LIB_M1919_M2"));
[_type, _pos, _dir] call _fnc_spawnStatic;
};
if ((_typeB == "Land_WW2_BET_MG_Nest")) exitWith
{
private _type = selectRandom (_faction get "staticMGs");
private _offset = [0,0,0];
switch (_type) do {
case "LIB_M1919_M2": {_offset = [0.30,3.5,0.55]};
case "LIB_Maxim_M30_base": {_offset = [0.30,3.5,0.4]};
case "LIB_MG34_Lafette_low_Deployed";
case "LIB_MG42_Lafette_low_Deployed": {_offset = [0.30,3.5,0.0]};
};
private _dir = (getDir _building);
private _pos = _building modelToWorld _offset;
[_type, _pos, _dir] call _fnc_spawnStatic;
};

//Static AAs
if ((_typeB == "Land_Radar_01_HQ_F") or (_typeB == "Land_vn_radar_01_hq_f")) exitWith
Expand Down Expand Up @@ -215,6 +243,75 @@ for "_i" from 0 to (count _buildings) - 1 do
private _pos = _zpos getPos [1.5, _dir];
_pos = ASLToATL ([_pos select 0, _pos select 1, _zpos select 2]);
[_type, _pos, _dir] call _fnc_spawnStatic;
};
if ((_typeB == "Land_WW2_TrenchTank")) exitWith
{
private _type = selectRandom (_faction get "staticAA");
private _dir = (getDir _building);
private _pos = _building modelToWorld [0,-1.2,-0.55];
[_type, _pos, _dir] call _fnc_spawnStatic;
};
if ((_typeB == "Land_WW2_BET_Flak_Bettung")) exitWith
{
private _type = selectRandom (_faction get "staticAA");
private _dir = (getDir _building);
private _pos = _building modelToWorld [-1.0,0.6,-0.2];
[_type, _pos, _dir] call _fnc_spawnStatic;
};
if ((_typeB == "Land_I44_Buildings_Bunker_AA")) exitWith
{
private _type = selectRandom (_faction get "staticAA");
private _dir = (getDir _building);
private _pos = _building modelToWorld [2.0,-2.1,0.3];
[_type, _pos, _dir] call _fnc_spawnStatic;
};

//IFA Mortar = Land_WW2_Trench_Mortar
//IFA AA = Land_WW2_TrenchTank Land_WW2_BET_Flak_Bettung Land_I44_Buildings_Bunker_AA
//IFA AT = Land_WW2_BET_RGB669_Pak_L Land_WW2_BET_RGB669_Pak_R
//IFA AA/AT = Land_WW2_Trench76 Land_Fort_Bagfence_Bunker Land_WW2_LAWZ_Tobruk_Trench_gunposition

//Static ATs
if ((_typeB == "Land_WW2_BET_RGB669_Pak_L") or (_typeB == "Land_WW2_BET_RGB669_Pak_L_Splinter") or (_typeB == "Land_WW2_BET_RGB669_Pak_R") or (_typeB == "Land_WW2_BET_RGB669_Pak_R_Splinter")) exitWith
{
private _type = selectRandom (_faction get "staticAT");
private _dir = (getDir _building);
private _pos = _building modelToWorld [0.0,1.6,-0.55];
[_type, _pos, _dir] call _fnc_spawnStatic;
};

//Static AT or AA
if ((_typeB == "Land_Fort_Bagfence_Bunker")) exitWith
{
private _type = selectRandom (_faction get "staticAT");
private _dir = (getDir _building);
private _pos = _building modelToWorld [0,0,-0.8];
[_type, _pos, _dir] call _fnc_spawnStatic;
};
if ((_typeB == "Land_WW2_LAWZ_Tobruk_Trench_gunposition")) exitWith
{
private _type = selectRandom (_faction get "staticAT");
private _dir = (getDir _building) + 180;
private _pos = _building modelToWorld [0,0,0.1];
[_type, _pos, _dir] call _fnc_spawnStatic;
};
if ((_typeB == "Land_WW2_Trench76")) exitWith
{
private _type = selectRandom (_faction get "staticAT");
private _dir = (getDir _building);
private _pos = _building modelToWorld [-1.2,-0.6,0.0];
[_type, _pos, _dir] call _fnc_spawnStatic;
};

//Static Decorative
if ((_typeB == "Land_Setka_Car")) exitWith
{
private _type = selectRandom ((_faction get "vehiclesMilitiaCars") + (_faction get "vehiclesLightUnarmed"));
private _dir = (getDir _building) + 90;
private _zpos = AGLToASL (getPos _building);
private _pos = _zpos getPos [1.5, _dir];
_pos = ASLToATL ([_pos select 0, _pos select 1, _zpos select 2]);
[_type, _pos, _dir] call _fnc_spawnStatic;
};
};
};
Expand Down
7 changes: 6 additions & 1 deletion A3A/addons/core/functions/init/fn_initVarCommon.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,17 @@ Info("Creating building arrays");

A3A_buildingWhitelist = [
"Land_Cargo_Tower_V1_F","Land_Cargo_Tower_V1_No1_F","Land_Cargo_Tower_V1_No2_F","Land_Cargo_Tower_V1_No3_F","Land_Cargo_Tower_V1_No4_F","Land_Cargo_Tower_V1_No5_F","Land_Cargo_Tower_V1_No6_F","Land_Cargo_Tower_V1_No7_F","Land_Cargo_Tower_V2_F", "Land_Cargo_Tower_V3_F", "Land_Cargo_Tower_V4_F"

];
A3A_milBuildingWhitelist = A3A_buildingWhitelist + [
"Land_Radar_01_HQ_F","Land_Cargo_HQ_V1_F","Land_Cargo_HQ_V2_F","Land_Cargo_HQ_V3_F","Land_Cargo_HQ_V4_F","Land_Cargo_Patrol_V1_F","Land_Cargo_Patrol_V2_F","Land_Cargo_Patrol_V3_F", "Land_Cargo_Patrol_V4_F","Land_HelipadSquare_F","Land_Posed","Land_Hlaska","Land_fortified_nest_small_EP1",
"Land_fortified_nest_small","Fort_Nest","Fortress1","Land_GuardShed","Land_BagBunker_Small_F","Land_BagBunker_01_small_green_F","Land_vn_b_tower_01","Land_vn_o_shelter_05","Land_vn_bagbunker_01_small_green_f","Land_vn_bagbunker_small_f", "Land_vn_o_tower_01","Land_vn_o_tower_02", "Land_vn_o_tower_03","Land_vn_hut_tower_01",
"Land_vn_o_platform_05","Land_vn_o_platform_06","Land_vn_o_snipertree_01","Land_vn_o_snipertree_02","Land_vn_o_snipertree_03","Land_vn_o_snipertree_04","Land_vn_o_platform_01","Land_vn_o_platform_02","Land_vn_o_platform_03", "Land_vn_hlaska", "Land_vn_b_trench_bunker_04_01", "Land_vn_pillboxbunker_02_hex_f", "Land_vn_guardtower_01_f",
"Land_vn_strazni_vez", "Land_vn_b_trench_firing_05", "Land_vn_cementworks_01_grey_f", "Land_vn_cementworks_01_brick_f", "Land_vn_radar_01_hq_f", "Land_vn_a_office01", "Land_SPE_Sandbag_Nest"
"Land_vn_strazni_vez", "Land_vn_b_trench_firing_05", "Land_vn_cementworks_01_grey_f", "Land_vn_cementworks_01_brick_f", "Land_vn_radar_01_hq_f", "Land_vn_a_office01", "Land_SPE_Sandbag_Nest",
"Land_WW2_Trench_MG_Low","Fort_EnvelopeSmall","Fort_EnvelopeSmall_EP1","Land_WW2_BET_MG_Nest","Land_WW2_BET_MG_Nest_Splinter_A","Land_WW2_BET_MG_Nest_Splinter_B",
"Land_WW2_TrenchTank","Land_WW2_BET_Flak_Bettung","Land_I44_Buildings_Bunker_AA",
"Land_WW2_BET_RGB669_Pak_L","Land_WW2_BET_RGB669_Pak_R","Land_WW2_BET_RGB669_Pak_L_Splinter","Land_WW2_BET_RGB669_Pak_R_Splinter",
"Land_Fort_Bagfence_Bunker","Land_WW2_LAWZ_Tobruk_Trench_gunposition","Land_WW2_Trench76","Land_Setka_Car"
];
A3A_buildingBlacklist = [
"Bridge_PathLod_base_F","Land_Slum_House03_F","Land_Bridge_01_PathLod_F","Land_Bridge_Asphalt_PathLod_F","Land_Bridge_Concrete_PathLod_F","Land_Bridge_HighWay_PathLod_F","Land_Bridge_01_F","Land_Bridge_Asphalt_F","Land_Bridge_Concrete_F","Land_Bridge_HighWay_F","Land_Canal_Wall_Stairs_F","warehouse_02_f",
Expand Down
Loading

0 comments on commit 0f014e6

Please sign in to comment.