Skip to content

Commit

Permalink
Merge pull request #813 from AndreasBrostrom/vehicle_pylon
Browse files Browse the repository at this point in the history
Updated the pylon system for the tank
  • Loading branch information
AndreasBrostrom authored Dec 25, 2021
2 parents 8cd3550 + 14b6e3f commit 6fbae37
Show file tree
Hide file tree
Showing 7 changed files with 146 additions and 64 deletions.
3 changes: 0 additions & 3 deletions cScripts/CfgFunctions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,6 @@ class cScripts {
class vehicle_addRadio {};
class vehicle_setRadio {};

class vehicle_addMagazines {};
class vehicle_clearAllMagazines {};

// Staging
class vehicle_addStagingActions {};

Expand Down
1 change: 0 additions & 1 deletion cScripts/functions/vehicle/fn_vehicle_addFlagAction.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ private _putFlag = [QEGVAR(Actions_Vehicle,PutFlag), "Put up flag", _icon, {
private _flagTexture = "z\cav\addons\flag\data\flag_01_ca.paa"; //"\A3\Data_F\Flags\Flag_red_CO.paa"
_vehicle forceFlagTexture _flagTexture;
_vehicle setVariable [QEGVAR(Vehicle,hasFlag), true];

}, _addCondition] call ace_interact_menu_fnc_createAction;
[_vehicle, 1, ["ACE_SelfActions"], _putFlag] call ace_interact_menu_fnc_addActionToObject;

Expand Down
26 changes: 0 additions & 26 deletions cScripts/functions/vehicle/fn_vehicle_addMagazines.sqf

This file was deleted.

32 changes: 26 additions & 6 deletions cScripts/functions/vehicle/fn_vehicle_addPylonSelection.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ params [
["_vehicle", objNull, [objNull]],
["_displayName", "", [""]],
["_classname", "", [""]],
["_loadoutClassname", "", [""]],
["_pylon", [[0, []]], [[]]],
["_loadoutName", "", [""]],
["_pylon", [[]], ["",[],0]],
["_icon", "", [""]],
["_category", ["ACE_SelfActions", QEGVAR(Actions_Vehicle,Main_Cat), QEGVAR(Actions_Vehicle,Pylon_Cat)], [[]]]
];
Expand All @@ -34,14 +34,34 @@ private _condition = {
private _statement = {
params ["_vehicle", "_player", "_params"];
_params params ["", "_pylon"];

// Rearm vehicle first
_vehicle setVehicleAmmo 1;

if (count _pylon == 0) exitWith {};

// Clear magazine
{
_x params ["_turretPath", "_magazines"];
[_vehicle, _turretPath] call EFUNC(vehicle,clearAllMagazines);
[_vehicle, _turretPath, _magazines] call EFUNC(vehicle,addMagazines);
_x params ["_magazineClassname", "_turretPath"];
_vehicle removeMagazinesTurret [_magazineClassname, _turretPath];
} forEach magazinesAllTurrets _vehicle;

// Add magazine
{
_x params [["_magazineClassname", "",[""]], ["_turretPath", [], [[]]], ["_amount", -1, [0]]];

if (_amount != 0) then {
[format["Adding magazine %1 (%2)", _magazineClassname, _amount]] call FUNC(log);
_vehicle addMagazineTurret [
_magazineClassname,
_turretPath,
if (_amount < 0) then {getNumber (configFile >> "CfgMagazines" >> _magazineClassname >> "count")} else {_amount}
];
};
} forEach _pylon;
};

private _action = [format ["cScripts_Pylon_%1_%2", _classname, _loadoutClassname], _displayName, _icon, _statement, _condition, nil, [_className, _pylon]] call ace_interact_menu_fnc_createAction;
private _action = [format ["cScripts_Pylon_%1_%2", _classname, _loadoutName], _displayName, _icon, _statement, _condition, nil, [_className, _pylon]] call ace_interact_menu_fnc_createAction;
[_vehicle, 1, _category, _action] call ace_interact_menu_fnc_addActionToObject;

#ifdef DEBUG_MODE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ private _stagingCat = [QEGVAR(Actions_Vehicle,Cosmetic_Cat), "Vehicle Cosmetics"
[_vehicle] call EFUNC(vehicle,addRegearAction);
[_vehicle] call EFUNC(vehicle,addRepairAction);
[_vehicle] call EFUNC(vehicle,addCosmeticSelection);
//_vehicle call EFUNC(vehicle,setupPylonSelection);
[_vehicle] call EFUNC(vehicle,setupPylonCategories);
26 changes: 0 additions & 26 deletions cScripts/functions/vehicle/fn_vehicle_clearAllMagazines.sqf

This file was deleted.

120 changes: 119 additions & 1 deletion cScripts/functions/vehicle/fn_vehicle_setupPylonCategories.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,122 @@ private _mainCategory = ["ACE_SelfActions", QEGVAR(Actions_Vehicle,Main_Cat)];
private _vehiclePylon = [QEGVAR(Actions_Vehicle,Pylon_Cat), "Vehicle Loadouts", _icon, {true}, { call FUNC(checkStagingZone) }] call ace_interact_menu_fnc_createAction;
[_vehicle, 1, _mainCategory, _vehiclePylon] call ace_interact_menu_fnc_addActionToObject;

_mainCategory
if (_vehicle iskindOf "rhsusf_m1a1tank_base") then {
[_vehicle, "Hard", "rhsusf_m1a1tank_base", "hard", [
["rhs_mag_smokegen",[-1],999],
["rhs_mag_M829A3_max",[0],44],
["rhs_mag_M830A1_max",[0],8],
["rhs_mag_762x51_M240_1200",[0],0],
["rhs_mag_762x51_M240_1200",[0],0],
["rhs_mag_762x51_M240_1200",[0],0],
["rhs_mag_762x51_M240_1200",[0],0],
["rhs_mag_762x51_M240_1200",[0],1200],
["rhs_mag_762x51_M240_1200",[0],1200],
["rhs_mag_762x51_M240_1200",[0],1200],
["rhs_mag_762x51_M240_1200",[0],1200],
["rhs_mag_762x51_M240_1200",[0],1200],
["rhs_LaserFCSMag",[0],99],
["rhs_LaserFCSMag",[0],99],
["rhs_mag_100rnd_127x99_mag_Tracer_Red",[0,0]],
["rhs_mag_100rnd_127x99_mag_Tracer_Red",[0,0]],
["rhs_mag_100rnd_127x99_mag_Tracer_Red",[0,0]],
["rhs_mag_100rnd_127x99_mag_Tracer_Red",[0,0]],
["rhs_mag_100rnd_127x99_mag_Tracer_Red",[0,0]],
["rhs_mag_100rnd_127x99_mag_Tracer_Red",[0,0]],
["rhs_mag_100rnd_127x99_mag_Tracer_Red",[0,0]],
["rhs_mag_100rnd_127x99_mag_Tracer_Red",[0,0]],
["rhs_mag_100rnd_127x99_mag_Tracer_Red",[0,0]],
["rhs_mag_100rnd_127x99_mag_Tracer_Red",[0,0]],
["rhsusf_mag_L8A3_12",[0,0],12],
["rhs_mag_762x51_M240_200",[0,2]],
["rhs_mag_762x51_M240_200",[0,2]],
["rhs_mag_762x51_M240_200",[0,2]]
], ""] call cScripts_fnc_vehicle_addPylonSelection;
[_vehicle, "Default", "rhsusf_m1a1tank_base", "default", [
["rhs_mag_smokegen",[-1],999],
["rhs_mag_M829A3",[0],28],
["rhs_mag_M830A1",[0],8],
["rhs_mag_762x51_M240_1200",[0],1200],
["rhs_mag_762x51_M240_1200",[0],1200],
["rhs_mag_762x51_M240_1200",[0],1200],
["rhs_mag_762x51_M240_1200",[0],1200],
["rhs_mag_762x51_M240_1200",[0],1200],
["rhs_mag_762x51_M240_1200",[0],1200],
["rhs_mag_762x51_M240_1200",[0],1200],
["rhs_mag_762x51_M240_1200",[0],1200],
["rhs_mag_762x51_M240_1200",[0],1200],
["rhs_LaserFCSMag",[0],99],
["rhs_LaserFCSMag",[0],99],
["rhs_mag_400rnd_127x99_mag_Tracer_Red",[0,0],400],
["rhs_mag_400rnd_127x99_mag_Tracer_Red",[0,0],400],
["rhs_mag_400rnd_127x99_mag_Tracer_Red",[0,0],400],
["rhs_mag_400rnd_127x99_mag_Tracer_Red",[0,0],400],
["rhsusf_mag_L8A3_12",[0,0],12],
["rhsusf_mag_duke",[0,0],1],
["rhs_mag_762x51_M240_200",[0,2],200],
["rhs_mag_762x51_M240_200",[0,2],200],
["rhs_mag_762x51_M240_200",[0,2],200]
], ""] call cScripts_fnc_vehicle_addPylonSelection;
[_vehicle, "Mixed", "rhsusf_m1a1tank_base", "mixed", [
["rhs_mag_smokegen",[-1],999],
["rhs_mag_M829A3_max",[0],28],
["rhs_mag_M830A1_max",[0],16],
["rhs_mag_762x51_M240_1200",[0],1200],
["rhs_mag_762x51_M240_1200",[0],1200],
["rhs_mag_762x51_M240_1200",[0],1200],
["rhs_mag_762x51_M240_1200",[0],1200],
["rhs_mag_762x51_M240_1200",[0],1200],
["rhs_mag_762x51_M240_1200",[0],1200],
["rhs_mag_762x51_M240_1200",[0],1200],
["rhs_mag_762x51_M240_1200",[0],1200],
["rhs_LaserFCSMag",[0],99],
["rhs_LaserFCSMag",[0],99],
["rhs_mag_100rnd_127x99_mag_Tracer_Red",[0,0]],
["rhs_mag_100rnd_127x99_mag_Tracer_Red",[0,0]],
["rhs_mag_100rnd_127x99_mag_Tracer_Red",[0,0]],
["rhs_mag_100rnd_127x99_mag_Tracer_Red",[0,0]],
["rhs_mag_100rnd_127x99_mag_Tracer_Red",[0,0]],
["rhs_mag_100rnd_127x99_mag_Tracer_Red",[0,0]],
["rhs_mag_100rnd_127x99_mag_Tracer_Red",[0,0]],
["rhs_mag_100rnd_127x99_mag_Tracer_Red",[0,0]],
["rhs_mag_100rnd_127x99_mag_Tracer_Red",[0,0]],
["rhs_mag_100rnd_127x99_mag_Tracer_Red",[0,0]],
["rhsusf_mag_L8A3_12",[0,0],12],
["rhs_mag_762x51_M240_200",[0,2]],
["rhs_mag_762x51_M240_200",[0,2]],
["rhs_mag_762x51_M240_200",[0,2]]
], ""] call cScripts_fnc_vehicle_addPylonSelection;
[_vehicle, "Soft", "rhsusf_m1a1tank_base", "soft", [
["rhs_mag_smokegen",[-1],999],
["rhs_mag_M829A3_max",[0],4],
["rhs_mag_M1028_max",[0],10],
["rhs_mag_M1069_max",[0],22],
["rhs_mag_762x51_M240_1200",[0],1200],
["rhs_mag_762x51_M240_1200",[0],1200],
["rhs_mag_762x51_M240_1200",[0],1200],
["rhs_mag_762x51_M240_1200",[0],1200],
["rhs_mag_762x51_M240_1200",[0],1200],
["rhs_mag_762x51_M240_1200",[0],1200],
["rhs_mag_762x51_M240_1200",[0],1200],
["rhs_mag_762x51_M240_1200",[0],1200],
["rhs_mag_762x51_M240_1200",[0],1200],
["rhs_LaserFCSMag",[0],99],
["rhs_LaserFCSMag",[0],99],
["rhs_mag_100rnd_127x99_mag_Tracer_Red",[0,0]],
["rhs_mag_100rnd_127x99_mag_Tracer_Red",[0,0]],
["rhs_mag_100rnd_127x99_mag_Tracer_Red",[0,0]],
["rhs_mag_100rnd_127x99_mag_Tracer_Red",[0,0]],
["rhs_mag_100rnd_127x99_mag_Tracer_Red",[0,0]],
["rhs_mag_100rnd_127x99_mag_Tracer_Red",[0,0]],
["rhs_mag_100rnd_127x99_mag_Tracer_Red",[0,0]],
["rhs_mag_100rnd_127x99_mag_Tracer_Red",[0,0]],
["rhs_mag_100rnd_127x99_mag_Tracer_Red",[0,0]],
["rhs_mag_100rnd_127x99_mag_Tracer_Red",[0,0]],
["rhsusf_mag_L8A3_12",[0,0],12],
["rhs_mag_762x51_M240_200",[0,2]],
["rhs_mag_762x51_M240_200",[0,2]],
["rhs_mag_762x51_M240_200",[0,2]]
], ""] call cScripts_fnc_vehicle_addPylonSelection;
};

_mainCategory

0 comments on commit 6fbae37

Please sign in to comment.