First try at some module control

This commit is contained in:
VKing 2015-12-17 11:00:46 +01:00
parent a0fdc58ed7
commit 27890a8dab
7 changed files with 29 additions and 15 deletions

View File

@ -15,4 +15,9 @@ class ACE_Settings {
typeName = "BOOL"; typeName = "BOOL";
isClientSetable = 0; isClientSetable = 0;
}; };
class GVAR(useAmmoHandling) {
value = 0;
typeName = "BOOL";
isClientSetable = 0;
};
}; };

View File

@ -20,15 +20,12 @@ class CfgVehicles {
class Turrets { class Turrets {
class MainTurret; class MainTurret;
}; };
class ACE_Actions;
}; };
class StaticMortar: StaticWeapon { class StaticMortar: StaticWeapon {
class Turrets: Turrets { class Turrets: Turrets {
class MainTurret: MainTurret {}; class MainTurret: MainTurret {};
}; };
class ACE_Actions: ACE_Actions { class ACE_Actions;
class ACE_MainActions;
};
}; };
class Mortar_01_base_F: StaticMortar { class Mortar_01_base_F: StaticMortar {
class Turrets: Turrets { class Turrets: Turrets {
@ -41,7 +38,7 @@ class CfgVehicles {
class ACE_Actions: ACE_Actions { class ACE_Actions: ACE_Actions {
class GVAR(unloadMagazine) { class GVAR(unloadMagazine) {
displayName = CSTRING(unloadMortar); displayName = CSTRING(unloadMortar);
distance = 4; distance = 2;
condition = QUOTE(_this call FUNC(canUnloadMagazine)); condition = QUOTE(_this call FUNC(canUnloadMagazine));
statement = QUOTE([ARR_3(_target,_player,5)] call FUNC(unloadMagazineTimer)); statement = QUOTE([ARR_3(_target,_player,5)] call FUNC(unloadMagazineTimer));
icon = ""; icon = "";
@ -49,42 +46,42 @@ class CfgVehicles {
}; };
class GVAR(LoadActions) { class GVAR(LoadActions) {
displayName = CSTRING(loadMortar); displayName = CSTRING(loadMortar);
distance = 4; distance = 2;
condition = QUOTE([ARR_2(_target,_player)] call FUNC(canLoadMagazine)); condition = QUOTE([ARR_2(_target,_player)] call FUNC(canLoadMagazine));
statement = ""; statement = "";
icon = ""; icon = "";
selection = "usti hlavne"; selection = "usti hlavne";
class GVAR(loadMagazine_HE_Guided) { class GVAR(loadMagazine_HE_Guided) {
displayName = CSTRING(loadMagazine_HE_Guided); displayName = CSTRING(loadMagazine_HE_Guided);
distance = 4; distance = 2;
condition = QUOTE([ARR_3(_target,_player,'ACE_1Rnd_82mm_Mo_HE_Guided')] call FUNC(canLoadMagazine)); condition = QUOTE([ARR_3(_target,_player,'ACE_1Rnd_82mm_Mo_HE_Guided')] call FUNC(canLoadMagazine));
statement = QUOTE([ARR_4(_target,_player,5,'ACE_1Rnd_82mm_Mo_HE_Guided')] call FUNC(loadMagazineTimer)); statement = QUOTE([ARR_4(_target,_player,5,'ACE_1Rnd_82mm_Mo_HE_Guided')] call FUNC(loadMagazineTimer));
icon = ""; icon = "";
}; };
class GVAR(loadMagazine_HE_LaserGuided) { class GVAR(loadMagazine_HE_LaserGuided) {
displayName = CSTRING(loadMagazine_HE_LaserGuided); displayName = CSTRING(loadMagazine_HE_LaserGuided);
distance = 4; distance = 2;
condition = QUOTE([ARR_3(_target,_player,'ACE_1Rnd_82mm_Mo_HE_LaserGuided')] call FUNC(canLoadMagazine)); condition = QUOTE([ARR_3(_target,_player,'ACE_1Rnd_82mm_Mo_HE_LaserGuided')] call FUNC(canLoadMagazine));
statement = QUOTE([ARR_4(_target,_player,5,'ACE_1Rnd_82mm_Mo_HE_LaserGuided')] call FUNC(loadMagazineTimer)); statement = QUOTE([ARR_4(_target,_player,5,'ACE_1Rnd_82mm_Mo_HE_LaserGuided')] call FUNC(loadMagazineTimer));
icon = ""; icon = "";
}; };
class GVAR(loadMagazine_Illum) { class GVAR(loadMagazine_Illum) {
displayName = CSTRING(loadMagazine_Illum); displayName = CSTRING(loadMagazine_Illum);
distance = 4; distance = 2;
condition = QUOTE([ARR_3(_target,_player,'ACE_1Rnd_82mm_Mo_Illum')] call FUNC(canLoadMagazine)); condition = QUOTE([ARR_3(_target,_player,'ACE_1Rnd_82mm_Mo_Illum')] call FUNC(canLoadMagazine));
statement = QUOTE([ARR_4(_target,_player,5,'ACE_1Rnd_82mm_Mo_Illum')] call FUNC(loadMagazineTimer)); statement = QUOTE([ARR_4(_target,_player,5,'ACE_1Rnd_82mm_Mo_Illum')] call FUNC(loadMagazineTimer));
icon = ""; icon = "";
}; };
class GVAR(loadMagazine_Smoke) { class GVAR(loadMagazine_Smoke) {
displayName = CSTRING(loadMagazine_Smoke); displayName = CSTRING(loadMagazine_Smoke);
distance = 4; distance = 2;
condition = QUOTE([ARR_3(_target,_player,'ACE_1Rnd_82mm_Mo_Smoke')] call FUNC(canLoadMagazine)); condition = QUOTE([ARR_3(_target,_player,'ACE_1Rnd_82mm_Mo_Smoke')] call FUNC(canLoadMagazine));
statement = QUOTE([ARR_4(_target,_player,3,'ACE_1Rnd_82mm_Mo_Smoke')] call FUNC(loadMagazineTimer)); statement = QUOTE([ARR_4(_target,_player,3,'ACE_1Rnd_82mm_Mo_Smoke')] call FUNC(loadMagazineTimer));
icon = ""; icon = "";
}; };
class GVAR(loadMagazine_HE) { class GVAR(loadMagazine_HE) {
displayName = CSTRING(loadMagazine_HE); displayName = CSTRING(loadMagazine_HE);
distance = 4; distance = 2;
condition = QUOTE([ARR_3(_target,_player,'ACE_1Rnd_82mm_Mo_HE')] call FUNC(canLoadMagazine)); condition = QUOTE([ARR_3(_target,_player,'ACE_1Rnd_82mm_Mo_HE')] call FUNC(canLoadMagazine));
statement = QUOTE([ARR_4(_target,_player,3,'ACE_1Rnd_82mm_Mo_HE')] call FUNC(loadMagazineTimer)); statement = QUOTE([ARR_4(_target,_player,3,'ACE_1Rnd_82mm_Mo_HE')] call FUNC(loadMagazineTimer));
icon = ""; icon = "";
@ -131,6 +128,12 @@ class CfgVehicles {
typeName = "BOOL"; typeName = "BOOL";
defaultValue = 1; defaultValue = 1;
}; };
class useAmmoHandling {
displayName = CSTRING(useAmmoHandling_DisplayName);
description = CSTRING(useAmmoHandling_Description);
typeName = "BOOL";
defaultValue = 0;
};
}; };
class ModuleDescription { class ModuleDescription {
description = CSTRING(Module_Description); description = CSTRING(Module_Description);

View File

@ -22,7 +22,7 @@ params ["_static","_unit",["_magazineClassOptional","",[""]]];
private ["_canLoadMagazine","_currentMagazine","_weapon","_listOfMagNames", private ["_canLoadMagazine","_currentMagazine","_weapon","_listOfMagNames",
"_hasCompatibleMagazine","_count"]; "_hasCompatibleMagazine","_count"];
if !(alive _static) exitWith {false}; if !(alive _static && {GVAR(useAmmoHandling)}) exitWith {false};
_canLoadMagazine = false; _canLoadMagazine = false;

View File

@ -19,7 +19,7 @@
params ["_static","_unit"]; params ["_static","_unit"];
private ["_canUnloadMagazine","_ammoCount"]; private ["_canUnloadMagazine","_ammoCount"];
if !(alive _static) exitWith {false}; if !(alive _static && {GVAR(useAmmoHandling)}) exitWith {false};
_canUnloadMagazine = false; _canUnloadMagazine = false;
_ammoCount = ((magazinesAllTurrets _static) select 1) select 2; _ammoCount = ((magazinesAllTurrets _static) select 1) select 2;

View File

@ -19,7 +19,7 @@
params ["_static","_unit",["_magazineClassOptional","",[""]]]; params ["_static","_unit",["_magazineClassOptional","",[""]]];
private ["_weapon","_currentMagazine","_count","_magazines","_magazineDetails","_listOfMagNames", private ["_weapon","_currentMagazine","_count","_magazines","_magazineDetails","_listOfMagNames",
"_magazineClass","_magazineClassDetails","_parsed","_roundsLeft","_configMortar"]; "_magazineClass","_magazineClassDetails","_parsed","_roundsLeft"];
//Get weapon & magazine information of static weapon //Get weapon & magazine information of static weapon
_weapon = (_static weaponsTurret [0]) select 0; _weapon = (_static weaponsTurret [0]) select 0;
@ -54,7 +54,6 @@ if (_magazineClassDetails != "") then{
_magType = _type; _magType = _type;
}; };
//_configMortar = getNumber (configFile >> "CfgMagazines" >> _magazineClass >> QGVAR(isMortarRound));
//If function has been called with an optional classname hten add that magazine to the static weapon. Otherwise add the compatible magazine //If function has been called with an optional classname hten add that magazine to the static weapon. Otherwise add the compatible magazine
if(_magazineClassOptional !="") then{ if(_magazineClassOptional !="") then{
_unit removeMagazine _magazineClassOptional; _unit removeMagazine _magazineClassOptional;

View File

@ -25,3 +25,4 @@ if (!isServer) exitWith {};
[_logic, QGVAR(airResistanceEnabled), "airResistanceEnabled"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(airResistanceEnabled), "airResistanceEnabled"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(allowComputerRangefinder), "allowComputerRangefinder"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(allowComputerRangefinder), "allowComputerRangefinder"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(allowCompass), "allowCompass"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(allowCompass), "allowCompass"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(useAmmoHandling), "useAmmoHandling"] call EFUNC(common,readSettingFromModule);

View File

@ -192,5 +192,11 @@
<Key ID="STR_ACE_Mk6Mortar_magazine_HE_LaserGuided_descriptionShort"> <Key ID="STR_ACE_Mk6Mortar_magazine_HE_LaserGuided_descriptionShort">
<English>Used in Mk6 mortar</English> <English>Used in Mk6 mortar</English>
</Key> </Key>
<Key ID="STR_ACE_Mk6Mortar_useAmmoHandling_DisplayName">
<English>Ammunition handling</English>
</Key>
<Key ID="STR_ACE_Mk6Mortar_useAmmoHandling_Description">
<English>Removes mortar magazines, requiring individual rounds to be loaded by the gunner or loader</English>
</Key>
</Package> </Package>
</Project> </Project>