Completed code porting and interaction

This commit is contained in:
VKing 2015-12-16 23:47:14 +01:00
parent 3e6fc52733
commit e0a21ce144
10 changed files with 107 additions and 43 deletions

View File

@ -40,53 +40,53 @@ class CfgVehicles {
};
class ACE_Actions: ACE_Actions {
class GVAR(unloadMagazine) {
displayName = CSTRING(unloadMagazine);
displayName = CSTRING(unloadMortar);
distance = 4;
condition = QUOTE([ARR_2(_player,_target)] call FUNC(canUnloadMagazine));
statement = QUOTE([ARR_2(_player,_target)] call FUNC(unloadMagazine));
condition = QUOTE(_this call FUNC(canUnloadMagazine));
statement = QUOTE([ARR_3(_target,_player,5)] call FUNC(unloadMagazineTimer));
icon = "";
selection = "usti hlavne";
};
class GVAR(LoadActions) {
displayName = CSTRING(loadMortar);
distance = 4;
condition = QUOTE([ARR_2(_player,_target)] call FUNC(canLoadMagazine));
condition = QUOTE([ARR_2(_target,_player)] call FUNC(canLoadMagazine));
statement = "";
icon = "";
selection = "usti hlavne";
class GVAR(loadMagazine_HE_Guided) {
displayName = CSTRING(loadMagazine_HE_Guided);
distance = 4;
condition = QUOTE([ARR_3(_player,_target,'ACE_1Rnd_82mm_Mo_HE_Guided')] call FUNC(canLoadMagazine));
statement = QUOTE([ARR_3(_player,_target,'ACE_1Rnd_82mm_Mo_HE_Guided')] call FUNC(loadMagazine));
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));
icon = "";
};
class GVAR(loadMagazine_HE_LaserGuided) {
displayName = CSTRING(loadMagazine_HE_LaserGuided);
distance = 4;
condition = QUOTE([ARR_3(_player,_target,'ACE_1Rnd_82mm_Mo_HE_LaserGuided')] call FUNC(canLoadMagazine));
statement = QUOTE([ARR_3(_player,_target,'ACE_1Rnd_82mm_Mo_HE_LaserGuided')] call FUNC(loadMagazine));
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));
icon = "";
};
class GVAR(loadMagazine_Illum) {
displayName = CSTRING(loadMagazine_Illum);
distance = 4;
condition = QUOTE([ARR_3(_player,_target,'ACE_1Rnd_82mm_Mo_Illum')] call FUNC(canLoadMagazine));
statement = QUOTE([ARR_3(_player,_target,'ACE_1Rnd_82mm_Mo_Illum')] call FUNC(loadMagazine));
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));
icon = "";
};
class GVAR(loadMagazine_Smoke) {
displayName = CSTRING(loadMagazine_Smoke);
distance = 4;
condition = QUOTE([ARR_3(_player,_target,'ACE_1Rnd_82mm_Mo_Smoke')] call FUNC(canLoadMagazine));
statement = QUOTE([ARR_3(_player,_target,'ACE_1Rnd_82mm_Mo_Smoke')] call FUNC(loadMagazine));
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));
icon = "";
};
class GVAR(loadMagazine_HE) {
displayName = CSTRING(loadMagazine_HE);
distance = 4;
condition = QUOTE([ARR_3(_player,_target,'ACE_1Rnd_82mm_Mo_HE')] call FUNC(canLoadMagazine));
statement = QUOTE([ARR_3(_player,_target,'ACE_1Rnd_82mm_Mo_HE')] call FUNC(loadMagazine));
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));
icon = "";
};
};

View File

@ -13,6 +13,7 @@ PREP(canUnloadMagazine);
PREP(handleFired);
PREP(handlePlayerVehicleChanged);
PREP(loadMagazine);
PREP(loadMagazineTimer);
PREP(moduleInit);
PREP(rangeTableCanUse);
PREP(rangeTableOpen);
@ -21,5 +22,6 @@ PREP(rangeTablePreCalculatedValues);
PREP(toggleMils);
PREP(turretDisplayLoaded);
PREP(unloadMagazine);
PREP(unloadMagazineTimer);
ADDON = true;

View File

