diff --git a/addons/common/stringtable.xml b/addons/common/stringtable.xml index d9df3f16a2..440d26e867 100644 --- a/addons/common/stringtable.xml +++ b/addons/common/stringtable.xml @@ -1330,37 +1330,5 @@ 玩家与AI 玩家與AI - - Players only - Игроков - Tylko dla graczy - Solo jugadores - Nur Spieler - Pouze hráči - Somente jogadores - Joueur uniquement - Csak játékosok - Solo giocatori - プレイヤーのみ - 플레이어만 - 只限玩家 - 只限玩家 - - - Players and AI - Игроков и ботов - Gracze oraz AI - Jugadores e IA - Spieler und KI - Hráči a AI - Jogadores e IA - Joueurs et IA - Játékosok és AI - Giocatori ed IA - プレイヤーと AI - 플레이어 및 인공지능 - 玩家与AI - 玩家與AI - diff --git a/addons/csw/Cfg3den.hpp b/addons/csw/Cfg3den.hpp new file mode 100644 index 0000000000..dfac0f5475 --- /dev/null +++ b/addons/csw/Cfg3den.hpp @@ -0,0 +1,38 @@ +class ctrlCombo; +class Cfg3DEN { + class Attributes { + class Title; + class Combo: Title { + class Controls { + class Title; + class Value; + }; + }; + class GVAR(assemblyModeControl): Combo { + class Controls: Controls { + class Title: Title {}; + class Value: Value { + class Items { + class Disable { + text = "$STR_DISABLED"; + value = 0; + }; + class Enable { + text = "$STR_CONFIG_JOYSTICK_ENABLED"; + value = 1; + }; + class EnableAndEmpty { + text = CSTRING(eden_enableAndEmpty); + value = 2; + }; + class Default { + text = "$STR_VEHICLE_DEFAULT"; + value = 3; + default = 1; + }; + }; + }; + }; + }; + }; +}; diff --git a/addons/csw/CfgVehicles.hpp b/addons/csw/CfgVehicles.hpp index 9c2ea542ee..ecd438fa64 100644 --- a/addons/csw/CfgVehicles.hpp +++ b/addons/csw/CfgVehicles.hpp @@ -1,17 +1,3 @@ -#define ENABLE_CSW_ATTRIBUTE class Attributes { \ - class GVAR(enableCSW) { \ - property = QGVAR(enableCSW); \ - control = "Checkbox"; \ - displayName = CSTRING(eden_enableCSW); \ - tooltip = CSTRING(eden_enableCSW_tooltip); \ - expression = QUOTE(_this setVariable[ARR_3(QQGVAR(enableCSW), _value, true)];); \ - typeName = "BOOL"; \ - condition = "objectVehicle"; \ - defaultValue = true; \ - }; \ - } - - class CfgVehicles { class Man; class CAManBase: Man { @@ -37,14 +23,14 @@ class CfgVehicles { accuracy = 1000; destrType = "DestructDefault"; - ace_dragging_canDrag = 1; - ace_dragging_dragPosition[] = {0, 2, 0}; - ace_dragging_canCarry = 1; - ace_dragging_carryPosition[] = {0, 2, 0}; + EGVAR(dragging,canDrag) = 1; + EGVAR(dragging,dragPosition)[] = {0, 2, 0}; + EGVAR(dragging,canCarry) = 1; + EGVAR(dragging,carryPosition)[] = {0, 2, 0}; class ACE_Actions { class ACE_MainActions { - displayName = CSTRING(Tripod_displayName); + displayName = CSTRING(genericTripod_displayName); selection = ""; distance = 2.5; condition = "true"; @@ -90,7 +76,7 @@ class CfgVehicles { disassembleTo = QGVAR(kordCarryTripod); }; }; - class GVAR(sag30Tripod): GVAR(m3Tripod) { + class GVAR(sag30Tripod): GVAR(baseTripod) { author = ECSTRING(common,ACETeam); scope = 2; model = QPATHTOEF(apl,ace_csw_tripod_ags30.p3d); @@ -112,12 +98,12 @@ class CfgVehicles { author = ECSTRING(common,ACETeam); scope = 2; model = QPATHTOEF(apl,ace_csw_tripod_spg9.p3d); - displayName = CSTRING(spg9Tripod_displayName); + displayName = CSTRING(spg9_Tripod); class ADDON { disassembleTo = QGVAR(spg9CarryTripod); }; }; - class GVAR(mortarBaseplate): GVAR(m3Tripod) { + class GVAR(mortarBaseplate): GVAR(baseTripod) { author = ECSTRING(common,ACETeam); scope = 2; model = QPATHTOEF(apl,ACE_CSW_mortarBaseplate.p3d); @@ -145,6 +131,7 @@ class CfgVehicles { class StaticMGWeapon: StaticWeapon {}; class HMG_01_base_F: StaticMGWeapon { + // ENABLE_CSW_ATTRIBUTE; class ADDON { enabled = 1; proxyWeapon = QGVAR(HMG_Static); @@ -179,6 +166,7 @@ class CfgVehicles { class GMG_TriPod; class GMG_01_base_F: GMG_TriPod { + // ENABLE_CSW_ATTRIBUTE; class ADDON { enabled = 1; proxyWeapon = QGVAR(GMG_20mm); // Weapon Proxy (Shorter Reload Time) [CfgWeapons] @@ -212,6 +200,7 @@ class CfgVehicles { class AT_01_base_F: StaticMGWeapon { + // ENABLE_CSW_ATTRIBUTE; class ADDON { enabled = 1; proxyWeapon = QGVAR(Titan_AT_Static); @@ -225,6 +214,7 @@ class CfgVehicles { }; class AA_01_base_F: StaticMGWeapon { + // ENABLE_CSW_ATTRIBUTE; class ADDON { enabled = 1; proxyWeapon = QGVAR(Titan_AA_Static); // Weapon Proxy (Shorter Reload Time) [CfgWeapons] @@ -240,6 +230,7 @@ class CfgVehicles { class StaticMortar: StaticWeapon {}; class Mortar_01_base_F: StaticMortar { + // ENABLE_CSW_ATTRIBUTE; class ADDON { enabled = 1; magazineLocation = ""; diff --git a/addons/csw/CfgWeapons.hpp b/addons/csw/CfgWeapons.hpp index 6c5db3796c..c3b0d3354a 100644 --- a/addons/csw/CfgWeapons.hpp +++ b/addons/csw/CfgWeapons.hpp @@ -47,14 +47,14 @@ class CfgWeapons { modes[] = {}; picture = QPATHTOF(UI\Tripod_Icon.paa); }; - + class GVAR(kordCarryTripodLow): GVAR(kordCarryTripod) { class ADDON { deploy = QGVAR(kordTripodLow); }; displayName = CSTRING(kordTripodFoldedLow_displayName); }; - + class GVAR(m220CarryTripod): Launcher_Base_F { class ADDON { type = "mount"; @@ -72,7 +72,7 @@ class CfgWeapons { modes[] = {}; picture = QPATHTOF(UI\Tripod_Icon.paa); }; - + class GVAR(spg9CarryTripod): Launcher_Base_F { class ADDON { type = "mount"; @@ -83,14 +83,14 @@ class CfgWeapons { class WeaponSlotsInfo: WeaponSlotsInfo { mass = 260; }; - displayName = CSTRING(spg9TripodFolded_displayName); + displayName = CSTRING(spg9_TripodFolded); author = ECSTRING(common,ACETeam); scope = 2; model = QPATHTOEF(apl,ACE_CSW_Bag.p3d); modes[] = {}; picture = QPATHTOF(UI\Tripod_Icon.paa); }; - + class GVAR(sag30CarryTripod): Launcher_Base_F { class ADDON { type = "mount"; @@ -108,7 +108,7 @@ class CfgWeapons { modes[] = {}; picture = QPATHTOF(UI\Tripod_Icon.paa); }; - + class GVAR(carryMortarBaseplate): Launcher_Base_F { class ADDON { type = "mount"; @@ -119,7 +119,7 @@ class CfgWeapons { class WeaponSlotsInfo: WeaponSlotsInfo { mass = 290; // M3A1 baseblate weight }; - displayName = CSTRING(m224MortarBaseplate_displayName); + displayName = CSTRING(mortarBaseplateBag_displayName); author = ECSTRING(common,ACETeam); scope = 2; model = QPATHTOEF(apl,ACE_CSW_Bag.p3d); @@ -225,26 +225,18 @@ class CfgWeapons { class WeaponSlotsInfo: WeaponSlotsInfo { mass = 620; // M252 Mortar Weight }; - displayName = CSTRING(m224MortarBag_displayName); + displayName = CSTRING(mk6MortarBag_displayName); author = ECSTRING(common,ACETeam); scope = 2; model = QPATHTOEF(apl,ACE_CSW_Bag.p3d); modes[] = {}; picture = QPATHTOF(UI\StaticHGMG_Icon.paa); }; - - // Proxy Weapons - class HMG_static; - class GVAR(HMG_Static): HMG_Static { - magazineReloadTime = 0.5; - }; - - class GMG_20mm; - class GVAR(GMG_20mm): GMG_20mm { - magazineReloadTime = 0.5; - }; - + // Proxy Weapons + CREATE_CSW_PROXY(HMG_Static); + CREATE_CSW_PROXY(GMG_20mm); + class missiles_titan_static; class EGVAR(javelin,Titan_Static): missiles_titan_static {}; // if ace_javelin does not exist, this will just inherit from the base weapon class GVAR(Titan_AT_Static): EGVAR(javelin,Titan_Static) { @@ -254,8 +246,8 @@ class CfgWeapons { class GVAR(Titan_AA_Static) : missiles_titan_static { magazineReloadTime = 0.5; }; - - + + /* class GVAR(staticAutoHMGCarry): Launcher_Base_F { class ADDON { diff --git a/addons/csw/XEH_PREP.hpp b/addons/csw/XEH_PREP.hpp index 455ffa5e0a..7bde8c3c0f 100644 --- a/addons/csw/XEH_PREP.hpp +++ b/addons/csw/XEH_PREP.hpp @@ -1,5 +1,7 @@ TRACE_1("",QUOTE(ADDON)); +PREP(aceRearmGetCarryMagazines); + PREP(ai_handleFired); PREP(assemble_canDeployTripod); diff --git a/addons/csw/config.cpp b/addons/csw/config.cpp index 4aef60630b..9478e7e798 100644 --- a/addons/csw/config.cpp +++ b/addons/csw/config.cpp @@ -1,4 +1,5 @@ #include "script_component.hpp" +#include "script_config_macros_csw.hpp" class CfgPatches { class ADDON { @@ -14,6 +15,7 @@ class CfgPatches { }; }; +#include "Cfg3den.hpp" #include "CfgEventHandlers.hpp" #include "CfgVehicles.hpp" #include "CfgWeapons.hpp" diff --git a/addons/csw/cswDesign.txt b/addons/csw/cswDesign.txt deleted file mode 100644 index 960fb43bf6..0000000000 --- a/addons/csw/cswDesign.txt +++ /dev/null @@ -1,53 +0,0 @@ -Settings: - - defaultBehaviour: - Normal - Untouched [full mags, normal backpack disassemble] - Advanced - [Realistic mags, side unloading] - handleExtraMagazines - Extra magazines on ground - Ignore extra magazines - -Vehicle: - 3den attribute controls if [useSetting, normal or advanced] - -configs: - -CfgWeapons: - class GVAR(m3CarryTripod): Launcher_Base_F { - class ADDON { - type = "mount"; - deployTime = 3; - pickupTime = 3; - deploy = QGVAR(m3Tripod); - }; - - class GVAR(staticATCarry): Launcher_Base_F { - class ADDON { - type = "weapon"; - deployTime = 8; - pickupTime = 15; - class assembleTo { - tripodCfgVehicle = staticCfgVehicle; - }; - }; - - - - -CfgVehicles: - class GVAR(m3Tripod): // Tripod Example - class ADDON { - disassembleTo = QGVAR(m3CarryTripod); - - - class Mortar_01_base_F: // Static Weapon Example - class ADDON { - enabled = 1; - magazineLocation = ""; - disassembleWeapon = ""; // secondary weapon classname - disassembleTurret = ""; // CfgVehicle - desiredAmmo = 100; // - ammoLoadTime = 5; - ammoUnloadTime = 5; - - diff --git a/addons/csw/functions/fnc_aceRearmGetCarryMagazines.sqf b/addons/csw/functions/fnc_aceRearmGetCarryMagazines.sqf new file mode 100644 index 0000000000..ac64f636e8 --- /dev/null +++ b/addons/csw/functions/fnc_aceRearmGetCarryMagazines.sqf @@ -0,0 +1,50 @@ +#include "script_component.hpp" +/* + * Author: PabstMirror + * Helper function for ace_rearm; Gets magazines that should be loaded by csw + * + * Arguments: + * 0: Vehicle + * 1: Specific Turret or pass bool to check all turrets (default: true) + * + * Return Value: + * [0: compatible veh mags, 1: carry mags] + * + * Example: + * [cursorObject, [0]] call ace_csw_fnc_aceRearmGetCarryMagazines + * + * Public: No + */ + +params ["_vehicle", ["_targetTurret", true, [[], true]]]; + +if (!(_vehicle isKindOf "StaticWeapon")) exitWith { [[],[]] }; // limit to statics for now +// Assembly mode: [0=disabled, 1=enabled, 2=enabled&unload, 3=default] +if ((GVAR(ammoHandling) == 0) && {!([false, true, true, GVAR(defaultAssemblyMode)] select (_vehicle getVariable [QGVAR(assemblyMode), 3]))}) exitWith { [[],[]] }; + +private _turretMagsCSW = []; +private _allCarryMags = []; +{ + private _turretPath = _x; + if ((_targetTurret isEqualTo true) || {_turretPath isEqualTo _targetTurret}) then { + { + private _weapon = _x; + { + private _xMag = _x; + private _carryMag = GVAR(vehicleMagCache) getVariable _xMag; + if (isNil "_carryMag") then { + private _groups = "getNumber (_x >> _xMag) == 1" configClasses (configFile >> QGVAR(groups)); + _carryMag = configName (_groups param [0, configNull]); + GVAR(vehicleMagCache) setVariable [_x, _carryMag]; + TRACE_2("setting cache",_xMag,_carryMag); + }; + if (_carryMag != "") then { + _turretMagsCSW pushBackUnique _xMag; + _allCarryMags pushBackUnique _carryMag; + }; + } forEach ([_weapon] call CBA_fnc_compatibleMagazines); + } forEach (_vehicle weaponsTurret _turretPath); + }; +} forEach (allTurrets _vehicle); + +[_turretMagsCSW, _allCarryMags] diff --git a/addons/csw/functions/fnc_ai_handleFired.sqf b/addons/csw/functions/fnc_ai_handleFired.sqf index 43876f3b87..f85c74fd20 100644 --- a/addons/csw/functions/fnc_ai_handleFired.sqf +++ b/addons/csw/functions/fnc_ai_handleFired.sqf @@ -75,7 +75,7 @@ if (_bestAmmoToSend == -1) exitWith {ERROR("No ammo");}; // Remove the mag from the source if (_reloadSource isKindOf "CaManBase") then { - [_reloadSource, _reloadMag, _bestAmmoToSend] call ace_common_fnc_removeSpecificMagazine; + [_reloadSource, _reloadMag, _bestAmmoToSend] call EFUNC(common,removeSpecificMagazine); } else { [_reloadSource, _reloadMag, 1, _bestAmmoToSend] call CBA_fnc_removeMagazineCargo; }; diff --git a/addons/csw/functions/fnc_assemble_canPickupWeapon.sqf b/addons/csw/functions/fnc_assemble_canPickupWeapon.sqf index 21a88709d6..ef40e03b3c 100644 --- a/addons/csw/functions/fnc_assemble_canPickupWeapon.sqf +++ b/addons/csw/functions/fnc_assemble_canPickupWeapon.sqf @@ -17,9 +17,10 @@ params ["_staticWeapon"]; -private _assemblyMode = [false, true, GVAR(defaultAssemblyMode)] select (_staticWeapon getVariable [QGVAR(assemblyMode), 2]); -private _crewed = (crew _staticWeapon) isEqualTo []; +// Assembly mode: [0=disabled, 1=enabled, 2=enabled&unload, 3=default] +private _assemblyMode = [false, true, true, GVAR(defaultAssemblyMode)] select (_staticWeapon getVariable [QGVAR(assemblyMode), 3]); +private _notCrewed = (crew _staticWeapon) isEqualTo []; private _deadCrew = !(alive (gunner _staticWeapon)); // need to eject body??? -_assemblyMode && {(!_crewed) || _deadCrew} +_assemblyMode && {_notCrewed || _deadCrew} diff --git a/addons/csw/functions/fnc_assemble_deployTripod.sqf b/addons/csw/functions/fnc_assemble_deployTripod.sqf index 039dcd051d..ba7f15777a 100644 --- a/addons/csw/functions/fnc_assemble_deployTripod.sqf +++ b/addons/csw/functions/fnc_assemble_deployTripod.sqf @@ -33,8 +33,7 @@ // Create a tripod private _cswTripod = createVehicle [_tripodClassname, [0, 0, 0], [], 0, "NONE"]; // Because the tripod can be a "full weapon" we disable any data that will allow it to be loaded - _cswTripod setVariable [QGVAR(assemblyMode), 1, true]; // Explicitly set advanced assembly mode and broadcast - _cswTripod setVariable [QGVAR(emptyWeapon), true, false]; // unload gun, shouldn't need broadcast for this as it will be local to us + _cswTripod setVariable [QGVAR(assemblyMode), 2, true]; // Explicitly set enabled&unload assembly mode and broadcast if (!GVAR(defaultAssemblyMode)) then { TRACE_1("global disableVanillaAssembly event",_cswTripod); // handles it being assembled when setting is disabled [QGVAR(disableVanillaAssembly), [_cswTripod]] call CBA_fnc_globalEvent; diff --git a/addons/csw/functions/fnc_assemble_deployWeapon.sqf b/addons/csw/functions/fnc_assemble_deployWeapon.sqf index 1c27352606..12b5938bb9 100644 --- a/addons/csw/functions/fnc_assemble_deployWeapon.sqf +++ b/addons/csw/functions/fnc_assemble_deployWeapon.sqf @@ -43,15 +43,18 @@ [{ params ["_assembledClassname", "_tripodDir", "_tripodPos"]; private _csw = createVehicle [_assembledClassname, [0, 0, 0], [], 0, "NONE"]; - _csw setVariable [QGVAR(assemblyMode), 1, true]; // Explicitly set advanced assembly mode and broadcast - _csw setVariable [QGVAR(emptyWeapon), true, false]; // unload gun, shouldn't need broadcast for this as it will be local to us + // Assembly mode: [0=disabled, 1=enabled, 2=enabled&unload, 3=default] + _csw setVariable [QGVAR(assemblyMode), 2, true]; // Explicitly set advanced assembly mode + unload, and broadcast if (!GVAR(defaultAssemblyMode)) then { TRACE_1("global disableVanillaAssembly event",_csw); // handles it being assembled when setting is disabled [QGVAR(disableVanillaAssembly), [_csw]] call CBA_fnc_globalEvent; }; _csw setDir _tripodDir; _csw setPosATL _tripodPos; - _csw setVectorUp (surfaceNormal _tripodPos); + if ((_tripodPos select 2) < 0.5) then { + _csw setVectorUp (surfaceNormal _tripodPos); + }; + TRACE_2("csw placed",_csw,_assembledClassname); }, [_assembledClassname, _tripodDir, _tripodPos]] call CBA_fnc_execNextFrame; }; diff --git a/addons/csw/functions/fnc_proxyWeapon.sqf b/addons/csw/functions/fnc_proxyWeapon.sqf index 198a4fbe28..3e47fddadd 100644 --- a/addons/csw/functions/fnc_proxyWeapon.sqf +++ b/addons/csw/functions/fnc_proxyWeapon.sqf @@ -7,30 +7,33 @@ * 0: Weapon * 1: Turret * 2: Proxy weapon needed + * 2: Weapon should be emptied * * Return Value: * None * * Example: - * [weapon, [0], true] call ace_csw_fnc_proxyWeapon + * [weapon, [0], true, false] call ace_csw_fnc_proxyWeapon * * Public: No */ -params ["_staticWeapon", "_turret", "_needed"]; +params ["_staticWeapon", "_turret", "_needed", "_emptyWeapon"]; +TRACE_4("proxyWeapon",_staticWeapon,_turret,_needed,_emptyWeapon); -if (_staticWeapon getVariable [format [QGVAR(proxyHandled_%1), _turret], false]) exitWith { TRACE_1("proxy weapon already handled",_staticWeapon); }; +if (_staticWeapon getVariable [format [QGVAR(proxyHandled_%1), _turret], false]) exitWith { TRACE_1("already handled",typeOf _staticWeapon); }; private _typeOf = typeOf _staticWeapon; private _proxyWeapon = getText(configFile >> "CfgVehicles" >> _typeOf >> "ace_csw" >> "proxyWeapon"); -TRACE_5("proxyWeapon",_staticWeapon,_turret,_needed,_typeOf,_proxyWeapon); -if (_proxyWeapon == "") exitWith { TRACE_1("proxyWeapon not defined",_proxyWeapon); }; +TRACE_2("",_typeOf,_proxyWeapon); +if (_proxyWeapon == "") exitWith {}; private _currentWeapon = (_staticWeapon weaponsTurret [0]) param [0, "#none"]; if ((missionNamespace getVariable [_proxyWeapon, objNull]) isEqualType {}) then { // check if string is a function TRACE_1("Calling proxyWeapon function",_proxyWeapon); - _proxyWeapon = [_staticWeapon, _turret, _currentWeapon, _needed] call (missionNamespace getVariable _proxyWeapon); + // This function may replace magazines or do other things to the static weapon + _proxyWeapon = [_staticWeapon, _turret, _currentWeapon, _needed, _emptyWeapon] call (missionNamespace getVariable _proxyWeapon); _needed = _proxyWeapon != ""; }; if (!_needed) exitWith { TRACE_2("not needed",_needed,_proxyWeapon); }; diff --git a/addons/csw/functions/fnc_reload_getLoadableMagazines.sqf b/addons/csw/functions/fnc_reload_getLoadableMagazines.sqf index bbf2b8dc39..8e6f3ce500 100644 --- a/addons/csw/functions/fnc_reload_getLoadableMagazines.sqf +++ b/addons/csw/functions/fnc_reload_getLoadableMagazines.sqf @@ -43,7 +43,7 @@ private _return = []; if (((getNumber (_carryGroup >> _x)) == 1) && {_loadInfo = [_vehicle, _turretPath, _carryMag, _player] call FUNC(reload_canLoadMagazine); _loadInfo select 0}) exitWith { _return pushBack [_carryMag, _turretPath, _loadInfo]; }; - } forEach (getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines")); + } forEach ([_weapon] call CBA_fnc_compatibleMagazines); } forEach _carriedMagazines; } forEach (_vehicle weaponsTurret _turretPath); } forEach (allTurrets _vehicle); diff --git a/addons/csw/functions/fnc_reload_handleAddTurretMag.sqf b/addons/csw/functions/fnc_reload_handleAddTurretMag.sqf index 55d10dd4b7..841192864a 100644 --- a/addons/csw/functions/fnc_reload_handleAddTurretMag.sqf +++ b/addons/csw/functions/fnc_reload_handleAddTurretMag.sqf @@ -52,7 +52,7 @@ if (_canAdd) then { TRACE_1("Removing emtpy mag",_loadedMag); _vehicle removeMagazinesTurret [_loadedMag, _turret]; }; - [_vehicle, _turret, true] call FUNC(proxyWeapon); // Check if we need to add proxy weapon now + [_vehicle, _turret, true, false] call FUNC(proxyWeapon); // Check if we need to add proxy weapon now private _newMag = [_vehicle, _turret, _carryMag] call FUNC(reload_getVehicleMagazine); TRACE_2("Adding new mag",_newMag,_ammoUsed); _vehicle addMagazineTurret [_newMag, _turret, _ammoUsed]; diff --git a/addons/csw/functions/fnc_staticWeaponInit.sqf b/addons/csw/functions/fnc_staticWeaponInit.sqf index 2e820ca594..4ce86f3c49 100644 --- a/addons/csw/functions/fnc_staticWeaponInit.sqf +++ b/addons/csw/functions/fnc_staticWeaponInit.sqf @@ -31,10 +31,13 @@ if (_configEnabled && {_staticWeapon turretLocal [0]}) then { // if turret is lo [{ params ["_staticWeapon"]; if (!alive _staticWeapon) exitWith { TRACE_1("dead/deleted",_staticWeapon); }; - private _assemblyMode = [false, true, GVAR(defaultAssemblyMode)] select (_staticWeapon getVariable [QGVAR(assemblyMode), 2]); + // Assembly mode: [0=disabled, 1=enabled, 2=enabled&unload, 3=default] + private _assemblyModeIndex = _staticWeapon getVariable [QGVAR(assemblyMode), 3]; + private _emptyWeapon = _assemblyModeIndex isEqualTo 2; + private _assemblyMode = [false, true, true, GVAR(defaultAssemblyMode)] select _assemblyModeIndex; TRACE_2("turretLocal",_staticWeapon,_assemblyMode); - [_staticWeapon, [0], _assemblyMode] call FUNC(proxyWeapon); - [_staticWeapon, _assemblyMode] call FUNC(staticWeaponInit_unloadExtraMags); + [_staticWeapon, [0], _assemblyMode, _emptyWeapon] call FUNC(proxyWeapon); + [_staticWeapon, _assemblyMode, _emptyWeapon] call FUNC(staticWeaponInit_unloadExtraMags); }, [_staticWeapon]] call CBA_fnc_execNextFrame; // need to wait a frame to allow setting object vars during assembly }; @@ -42,7 +45,7 @@ if (_assemblyConfig) then { [{ params ["_staticWeapon"]; if (!alive _staticWeapon) exitWith { TRACE_1("dead/deleted",_staticWeapon); }; - private _assemblyMode = [false, true, GVAR(defaultAssemblyMode)] select (_staticWeapon getVariable [QGVAR(assemblyMode), 2]); + private _assemblyMode = [false, true, true, GVAR(defaultAssemblyMode)] select (_staticWeapon getVariable [QGVAR(assemblyMode), 3]); TRACE_2("assemblyConfig present",_staticWeapon,_assemblyMode); if (_assemblyMode) then { // Disable vanilla assembly if assemblyMode eanbled [QGVAR(disableVanillaAssembly), [_staticWeapon]] call CBA_fnc_localEvent; @@ -65,7 +68,7 @@ if (hasInterface && {!(_typeOf in GVAR(initializedStaticTypes))}) then { private _magazineLocation = getText (configFile >> "CfgVehicles" >> _typeOf >> QUOTE(ADDON) >> "magazineLocation"); private _condition = { //IGNORE_PRIVATE_WARNING ["_target", "_player"]; // If magazine handling is enabled or weapon assembly/disassembly is enabled we enable ammo handling - if ((GVAR(ammoHandling) == 0) && {!([false, true, GVAR(defaultAssemblyMode)] select (_staticWeapon getVariable [QGVAR(assemblyMode), 2]))}) exitWith { false }; + if ((GVAR(ammoHandling) == 0) && {!([false, true, true, GVAR(defaultAssemblyMode)] select (_target getVariable [QGVAR(assemblyMode), 3]))}) exitWith { false }; [_player, _target, ["isNotSwimming", "isNotSitting"]] call EFUNC(common,canInteractWith) }; private _childenCode = { diff --git a/addons/csw/functions/fnc_staticWeaponInit_unloadExtraMags.sqf b/addons/csw/functions/fnc_staticWeaponInit_unloadExtraMags.sqf index a5eddfe6a6..bd73df878c 100644 --- a/addons/csw/functions/fnc_staticWeaponInit_unloadExtraMags.sqf +++ b/addons/csw/functions/fnc_staticWeaponInit_unloadExtraMags.sqf @@ -5,24 +5,19 @@ * * Arguments: * 0: Weapon + * 1: Using advanced assembly * * Return Value: * None * * Example: - * [weapon] call ace_csw_fnc_staticWeaponInit_unloadExtraMags + * [cursorObject, false] call ace_csw_fnc_staticWeaponInit_unloadExtraMags * * Public: No */ -params ["_staticWeapon"]; -TRACE_1("staticWeaponInit_unloadExtraMags",_staticWeapon); -if (!alive _staticWeapon) exitWith {TRACE_1("dead/deleted",alive _staticWeapon);}; - -private _assemblyMode = [false, true, GVAR(defaultAssemblyMode)] select (_staticWeapon getVariable [QGVAR(assemblyMode), 2]); -private _emptyWeapon = _staticWeapon getVariable [QGVAR(emptyWeapon), false]; -TRACE_2("",_assemblyMode,_emptyWeapon); - +params ["_staticWeapon", "_assemblyMode", "_emptyWeapon"]; +TRACE_3("staticWeaponInit_unloadExtraMags",_staticWeapon,_assemblyMode,_emptyWeapon); if (!_assemblyMode) exitWith {}; private _desiredAmmo = getNumber (configFile >> "CfgVehicles" >> (typeOf _staticWeapon) >> QUOTE(ADDON) >> "desiredAmmo"); @@ -31,7 +26,7 @@ if (_emptyWeapon) then { _desiredAmmo = 0; _storeExtraMagazines = false; }; -TRACE_2("settings",_desiredAmmo,_storeExtraMagazines); +TRACE_3("settings",_emptyWeapon,_desiredAmmo,_storeExtraMagazines); private _magsToRemove = []; private _loadedMagazineInfo = []; diff --git a/addons/csw/script_component.hpp b/addons/csw/script_component.hpp index ab263d6dec..29521039f2 100644 --- a/addons/csw/script_component.hpp +++ b/addons/csw/script_component.hpp @@ -2,10 +2,10 @@ #define COMPONENT_BEAUTIFIED Crew-Served Weapons #include "\z\ace\addons\main\script_mod.hpp" -#define FAST_PROGRESSBARS -#define DEBUG_MODE_FULL -#define DISABLE_COMPILE_CACHE -#define ENABLE_PERFORMANCE_COUNTERS +// #define FAST_PROGRESSBARS +// #define DEBUG_MODE_FULL +// #define DISABLE_COMPILE_CACHE +// #define ENABLE_PERFORMANCE_COUNTERS #ifdef DEBUG_ENABLED_CSW #define DEBUG_MODE_FULL diff --git a/addons/csw/script_config_macros_csw.hpp b/addons/csw/script_config_macros_csw.hpp new file mode 100644 index 0000000000..1a0e1b3be5 --- /dev/null +++ b/addons/csw/script_config_macros_csw.hpp @@ -0,0 +1,15 @@ +#define CREATE_CSW_PROXY(weapon) class ##weapon; class GVAR(weapon): ##weapon { magazineReloadTime = 0.5; } + +// Need to be careful about breaking Attributes inheritance, doesn't seem to be any standard +#define ENABLE_CSW_ATTRIBUTE class Attributes { \ + class EGVAR(CSW,assemblyMode) { \ + property = QEGVAR(CSW,assemblyMode); \ + control = QEGVAR(CSW,assemblyModeControl); \ + displayName = ECSTRING(CSW,eden_enableCSW); \ + tooltip = ECSTRING(CSW,eden_enableCSW_tooltip); \ + expression = QUOTE( if (_value != 3) then {_this setVariable [ARR_3('%s',_value,true)]} ); \ + typeName = "NUMBER"; \ + condition = "objectVehicle"; \ + defaultValue = 3; \ + }; \ + } diff --git a/addons/csw/stringtable.xml b/addons/csw/stringtable.xml index b9ee13fa30..b16543e55a 100644 --- a/addons/csw/stringtable.xml +++ b/addons/csw/stringtable.xml @@ -72,12 +72,6 @@ Allow loading and unloading magazines - - AI Reloading - - - AI will attempt to reload static weapons with available ammo - Interaction Time Coefficent @@ -87,9 +81,6 @@ Pickup Tripod - - Move Tripod - Mount Weapon @@ -99,12 +90,6 @@ Assembling Gun... - - Loading Ammo... - - - Unloading Ammo... - Picking Up Tripod... @@ -117,32 +102,17 @@ Enables Crew Served ability on this weapon - - Used to reload crew served weapons + + Enabled and Leave Weapon Empty - - [CSW] Mini-Spike Launcher (AT) - - - [CSW] Mini-Spike Launcher (AA) - - - [CSW] XM312 - - - [CSW] XM312A - - - [CSW] XM312 (High) - - - [CSW] XM307 - - - [CSW] XM307A - - - [CSW] XM307 (High) + + Tripod + Trépied + Trípode + Treppiede + Trójnóg + Dreibein + Üçayak [CSW] Static Mini-Spike Launcher (AT) @@ -156,30 +126,12 @@ [CSW] Static XM312 Gun (Autonomous) - - [CSW] Static XM312 Gun (High) - [CSW] Static XM307 Gun [CSW] Static XM307 Gun (Autonomous) - - [CSW] Static XM307 Gun (High) - - - [CSW] HMG Static - - - [CSW] GMG Static - - - [CSW] AT Static - - - [CSW] AA Static - [CSW] 12.7x108mm HMG Belt @@ -198,9 +150,6 @@ [CSW] 20mm Grenade GMG Belt - - [CSW] 12.7 x 108 mm Ammo Belt - M3 Tripod @@ -213,9 +162,6 @@ [CSW] M220 Deployable Tripod - - [CSW] SPG-9 Deployable Tripod - [CSW] SAG-30 Deployable Tripod @@ -228,20 +174,65 @@ M220 Tripod - - SPG-9 Tripod - [CSW] M3 Deployable Tripod [CSW] M3 Deployable Tripod (Low) - - [CSW] M224 Mortar Baseplate + + [CSW] Mortar Baseplate - + + Mortar Baseplate + + [CSW] Mk6 Mortar Tube + + [CSW] M252 Tube Bag + + + [CSW] M2 Gun Bag + + + [CSW] MK19 Gun Bag + + + [CSW] BGM-71 TOW Launcher Bag + + + [CSW] DSHK Gun Bag + + + [CSW] 2B14 Tube Bag + + + [CSW] NSV Gun Bag + + + [CSW] KORD Gun Bag + + + [CSW] AGS-30 Gun Bag + + + [CSW] 9k115 Metis Launcher Bag + + + [CSW] 9m113 Kornet Launcher + + + SPG-9 Tripod + + + [CSW] SPG-9 Deployable Tripod + + + [CSW] SPG-9 Launcher Bag + + + [CSW] SPG-9M Launcher Bag + diff --git a/addons/dragon/CfgAmmo.hpp b/addons/dragon/CfgAmmo.hpp index faccdfb1cd..033239013f 100644 --- a/addons/dragon/CfgAmmo.hpp +++ b/addons/dragon/CfgAmmo.hpp @@ -2,7 +2,7 @@ class CfgAmmo { class ammo_Penetrator_Base; class M_Scalpel_AT; class Rocket_03_AP_F; - + class GVAR(penetrator_super): ammo_Penetrator_Base { caliber = 60; warheadName = "HEAT"; @@ -25,7 +25,7 @@ class CfgAmmo { airFriction = 0.5; fuseDistance = 75; whistleDist = 2; - + hit = 100; indirectHit = 9; indirectHitRange = 1; @@ -34,7 +34,7 @@ class CfgAmmo { cost = 500; simulationStep = 0.005; maxControlRange = 1500; - + class ace_missileguidance { minDeflection = 0; maxDeflection = 0; @@ -59,7 +59,7 @@ class CfgAmmo { correctionDistance = 30; missileLeadDistance = 0; offsetFromCrosshair[] = { 0, 0, 0 }; - + serviceInterval = 0.33; // how many seconds between pops serviceCharges = 32; // how many charges are in this missile serviceChargeAcceleration = 6.5; @@ -69,7 +69,7 @@ class CfgAmmo { attackProfiles[] = {"DRAGON"}; }; }; - + class GVAR(super) : GVAR(dragonBase) { submunitionAmmo = QGVAR(penetrator_super); submunitionDirectionType = "SubmunitionModelDirection"; @@ -96,7 +96,7 @@ class CfgAmmo { correctionDistance = 30; missileLeadDistance = 0; - + serviceInterval = 0.33; // how many seconds between pops serviceCharges = 60; // how many charges are in this missile serviceChargeAcceleration = 6.5; @@ -106,7 +106,7 @@ class CfgAmmo { attackProfiles[] = {"DRAGON"}; }; }; - + class ShellBase; class GVAR(serviceCharge) : ShellBase { hit = 1; diff --git a/addons/dragon/CfgVehicles.hpp b/addons/dragon/CfgVehicles.hpp index c1c690c52e..faac05bbe9 100644 --- a/addons/dragon/CfgVehicles.hpp +++ b/addons/dragon/CfgVehicles.hpp @@ -122,11 +122,13 @@ class CfgVehicles { displayName = CSTRING(attachSight); condition = QUOTE(call FUNC(sightCanAttach)); statement = QUOTE(call FUNC(sightAttach)); + icon = QPATHTOF(data\m47_daysight_interaction_attach.paa); }; class GVAR(detachSight) { displayName = CSTRING(detachSight); condition = QUOTE(call FUNC(sightCanDetach)); statement = QUOTE(call FUNC(sightDetach)); + icon = QPATHTOF(data\m47_daysight_interaction_detach.paa); }; }; }; diff --git a/addons/dragon/CfgWeapons.hpp b/addons/dragon/CfgWeapons.hpp index f9c7f262ae..9cb58e2c1f 100644 --- a/addons/dragon/CfgWeapons.hpp +++ b/addons/dragon/CfgWeapons.hpp @@ -10,22 +10,22 @@ class CfgWeapons { class launch_Titan_F: launch_Titan_base { class WeaponSlotsInfo; }; - + class GVAR(super): launch_Titan_F { model = QPATHTOF(models\ace_m47_magazine.p3d); picture = QPATHTOF(data\m47_dragon_item_ca.paa); magazines[] = {}; - displayName = CSTRING(dragonName); + displayName = CSTRING(dragonNameCarry); // add [CSW] prefix to make it clearer in arsenal that this is a deployable weapon descriptionShort = CSTRING(dragonDescription); scope = 2; - + class ACE_CSW { type = "mount"; deployTime = 2; pickupTime = 2; deploy = QGVAR(staticBase); }; - + class WeaponSlotsInfo: WeaponSlotsInfo { mass = 253; }; @@ -36,14 +36,14 @@ class CfgWeapons { EGVAR(overpressure,angle) = 90; EGVAR(overpressure,range) = 30; EGVAR(overpressure,damage) = 0.85; - + initSpeed = 120; - + displayName = CSTRING(dragonName); descriptionShort = CSTRING(dragonDescription); magazines[] = { QGVAR(super) }; - }; - + }; + // need a weapon in order to rotate turret class GVAR(dummyStatic): Default { cursor = ""; @@ -55,7 +55,7 @@ class CfgWeapons { optics = 0; enableAttack = 0; }; - + class GVAR(sight): Binocular { displayName = CSTRING(sightName); model = QPATHTOF(models\ace_m47_optic.p3d); diff --git a/addons/dragon/XEH_postInit.sqf b/addons/dragon/XEH_postInit.sqf index 690f392447..0305fe772a 100644 --- a/addons/dragon/XEH_postInit.sqf +++ b/addons/dragon/XEH_postInit.sqf @@ -19,10 +19,14 @@ GVAR(pfID) = [{ params ["_args"]; (_this select 0) params ["_vehicle", "_lastView"]; - + if ((!alive _vehicle) || {!alive ACE_player} || {(vehicle ACE_player) != _vehicle}) exitWith { TRACE_1("exiting PFEH",GVAR(pfID)); [GVAR(pfID)] call CBA_fnc_removePerFrameHandler; + if ((alive _vehicle) && {!alive gunner _vehicle}) then { + TRACE_1("reseting rest rotate anim",_vehicle); + _vehicle animate ["rest_rotate", -0.35]; + }; }; if (cameraView in ["INTERNAL", "EXTERNAL"]) then { diff --git a/addons/dragon/config.cpp b/addons/dragon/config.cpp index 10a1d285db..78d836936e 100644 --- a/addons/dragon/config.cpp +++ b/addons/dragon/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ace_common","ace_missileguidance","ace_hot","ace_csw"}; + requiredAddons[] = {"ace_hot","ace_csw"}; author = ECSTRING(common,ACETeam); authors[] = {"Brandon (TCVM)"}; url = ECSTRING(main,URL); diff --git a/addons/dragon/data/m47_daysight_interaction_attach.paa b/addons/dragon/data/m47_daysight_interaction_attach.paa new file mode 100644 index 0000000000..0a9e19b461 Binary files /dev/null and b/addons/dragon/data/m47_daysight_interaction_attach.paa differ diff --git a/addons/dragon/data/m47_daysight_interaction_detach.paa b/addons/dragon/data/m47_daysight_interaction_detach.paa new file mode 100644 index 0000000000..7a0d5eb22e Binary files /dev/null and b/addons/dragon/data/m47_daysight_interaction_detach.paa differ diff --git a/addons/dragon/functions/fnc_attackProfile_DRAGON.sqf b/addons/dragon/functions/fnc_attackProfile_DRAGON.sqf index e717b32f70..b7adb597f5 100644 --- a/addons/dragon/functions/fnc_attackProfile_DRAGON.sqf +++ b/addons/dragon/functions/fnc_attackProfile_DRAGON.sqf @@ -30,9 +30,9 @@ if ((_distanceToProjectile > _seekerMaxRangeSqr) || _wireCut || { !alive _shoote // wire snap, random direction if (!_wireCut) then { _attackProfileStateParams set [1, true]; - playSound3D ["a3\sounds_f\air\sfx\SL_rope_break.wss", objNull, false, AGLtoASL (_shooter modelToWorld _wireCutSource), 150, 1, 25]; + playSound3D ["a3\sounds_f\air\sfx\SL_rope_break.wss", objNull, false, AGLtoASL (_shooter modelToWorld _wireCutSource), 5, 1, 25]; }; - + if (_serviceChargeCount > 0 && {(_lastTime - CBA_missionTime) <= 0}) then { _attackProfileStateParams set [5, CBA_missionTime + 0.05 + random 0.1]; private _randomVector = [(random 2) - 1, random 1, (random 2) - 1]; @@ -41,7 +41,7 @@ if ((_distanceToProjectile > _seekerMaxRangeSqr) || _wireCut || { !alive _shoote _charge setPosASL (_projectilePos vectorAdd ((_randomVector vectorMultiply -1) vectorMultiply 0.025)); _attackProfileStateParams set [7, _serviceChargeCount - 1]; }; - + _retPos }; @@ -50,10 +50,10 @@ if (_distanceToProjectile <= _seekerMinRangeSqr || { _serviceChargeCount <= 0 } // if the time between updates is less than the pop time we want to fire the rockets OR if the missile wants to make a major correction pop it rapidly if (((_lastTime - CBA_missionTime) <= 0) || {(_lastTime - CBA_missionTime) < (_serviceInterval / 2) && (_projectilePos vectorDistance _seekerTargetPos > 1)}) then { _attackProfileStateParams set [5, CBA_missionTime + _serviceInterval]; - + private _vectorToCrosshair = vectorNormalized (_projectile worldToModel (ASLToAGL _seekerTargetPos)); private _vectorToPos = vectorNormalized (((_projectile vectorWorldToModelVisual (_shooter weaponDirection _weapon)) vectorMultiply (_dragonSpeed * _serviceInterval)) vectorAdd (_vectorToCrosshair vectorMultiply _maxCorrectableDistance)); - + if ((_vectorToPos select 2) < 0) then { _vectorToPos set [2, 0]; } else { @@ -66,10 +66,10 @@ if (((_lastTime - CBA_missionTime) <= 0) || {(_lastTime - CBA_missionTime) < (_s }; _projectile setVelocityModelSpace ((velocityModelSpace _projectile) vectorAdd (_vectorToPos vectorMultiply _serviceChargeAcceleration)); - + private _charge = createVehicle [QGVAR(serviceCharge), [0, 0, 0], [], 0, "NONE"]; _charge setPosASL (_projectilePos vectorAdd ((_vectorToCrosshair vectorMultiply -1) vectorMultiply 0.025)); - + _attackProfileStateParams set [7, _serviceChargeCount - 1]; }; diff --git a/addons/dragon/functions/fnc_sightAttach.sqf b/addons/dragon/functions/fnc_sightAttach.sqf index a97f160d9d..6ad5df2077 100644 --- a/addons/dragon/functions/fnc_sightAttach.sqf +++ b/addons/dragon/functions/fnc_sightAttach.sqf @@ -6,6 +6,7 @@ * Arguments: * 0: Target * 1: Unit Performing Action + * 2: Is event (function recursives globaly to set weapon where turret is local) (default: false) * * Return Value: * Can Attach Sighting Unit @@ -19,7 +20,7 @@ params ["_target", "_unit", ["_event", false]]; TRACE_3("sightAttach",_target,_unit,_event); -if (_event isEqualTo true) then { +if (_event isEqualTo true) then { // this is actually needed as 3rd arg may not be bool if (!(_target turretLocal [0])) exitWith {}; _target setVariable [QGVAR(sightAttached), true, true]; _target animate ["optic_hide", 0]; diff --git a/addons/dragon/functions/fnc_sightCanAttach.sqf b/addons/dragon/functions/fnc_sightCanAttach.sqf index ca7d05539d..9ec742d19b 100644 --- a/addons/dragon/functions/fnc_sightCanAttach.sqf +++ b/addons/dragon/functions/fnc_sightCanAttach.sqf @@ -15,10 +15,9 @@ * * Public: No */ - + params ["_target", "_unit"]; (alive _target) -// && {!(_target getVariable [QGVAR(fired), false])} && {!(_target getVariable [QGVAR(sightAttached), ((typeOf _target) == QGVAR(staticAssembled))])} && {QGVAR(sight) in (weapons _unit)} diff --git a/addons/dragon/functions/fnc_sightCanDetach.sqf b/addons/dragon/functions/fnc_sightCanDetach.sqf index 49c7684509..92c4a9a913 100644 --- a/addons/dragon/functions/fnc_sightCanDetach.sqf +++ b/addons/dragon/functions/fnc_sightCanDetach.sqf @@ -15,9 +15,8 @@ * * Public: No */ - + params ["_target", "_unit"]; (alive _target) -// && {!(_target getVariable [QGVAR(fired), false])} && {_target getVariable [QGVAR(sightAttached), ((typeOf _target) == QGVAR(staticAssembled))]} diff --git a/addons/dragon/functions/fnc_sightDetach.sqf b/addons/dragon/functions/fnc_sightDetach.sqf index 2ee9bcfa46..161a13ba64 100644 --- a/addons/dragon/functions/fnc_sightDetach.sqf +++ b/addons/dragon/functions/fnc_sightDetach.sqf @@ -6,6 +6,7 @@ * Arguments: * 0: Target * 1: Unit Performing Action + * 2: Is event (function recursives globaly to set weapon where turret is local) (default: false) * * Return Value: * Can Attach Sighting Unit @@ -21,7 +22,7 @@ params ["_target", "_unit"]; params ["_target", "_unit", ["_event", false]]; TRACE_3("sightDetach",_target,_unit,_event); -if (_event isEqualTo true) then { +if (_event isEqualTo true) then { // this is actually needed as 3rd arg may not be bool if (!(_target turretLocal [0])) exitWith {}; _target setVariable [QGVAR(sightAttached), false, true]; _target animate ["optic_hide", 1]; diff --git a/addons/dragon/models/M47.p3d b/addons/dragon/models/M47.p3d deleted file mode 100644 index 9554efe7f8..0000000000 Binary files a/addons/dragon/models/M47.p3d and /dev/null differ diff --git a/addons/dragon/models/M47_loaded.p3d b/addons/dragon/models/M47_loaded.p3d deleted file mode 100644 index 7afe797185..0000000000 Binary files a/addons/dragon/models/M47_loaded.p3d and /dev/null differ diff --git a/addons/dragon/models/ace_m47_static.p3d b/addons/dragon/models/ace_m47_static.p3d index 3579797142..b14d66d5c7 100644 Binary files a/addons/dragon/models/ace_m47_static.p3d and b/addons/dragon/models/ace_m47_static.p3d differ diff --git a/addons/dragon/stringtable.xml b/addons/dragon/stringtable.xml index e9d3ff2eb6..e4713c0802 100644 --- a/addons/dragon/stringtable.xml +++ b/addons/dragon/stringtable.xml @@ -1,15 +1,12 @@ + + [CSW] M47 Super-Dragon + M47 Super-Dragon - - M47 Super-Dragon (No Sight) - - - M47 Super-Dragon (With Sight) - Attach Sight diff --git a/addons/realisticnames/stringtable.xml b/addons/realisticnames/stringtable.xml index 19358ae018..84a55ff177 100644 --- a/addons/realisticnames/stringtable.xml +++ b/addons/realisticnames/stringtable.xml @@ -11,7 +11,7 @@ XM312 XM312 XM312 - XM312A + XM312 XM312 XM312 XM312重機槍 diff --git a/addons/rearm/functions/fnc_addRearmActions.sqf b/addons/rearm/functions/fnc_addRearmActions.sqf index 79b976f322..cb54ca5c1e 100644 --- a/addons/rearm/functions/fnc_addRearmActions.sqf +++ b/addons/rearm/functions/fnc_addRearmActions.sqf @@ -5,38 +5,44 @@ * * Arguments: * 0: Ammo Truck + * 1: Player * * Return Value: * ChildActions * * Example: - * [tank] call ace_rearm_fnc_addRearmActions + * [tank, player] call ace_rearm_fnc_addRearmActions * * Public: No */ -params ["_truck"]; +params ["_truck", "_player"]; private _vehicles = nearestObjects [_truck, ["AllVehicles"], 20]; _vehicles = _vehicles select {(_x != _truck) && {!(_x isKindOf "CAManBase")} && {!(_x getVariable [QGVAR(disabled), false])}}; -if (missionNamespace getVariable [QEGVAR(mk6mortar,useAmmoHandling), false]) then { - _vehicles = _vehicles select {!(_x isKindOf "Mortar_01_base_F")}; -}; - +private _cswCarryMagazines = []; private _vehicleActions = []; { private _vehicle = _x; - + // Array of magazines that can be rearmed in the vehicle private _needRearmMags = ([_vehicle] call FUNC(getNeedRearmMagazines)) apply {_x select 0}; - + // _needRearmMags without duplicates private _magazineHelper = _needRearmMags arrayIntersect _needRearmMags; _magazineHelper = _magazineHelper select {[_truck, _x] call FUNC(hasEnoughSupply)}; + + if (["ace_csw"] call EFUNC(common,isModLoaded)) then { + ([_vehicle] call EFUNC(csw,aceRearmGetCarryMagazines)) params ["_turretMagsCSW", "_allCarryMags"]; + TRACE_3("csw compat",_vehicle,_turretMagsCSW,_allCarryMags); + _cswCarryMagazines append _allCarryMags; + _magazineHelper = _magazineHelper - _turretMagsCSW; + }; + TRACE_2("can add",_x,_magazineHelper); - + if (!(_magazineHelper isEqualTo [])) then { private _icon = getText(configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "Icon"); if !((_icon select [0, 1]) == "\") then { @@ -80,10 +86,29 @@ private _vehicleActions = []; {}, [] ] call EFUNC(interact_menu,createAction); - + _vehicleActions pushBack [_action, _actions, _truck]; }; }; } forEach _vehicles; +if (!(_cswCarryMagazines isEqualTo [])) then { + _cswCarryMagazines = _cswCarryMagazines arrayIntersect _cswCarryMagazines; + _cswCarryMagazines = _cswCarryMagazines select {[_truck, _x] call FUNC(hasEnoughSupply)}; + private _baseAction = [QGVAR(cswTake), "CSW", "", {}, {true}] call EFUNC(interact_menu,createAction); + private _subActions = _cswCarryMagazines apply { + private _action = [ + _x, + _x call FUNC(getMagazineName), + getText(configFile >> "CfgMagazines" >> _x >> "picture"), + {_this call FUNC(takeAmmo)}, + {true}, + {}, + [_x, _player] + ] call EFUNC(interact_menu,createAction); + [_action, [], _truck]; + }; + _vehicleActions pushBack [_baseAction, _subActions, _truck]; +}; + _vehicleActions diff --git a/addons/rearm/functions/fnc_getMagazineName.sqf b/addons/rearm/functions/fnc_getMagazineName.sqf index 1871cedbf7..f83d71e470 100644 --- a/addons/rearm/functions/fnc_getMagazineName.sqf +++ b/addons/rearm/functions/fnc_getMagazineName.sqf @@ -26,6 +26,8 @@ if (isNil "_magName") then { WARNING_1("Magazine is missing display name [%1]",_className); }; + if ((_displayName select [0,6]) == "[CSW] ") then { _displayName = _displayName select [6]; }; + GVAR(magazineNameCache) setVariable [_className, _displayName]; GVAR(originalMagazineNames) pushBack _displayName; TRACE_2("Adding to cache",_className,_displayName); diff --git a/addons/rearm/functions/fnc_getNeedRearmMagazines.sqf b/addons/rearm/functions/fnc_getNeedRearmMagazines.sqf index e2a06075d5..9dbcf463eb 100644 --- a/addons/rearm/functions/fnc_getNeedRearmMagazines.sqf +++ b/addons/rearm/functions/fnc_getNeedRearmMagazines.sqf @@ -33,19 +33,19 @@ private _magazineInfo = []; private _pylonConfigs = configProperties [configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "Components" >> "TransportPylonsComponent" >> "Pylons", "isClass _x"]; { private _pylonConfig = _x; - + // Strangely, a 1-based index. private _pylonIndex = _forEachIndex + 1; - + // Retrieving pylon magazine by index. If the pylon is empty, it is marked with "". private _pylonMagazine = (getPylonMagazines _vehicle) select (_pylonIndex - 1); - + // Only care about pylons that have a magazine. if (!(_pylonMagazine isEqualTo "")) then { - + private _maxRounds = getNumber (configFile >> "CfgMagazines" >> _pylonMagazine >> "count"); private _currentRounds = _vehicle ammoOnPylon _pylonIndex; - + if (_currentRounds < _maxRounds) then { // getPylonTurret expects 0 based index, and returns driver turret as [-1] private _pylonTurret = [_vehicle, (_pylonIndex - 1)] call EFUNC(common,getPylonTurret); @@ -62,13 +62,13 @@ private _turrets = [_vehicle] call FUNC(getAllRearmTurrets); // _magazines without duplicates private _magazineClasses = _magazines arrayIntersect _magazines; - + { private _magazineClass = _x; - + private _maxMagazines = [_vehicle, _turretPath, _magazineClass] call FUNC(getMaxMagazines); private _maxRoundsPerMag = getNumber (configFile >> "CfgMagazines" >> _magazineClass >> "count"); - + /* Array of ammo counts in every magazine. Example: [200, 200, 152] means 2 mags with 200 * rounds and 1 mag with 152 rounds. */ private _currentRounds = [_vehicle, _turretPath, _magazineClass] call FUNC(getTurretMagazineAmmo); @@ -77,9 +77,10 @@ private _turrets = [_vehicle] call FUNC(getAllRearmTurrets); /* If there is space for new magazines or if some magazines are not full, add the magazine * type to _magazineInfo. */ if ((_currentMagazines < _maxMagazines) || {({_x < _maxRoundsPerMag} count _currentRounds) > 0}) then { + if (_magazineClass == "FakeWeapon") exitWith {}; _magazineInfo pushBack [_magazineClass, _turretPath, false, -1, _maxMagazines, _currentMagazines, _maxRoundsPerMag, _currentRounds]; }; - + } forEach _magazineClasses; } forEach _turrets; diff --git a/addons/rearm/functions/fnc_rearmEntireVehicleSuccessLocal.sqf b/addons/rearm/functions/fnc_rearmEntireVehicleSuccessLocal.sqf index 6d48cd338f..8bf8244dd7 100644 --- a/addons/rearm/functions/fnc_rearmEntireVehicleSuccessLocal.sqf +++ b/addons/rearm/functions/fnc_rearmEntireVehicleSuccessLocal.sqf @@ -22,6 +22,14 @@ TRACE_3("rearmEntireVehicleSuccessLocal",_truck,_vehicle,_turretPath); // Fetching all rearmable magazines in this turret private _magazines = ([_vehicle] call FUNC(getNeedRearmMagazines)) select {(_x select 1) isEqualTo _turretPath}; +if (["ace_csw"] call EFUNC(common,isModLoaded)) then { + ([_vehicle, _turretPath] call EFUNC(csw,aceRearmGetCarryMagazines)) params ["_turretMagsCSW", "_allCarryMags"]; + TRACE_1("skipping",_turretMagsCSW); + _magazines = _magazines select { + _x params ["_magazineClass"]; + (_turretMagsCSW findIf {_x == _magazineClass}) == -1 + }; +}; { _x params ["_magazineClass", "_magTurretPath", "_isPylonMag", "_pylonIndex", "_maxMagazines", "_currentMagazines", "_maxRoundsPerMag", "_currentRounds"]; diff --git a/addons/rearm/functions/fnc_takeAmmo.sqf b/addons/rearm/functions/fnc_takeAmmo.sqf index f4a7339edc..1c1e325de8 100644 --- a/addons/rearm/functions/fnc_takeAmmo.sqf +++ b/addons/rearm/functions/fnc_takeAmmo.sqf @@ -8,7 +8,7 @@ * 1: Unit * 2: Params * 0: Magazine Classname - * 1: Vehicle to be armed + * 1: Vehicle to be armed or player * * Return Value: * None @@ -27,12 +27,18 @@ TRACE_5("takeAmmo",_truck,_unit,_args,_magazineClass,_vehicle); REARM_HOLSTER_WEAPON; +private _targetName = if (_vehicle == _unit) then { + "CSW" +} else { + getText(configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "displayName") +}; + [ TIME_PROGRESSBAR(REARM_DURATION_TAKE select _idx), - [_unit, _magazineClass, _truck], + [_unit, _magazineClass, _truck, _vehicle], FUNC(takeSuccess), "", - format [localize LSTRING(TakeAction), _magazineClass call FUNC(getMagazineName), getText(configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "displayName")], + format [localize LSTRING(TakeAction), _magazineClass call FUNC(getMagazineName), _targetName], {true}, ["isnotinside"] ] call EFUNC(common,progressBar); diff --git a/addons/rearm/functions/fnc_takeSuccess.sqf b/addons/rearm/functions/fnc_takeSuccess.sqf index 3986b21484..e00d430f99 100644 --- a/addons/rearm/functions/fnc_takeSuccess.sqf +++ b/addons/rearm/functions/fnc_takeSuccess.sqf @@ -8,19 +8,20 @@ * 0: Unit * 1: Magazine Classname * 2: Ammo Truck + * 3: Target Vehicle or Player * * Return Value: * None * * Example: - * [[player, "500Rnd_127x99_mag_Tracer_Red"]] call ace_rearm_fnc_takeSuccess + * [[player, "500Rnd_127x99_mag_Tracer_Red", ammoTruck, targetVehicle]] call ace_rearm_fnc_takeSuccess * * Public: No */ params ["_args"]; -_args params ["_unit", "_magazineClass", "_truck"]; -TRACE_3("takeSuccess",_unit,_magazineClass,_truck); +_args params ["_unit", "_magazineClass", "_truck", "_vehicle"]; +TRACE_4("takeSuccess",_unit,_magazineClass,_truck,_vehicle); private _success = true; if (GVAR(supply) > 0) then { @@ -28,6 +29,13 @@ if (GVAR(supply) > 0) then { }; if !(_success) exitWith {WARNING_2("takeSuccess failed to take [%1] from [%2]",_magazineClass,_truck);}; +if (_vehicle == _unit) exitWith { + ([_magazineClass] call FUNC(getCaliber)) params ["", "_idx"]; + private _rounds = (REARM_COUNT select _idx); + TRACE_4("passing to csw",_unit,_magazineClass,_idx,_rounds); + [_unit, _magazineClass, _rounds] call EFUNC(csw,reload_handleReturnAmmo); +}; + [_unit, "forceWalk", "ACE_rearm", true] call EFUNC(common,statusEffect_set); [_unit, "blockThrow", "ACE_rearm", true] call EFUNC(common,statusEffect_set); private _dummy = [_unit, _magazineClass] call FUNC(createDummy); diff --git a/optionals/compat_rhs_afrf3/CfgVehicles.hpp b/optionals/compat_rhs_afrf3/CfgVehicles.hpp index fcf87a3d1e..b614807536 100644 --- a/optionals/compat_rhs_afrf3/CfgVehicles.hpp +++ b/optionals/compat_rhs_afrf3/CfgVehicles.hpp @@ -233,6 +233,7 @@ class CfgVehicles { position = ""; }; }; + // ENABLE_CSW_ATTRIBUTE; class ACE_CSW { enabled = 1; proxyWeapon = QGVAR(rhs_weap_SPG9); @@ -251,6 +252,7 @@ class CfgVehicles { selection = "tripod"; }; }; + // ENABLE_CSW_ATTRIBUTE; class ACE_CSW { enabled = 1; proxyWeapon = QGVAR(rhs_weap_9K133_launcher); @@ -276,6 +278,7 @@ class CfgVehicles { selection = ""; // no good selections for this mortar }; }; + // ENABLE_CSW_ATTRIBUTE; class ACE_CSW { enabled = 1; magazineLocation = ""; @@ -321,6 +324,7 @@ class CfgVehicles { class StaticGrenadeLauncher: StaticWeapon {}; class RHS_AGS30_TriPod_base: StaticGrenadeLauncher { + // ENABLE_CSW_ATTRIBUTE; class ACE_CSW { enabled = 1; proxyWeapon = QGVAR(rhs_weap_AGS30); @@ -341,6 +345,7 @@ class CfgVehicles { }; class rhs_Metis_Base: AT_01_base_F { + // ENABLE_CSW_ATTRIBUTE; class ACE_CSW { enabled = 1; proxyWeapon = QGVAR(rhs_weap_9K115_2_launcher); diff --git a/optionals/compat_rhs_afrf3/CfgWeapons.hpp b/optionals/compat_rhs_afrf3/CfgWeapons.hpp index 6b69518108..b654aa0f66 100644 --- a/optionals/compat_rhs_afrf3/CfgWeapons.hpp +++ b/optionals/compat_rhs_afrf3/CfgWeapons.hpp @@ -1,14 +1,12 @@ -#define CREATE_CSW_PROXY(weapon) class ##weapon; class GVAR(weapon): ##weapon { magazineReloadTime = 0.5; } - class CfgWeapons { - + class NVGoggles; class rhs_1PN138: NVGoggles { // Monocular modelOptics = ""; EGVAR(nightvision,border) = QPATHTOEF(nightvision,data\nvg_mask_4096.paa); EGVAR(nightvision,bluRadius) = 0.13; }; - + class hgun_Rook40_F; class rhs_weap_pya: hgun_Rook40_F { ACE_barrelTwist = 254.0; @@ -145,7 +143,7 @@ class CfgWeapons { ace_overpressure_range = 15; ace_overpressure_damage = 0.5; }; - + CREATE_CSW_PROXY(rhs_weap_2b14); CREATE_CSW_PROXY(rhs_weap_nsvt_effects); CREATE_CSW_PROXY(rhs_weap_KORD); @@ -153,7 +151,7 @@ class CfgWeapons { CREATE_CSW_PROXY(rhs_weap_SPG9); CREATE_CSW_PROXY(rhs_weap_9K133_launcher); CREATE_CSW_PROXY(rhs_weap_9K115_2_launcher); - + class GVAR(2b14_carry): Launcher_Base_F { class ACE_CSW { type = "weapon"; @@ -166,14 +164,14 @@ class CfgWeapons { class WeaponSlotsInfo: WeaponSlotsInfo { mass = 670; // 2B14 Mortar Weight }; - displayName = CSTRING(2b14_tube); + displayName = ECSTRING(CSW,2b14_tube); author = ECSTRING(common,ACETeam); scope = 2; model = QPATHTOEF(apl,ACE_CSW_Bag.p3d); modes[] = {}; picture = "\rhsafrf\addons\rhs_heavyweapons\data\ico\podnos_2b14_ca.paa"; }; - + class GVAR(nsv_carry): Launcher_Base_F { class ACE_CSW { type = "weapon"; @@ -186,14 +184,14 @@ class CfgWeapons { class WeaponSlotsInfo: WeaponSlotsInfo { mass = 550; }; - displayName = CSTRING(nsv_gun); + displayName = ECSTRING(CSW,nsv_gun); author = ECSTRING(common,ACETeam); scope = 2; model = QPATHTOEF(apl,ACE_CSW_Bag.p3d); modes[] = {}; picture = "\rhsafrf\addons\rhs_heavyweapons\mg\bis_kord\kord_CA.paa"; }; - + class GVAR(kord_carry): Launcher_Base_F { class ACE_CSW { type = "weapon"; @@ -207,14 +205,14 @@ class CfgWeapons { class WeaponSlotsInfo: WeaponSlotsInfo { mass = 550; }; - displayName = CSTRING(kord_gun); + displayName = ECSTRING(CSW,kord_gun); author = ECSTRING(common,ACETeam); scope = 2; model = QPATHTOEF(apl,ACE_CSW_Bag.p3d); modes[] = {}; picture = "\rhsafrf\addons\rhs_heavyweapons\data\ico\kord6u16sp_ca.paa"; }; - + class GVAR(ags30_carry): Launcher_Base_F { class ACE_CSW { type = "weapon"; @@ -227,14 +225,14 @@ class CfgWeapons { class WeaponSlotsInfo: WeaponSlotsInfo { mass = 400; // https://odin.tradoc.army.mil/mediawiki/index.php/AGS-17_Russian_30mm_Automatic_Grenade_Launcher }; - displayName = CSTRING(ags30_gun); + displayName = ECSTRING(CSW,ags30_gun); author = ECSTRING(common,ACETeam); scope = 2; model = QPATHTOEF(apl,ACE_CSW_Bag.p3d); modes[] = {}; picture = "\rhsafrf\addons\rhs_heavyweapons\data\ico\ags_static_CA.paa"; }; - + class GVAR(spg9_carry): Launcher_Base_F { class ACE_CSW { type = "weapon"; @@ -247,7 +245,7 @@ class CfgWeapons { class WeaponSlotsInfo: WeaponSlotsInfo { mass = 1000; }; - displayName = CSTRING(spg9_tube); + displayName = ECSTRING(csw,spg9_tube); author = ECSTRING(common,ACETeam); scope = 2; model = QPATHTOEF(apl,ACE_CSW_Bag.p3d); @@ -260,9 +258,9 @@ class CfgWeapons { EGVAR(csw,spg9Tripod) = "rhs_SPG9M_MSV"; }; }; - displayName = CSTRING(spg9m_tube); + displayName = ECSTRING(csw,spg9m_tube); }; - + class GVAR(metis_carry): Launcher_Base_F { class ACE_CSW { type = "mount"; @@ -273,14 +271,14 @@ class CfgWeapons { class WeaponSlotsInfo: WeaponSlotsInfo { mass = 300; }; - displayName = CSTRING(metis_tube); + displayName = ECSTRING(csw,metis_tube); author = ECSTRING(common,ACETeam); scope = 2; model = QPATHTOEF(apl,ACE_CSW_Bag.p3d); modes[] = {}; picture = "\rhsafrf\addons\rhs_heavyweapons\data\ico\metis_at13_CA.paa"; }; - + class GVAR(kornet_carry): Launcher_Base_F { class ACE_CSW { type = "mount"; @@ -291,7 +289,7 @@ class CfgWeapons { class WeaponSlotsInfo: WeaponSlotsInfo { mass = 600; }; - displayName = CSTRING(kornet_launcher); + displayName = ECSTRING(csw,kornet_launcher); author = ECSTRING(common,ACETeam); scope = 2; model = QPATHTOEF(apl,ACE_CSW_Bag.p3d); diff --git a/optionals/compat_rhs_afrf3/config.cpp b/optionals/compat_rhs_afrf3/config.cpp index 41e559c6e8..1e253eb125 100644 --- a/optionals/compat_rhs_afrf3/config.cpp +++ b/optionals/compat_rhs_afrf3/config.cpp @@ -1,4 +1,5 @@ #include "script_component.hpp" +#include "\z\ace\addons\csw\script_config_macros_csw.hpp" class CfgPatches { class ADDON { diff --git a/optionals/compat_rhs_afrf3/stringtable.xml b/optionals/compat_rhs_afrf3/stringtable.xml deleted file mode 100644 index d54efa1c02..0000000000 --- a/optionals/compat_rhs_afrf3/stringtable.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - 2B14 Tube Bag - - - NSV Gun Bag - - - KORD Gun Bag - - - AGS-30 Gun Bag - - - SPG-9 Launcher Bag - - - SPG-9M Launcher - - - 9k115 Metis Launcher Bag - - - 9m113 Kornet Launcher - - - diff --git a/optionals/compat_rhs_gref3/CfgVehicles.hpp b/optionals/compat_rhs_gref3/CfgVehicles.hpp index 4afca8c955..94beb20e53 100644 --- a/optionals/compat_rhs_gref3/CfgVehicles.hpp +++ b/optionals/compat_rhs_gref3/CfgVehicles.hpp @@ -4,9 +4,10 @@ class CfgVehicles { // Canoes are propelled by paddlers EGVAR(refuel,canReceive) = 0; }; - + class StaticMGWeapon; class rhs_DSHKM_base: StaticMGWeapon { + // ENABLE_CSW_ATTRIBUTE; class ACE_CSW { enabled = 1; proxyWeapon = QGVAR(rhs_weap_DSHKM); diff --git a/optionals/compat_rhs_gref3/CfgWeapons.hpp b/optionals/compat_rhs_gref3/CfgWeapons.hpp index 390341610b..18681cae13 100644 --- a/optionals/compat_rhs_gref3/CfgWeapons.hpp +++ b/optionals/compat_rhs_gref3/CfgWeapons.hpp @@ -1,5 +1,3 @@ -#define CREATE_CSW_PROXY(weapon) class ##weapon; class GVAR(weapon): ##weapon { magazineReloadTime = 0.5; } - class CfgWeapons { class rhs_weap_kar98k_Base_F; class rhs_weap_kar98k: rhs_weap_kar98k_Base_F { @@ -82,9 +80,9 @@ class CfgWeapons { class rhs_weap_mg42_base: Rifle_Base_F { ACE_Overheating_allowSwapBarrel = 1; }; - + CREATE_CSW_PROXY(rhs_weap_DSHKM); - + class Launcher; class Launcher_Base_F: Launcher { class WeaponSlotsInfo; @@ -102,7 +100,7 @@ class CfgWeapons { class WeaponSlotsInfo: WeaponSlotsInfo { mass = 740; }; - displayName = CSTRING(dshk_gun); + displayName = ECSTRING(csw,dshk_gun); author = ECSTRING(common,ACETeam); scope = 2; model = QPATHTOEF(apl,ACE_CSW_Bag.p3d); diff --git a/optionals/compat_rhs_gref3/config.cpp b/optionals/compat_rhs_gref3/config.cpp index b534a69459..b5aae10911 100644 --- a/optionals/compat_rhs_gref3/config.cpp +++ b/optionals/compat_rhs_gref3/config.cpp @@ -1,4 +1,5 @@ #include "script_component.hpp" +#include "\z\ace\addons\csw\script_config_macros_csw.hpp" class CfgPatches { class ADDON { diff --git a/optionals/compat_rhs_gref3/stringtable.xml b/optionals/compat_rhs_gref3/stringtable.xml deleted file mode 100644 index 42f5066b4b..0000000000 --- a/optionals/compat_rhs_gref3/stringtable.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - DSHK Gun Bag - - - diff --git a/optionals/compat_rhs_usf3/CfgVehicles.hpp b/optionals/compat_rhs_usf3/CfgVehicles.hpp index 1e47e83426..503dc9c79b 100644 --- a/optionals/compat_rhs_usf3/CfgVehicles.hpp +++ b/optionals/compat_rhs_usf3/CfgVehicles.hpp @@ -300,6 +300,7 @@ class CfgVehicles { selection = "main_gun"; }; }; + // ENABLE_CSW_ATTRIBUTE; class ACE_CSW { enabled = 1; magazineLocation = ""; @@ -311,10 +312,11 @@ class CfgVehicles { ammoUnloadTime = 3; }; }; - + class StaticMGWeapon: StaticWeapon {}; - + class rhs_m2staticmg_base: StaticMGWeapon { + // ENABLE_CSW_ATTRIBUTE; class ACE_CSW { enabled = 1; proxyWeapon = QGVAR(rhs_M2); @@ -326,16 +328,17 @@ class CfgVehicles { ammoUnloadTime = 8; }; }; - + class RHS_M2StaticMG_MiniTripod_base: rhs_m2staticmg_base { class ACE_CSW: ACE_CSW { enabled = 1; disassembleTurret = QEGVAR(csw,m3TripodLow); }; }; - + class StaticGrenadeLauncher: StaticWeapon {}; class RHS_MK19_TriPod_base: StaticGrenadeLauncher { + // ENABLE_CSW_ATTRIBUTE; class ACE_CSW { enabled = 1; proxyWeapon = QGVAR(rhs_MK19); @@ -347,9 +350,10 @@ class CfgVehicles { ammoUnloadTime = 8; }; }; - + class StaticATWeapon: StaticWeapon {}; class RHS_TOW_TriPod_base: StaticATWeapon { + // ENABLE_CSW_ATTRIBUTE; class ACE_CSW { enabled = 1; proxyWeapon = QGVAR(rhs_weap_TOW_Launcher_static); diff --git a/optionals/compat_rhs_usf3/CfgWeapons.hpp b/optionals/compat_rhs_usf3/CfgWeapons.hpp index f5c9a86ea8..5c48a166f7 100644 --- a/optionals/compat_rhs_usf3/CfgWeapons.hpp +++ b/optionals/compat_rhs_usf3/CfgWeapons.hpp @@ -1,5 +1,3 @@ -#define CREATE_CSW_PROXY(weapon) class ##weapon; class GVAR(weapon): ##weapon { magazineReloadTime = 0.5; } - class CfgWeapons { class NVGoggles; class rhsusf_ANPVS_14: NVGoggles { // Monocular @@ -424,12 +422,12 @@ class CfgWeapons { class RHS_jetpilot_usaf: H_HelmetB { HEARING_PROTECTION_VICCREW }; - + CREATE_CSW_PROXY(rhs_mortar_81mm); CREATE_CSW_PROXY(RHS_M2); CREATE_CSW_PROXY(RHS_MK19); CREATE_CSW_PROXY(Rhs_weap_TOW_Launcher_static); - + class GVAR(m252_carry): Launcher_Base_F { class ACE_CSW { type = "weapon"; @@ -442,7 +440,7 @@ class CfgWeapons { class WeaponSlotsInfo: WeaponSlotsInfo { mass = 620; // M252 Mortar Weight }; - displayName = CSTRING(m252_tube); + displayName = ECSTRING(CSW,m252_tube); author = ECSTRING(common,ACETeam); scope = 2; model = QPATHTOEF(apl,ACE_CSW_Bag.p3d); @@ -463,7 +461,7 @@ class CfgWeapons { class WeaponSlotsInfo: WeaponSlotsInfo { mass = 840; }; - displayName = CSTRING(m2_gun); + displayName = ECSTRING(CSW,m2_gun); author = ECSTRING(common,ACETeam); scope = 2; model = QPATHTOEF(apl,ACE_CSW_Bag.p3d); @@ -483,14 +481,14 @@ class CfgWeapons { class WeaponSlotsInfo: WeaponSlotsInfo { mass = 770; }; - displayName = CSTRING(mk19_gun); + displayName = ECSTRING(CSW,mk19_gun); author = ECSTRING(common,ACETeam); scope = 2; model = QPATHTOEF(apl,ACE_CSW_Bag.p3d); modes[] = {}; picture = "\rhsusf\addons\rhsusf_heavyweapons\data\ico\mk19_stat_CA.paa"; }; - + class GVAR(tow_carry): Launcher_Base_F { class ACE_CSW { type = "weapon"; @@ -503,7 +501,7 @@ class CfgWeapons { class WeaponSlotsInfo: WeaponSlotsInfo { mass = 500; }; - displayName = CSTRING(tow_tube); + displayName = ECSTRING(CSW,tow_tube); author = ECSTRING(common,ACETeam); scope = 2; model = QPATHTOEF(apl,ACE_CSW_Bag.p3d); diff --git a/optionals/compat_rhs_usf3/config.cpp b/optionals/compat_rhs_usf3/config.cpp index e23ea277af..26441eff35 100644 --- a/optionals/compat_rhs_usf3/config.cpp +++ b/optionals/compat_rhs_usf3/config.cpp @@ -1,4 +1,5 @@ #include "script_component.hpp" +#include "\z\ace\addons\csw\script_config_macros_csw.hpp" class CfgPatches { class ADDON { diff --git a/optionals/compat_rhs_usf3/stringtable.xml b/optionals/compat_rhs_usf3/stringtable.xml deleted file mode 100644 index efbac54854..0000000000 --- a/optionals/compat_rhs_usf3/stringtable.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - M252 Tube Bag - - - M2 Gun Bag - - - MK19 Gun Bag - - - BGM-71 TOW Launcher Bag - - -