@ -1,6 +1,3 @@
// Artificially low for testing
#DEFINE __MASS = 10
class cfgMagazines {
class 8Rnd_82mm_Mo_shells;
class ACE_1Rnd_82mm_Mo_HE: 8Rnd_82mm_Mo_shells {
@ -10,9 +7,9 @@ class cfgMagazines {
author = ECSTRING(common,ACETeam);
displayName = CSTRING(magazine_HE_displayName);
descriptionShort = CSTRING(magazine_HE_descriptionShort);
model = "";
picture = "";
mass = __MASS;
model = "\A3\weapons_f\launchers\RPG32\tbg32v_rocket_item.p3d";
picture = "\A3\Weapons_F\launchers\RPG32\data\UI\gear_tbg32v_rocket_ca.paa";
mass = 10;
};
class 8Rnd_82mm_Mo_Smoke_white;
class ACE_1Rnd_82mm_Mo_Smoke: 8Rnd_82mm_Mo_Smoke_white {
@ -22,9 +19,9 @@ class cfgMagazines {
author = ECSTRING(common,ACETeam);
displayName = CSTRING(magazine_Smoke_displayName);
descriptionShort = CSTRING(magazine_Smoke_descriptionShort);
model = "";
picture = "";
mass = __MASS;
model = "\A3\weapons_f\launchers\RPG32\tbg32v_rocket_item.p3d";
picture = "\A3\Weapons_F\launchers\RPG32\data\UI\gear_tbg32v_rocket_ca.paa";
mass = 10;
};
class 8Rnd_82mm_Mo_Flare_white;
class ACE_1Rnd_82mm_Mo_Illum: 8Rnd_82mm_Mo_Flare_white {
@ -34,9 +31,9 @@ class cfgMagazines {
author = ECSTRING(common,ACETeam);
displayName = CSTRING(magazine_Illum_displayName);
descriptionShort = CSTRING(magazine_Illum_descriptionShort);
model = "";
picture = "";
mass = __MASS;
model = "\A3\weapons_f\launchers\RPG32\tbg32v_rocket_item.p3d";
picture = "\A3\Weapons_F\launchers\RPG32\data\UI\gear_tbg32v_rocket_ca.paa";
mass = 10;
};
class 8Rnd_82mm_Mo_guided;
class ACE_1Rnd_82mm_Mo_HE_Guided: 8Rnd_82mm_Mo_guided {
@ -46,9 +43,9 @@ class cfgMagazines {
author = ECSTRING(common,ACETeam);
displayName = CSTRING(magazine_HE_Guided_displayName);
descriptionShort = CSTRING(magazine_HE_Guided_descriptionShort);
model = "";
picture = "";
mass = __MASS;
model = "\A3\weapons_f\launchers\RPG32\tbg32v_rocket_item.p3d";
picture = "\A3\Weapons_F\launchers\RPG32\data\UI\gear_tbg32v_rocket_ca.paa";
mass = 10;
};
class 8Rnd_82mm_Mo_LG;
class ACE_1Rnd_82mm_Mo_HE_LaserGuided: 8Rnd_82mm_Mo_LG {
@ -58,8 +55,8 @@ class cfgMagazines {
author = ECSTRING(common,ACETeam);
displayName = CSTRING(magazine_HE_LaserGuided_displayName);
descriptionShort = CSTRING(magazine_HE_LaserGuided_descriptionShort);
model = "";
picture = "";
mass = __MASS;
model = "\A3\weapons_f\launchers\RPG32\tbg32v_rocket_item.p3d";
picture = "\A3\Weapons_F\launchers\RPG32\data\UI\gear_tbg32v_rocket_ca.paa";
mass = 10;
};
};

View File

@ -11,14 +11,14 @@
* canLoadMagazine <BOOL>
*
* Example:
* [_target,_player,'16aa_static_magazine_1Rnd_105mm_HE'] call lsr_staticweapons_canLoadMagazine
* [_target,_player,"ACE_1Rnd_82mm_Mo_HE"] call ace_mk6mortar_fnc_canLoadMagazine
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_unit","_static",["_magazineClassOptional","",[""]]];
params ["_static","_unit",["_magazineClassOptional","",[""]]];
private ["_canLoadMagazine","_currentMagazine","_weapon","_magazines","_listOfMagNames",
"_hasCompatibleMagazine","_count"];

View File

@ -10,13 +10,13 @@
* canUnloadMagazine <BOOL>
*
* Example:
* [_target,_player] call lsr_staticweapons_canUnloadMagazine
* [_target,_player] call ace_mk6mortar_fnc_canUnloadMagazine
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_unit","_static"];
params ["_static","_unit"];
private ["_canUnloadMagazine","_ammoCount"];
if !(alive _static) exitWith {false};

View File

@ -11,13 +11,13 @@
* None
*
* Example:
* [_target,_player,'16aa_static_magazine_l16_illum'] call lsr_staticweapons_loadMagazine
* [_target,_player,"ACE_1Rnd_82mm_Mo_HE"] call ace_mk6mortar_fnc_loadMagazine
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_unit","_static",["_magazineClassOptional","",[""]]];
params ["_static","_unit",["_magazineClassOptional","",[""]]];
private ["_weapon","_currentMagazine","_count","_magazines","_magazineDetails","_listOfMagNames",
"_magazineClass","_magazineClassDetails","_parsed","_roundsLeft","_configMortar"];

View File

@ -0,0 +1,29 @@
/*
* Author: Grey
* Loads Magazine into static weapon using a timer
*
* Arguments:
* 0: static <OBJECT>
* 1: unit <OBJECT>
* 2: time to load <NUMBER>
* 3: magazineClassOptional <OPTIONAL><STRING>
*
* Return Value:
* None
*
* Example:
* [_target,_player,"ACE_1Rnd_82mm_Mo_HE"] call ace_mk6mortar_fnc_loadMagazineTimer
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_static","_unit","_timeToLoad",["_magazineClassOptional","",[""]]];
private _progressText = localize LSTRING(loadingMortar);
//Move player into animation if player is standing
if ((_unit call CBA_fnc_getUnitAnim) select 0 == "stand") then {
[_unit, "AmovPercMstpSrasWrflDnon_diary", 1] call EFUNC(common,doAnimation);
};
[_timeToLoad, [_static,_unit,_magazineClassOptional], {(_this select 0) call FUNC(loadMagazine);}, {}, _progressText] call EFUNC(common,progressBar);

View File

@ -11,13 +11,13 @@
* None
*
* Example:
* [_target, _player] call lsr_staticweapons_unloadMagazine
* [_target, _player] call ace_mk6mortar_fnc_unloadMagazine
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_unit","_static"];
params ["_static","_unit"];
private ["_weapon","_currentMagazine","_currentMagazineClass","_ammoCount"];
//Get weapon & magazine information about static weapon

View File

@ -0,0 +1,30 @@
/*
* Author: Grey
*
* Unload current magazine from static weapon using a timer
*
* Arguments:
* 0: static <OBJECT>
* 1: unit <OBJECT>
* 2: time to unload <NUMBER>
*
* Return Value:
* None
*
* Example:
* [_target, _player, 5] call ace_mk6mortar_fnc_unloadMagazineTimer
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_static","_unit","_timeToUnload"];
private _progressText = localize LSTRING(unloadingMortar);
//Move player into animation if player is standing
if ((_unit call CBA_fnc_getUnitAnim) select 0 == "stand") then {
[_unit, "AmovPercMstpSrasWrflDnon_diary", 1] call EFUNC(common,doAnimation);
};
[_timeToUnload, [_static,_unit], {(_this select 0) call FUNC(unloadMagazine);}, {}, _progressText] call EFUNC(common,progressBar);

View File

@ -135,9 +135,18 @@
<Russian>Модуль настройки миномета MK6.</Russian>
<French>Ce module permet de régler les options du mortier MK6</French>
</Key>
<Key ID="STR_ACE_Mk6Mortar_unloadMortar">
<English>Unload Round</English>
</Key>
<Key ID="STR_ACE_Mk6Mortar_loadMortar">
<English>Load Mortar</English>
</Key>
<Key ID="STR_ACE_Mk6Mortar_unloadingMortar">
<English>Unloading Round</English>
</Key>
<Key ID="STR_ACE_Mk6Mortar_loadingMortar">
<English>Preparing Round</English>
</Key>
<Key ID="STR_ACE_Mk6Mortar_loadMagazine_HE">
<English>Load HE</English>
</Key>
@ -153,9 +162,6 @@
<Key ID="STR_ACE_Mk6Mortar_loadMagazine_HE_LaserGuided">
<English>Load Laser Guided HE</English>
</Key>
<Key ID="STR_ACE_Mk6Mortar_unloadMagazine">
<English>Unload Round</English>
</Key>
<Key ID="STR_ACE_Mk6Mortar_magazine_HE_displayName">
<English>82mm HE Round</English>
</Key>