Many things

Added dummy objects
Added carrying
Added display names for a few magazines, that didn't have any
This commit is contained in:
IngoKauffmann 2015-08-16 18:16:38 +02:00
parent 3eaaca84fb
commit 1a22c4d85a
7 changed files with 281 additions and 9 deletions

View File

@ -1,3 +1,13 @@
#define DUMMY_PROPERTIES \
effectsSmoke = ""; \
explosive = 0; \
fuseDistance = 10000; \
hit = 0; \
indirectHit = 0; \
muzzleEffect = ""; \
simulation = "shotMine"; \
timeToLive = 3600;
class CfgAmmo {
class BombCore;
@ -11,15 +21,39 @@ class CfgAmmo {
class MissileBase : MissileCore {
GVAR(caliber) = 250; // Default caliber for missiles
};
class Missile_AA_04_F : MissileBase {
GVAR(dummy) = QGVAR(Missile_AA_04_F);
};
class Missile_AA_03_F : Missile_AA_04_F {
GVAR(dummy) = QGVAR(Missile_AA_03_F);
};
class Rocket_04_HE_F : MissileBase {
GVAR(caliber) = 70;
GVAR(dummy) = QGVAR(Rocket_04_HE_F);
};
class Rocket_03_HE_F : Rocket_04_HE_F {
GVAR(dummy) = QGVAR(Rocket_03_HE_F);
};
class Rocket_04_AP_F : Rocket_04_HE_F {
GVAR(dummy) = QGVAR(Rocket_04_AP_F);
};
class Rocket_03_AP_F : Rocket_04_AP_F {
GVAR(dummy) = QGVAR(Rocket_03_AP_F);
};
class M_PG_AT : MissileBase {
GVAR(caliber) = 100;
GVAR(dummy) = QGVAR(M_PG_AT);
};
class ACE_Hydra70_DAGR : M_PG_AT {
GVAR(caliber) = 70;
};
class Missile_AGM_02_F : MissileBase {
GVAR(dummy) = QGVAR(Missile_AGM_02_F);
};
class Missile_AGM_01_F : Missile_AGM_02_F {
GVAR(dummy) = QGVAR(Missile_AGM_01_F);
};
class RocketCore;
class RocketBase : RocketCore {
@ -27,13 +61,17 @@ class CfgAmmo {
};
class R_80mm_HE : RocketBase {
GVAR(caliber) = 80;
GVAR(dummy) = QGVAR(R_80mm_HE);
};
class R_60mm_HE : R_80mm_HE {
GVAR(caliber) = 60;
GVAR(dummy) = QGVAR(R_60mm_HE);
};
class R_Hydra_HE : RocketBase {
GVAR(dummy) = QGVAR(R_Hydra_HE);
};
class BulletBase;
class B_19mm_HE : BulletBase {
GVAR(caliber) = 19;
};
@ -79,6 +117,10 @@ class CfgAmmo {
};
class ShellBase;
class R_230mm_fly : ShellBase {
GVAR(dummy) = QGVAR(R_230mm_fly);
};
class Sh_120mm_APFSDS : Shellbase {
GVAR(caliber) = 120;
};
@ -174,16 +216,120 @@ class CfgAmmo {
GVAR(caliber) = 70;
};
class Bomb_04_F : LaserBombCore {
GVAR(caliber) = 250; // Default caliber for bombs
class Bo_Mk82 : BombCore {
GVAR(dummy) = QGVAR(Bo_Mk82);
};
class Bo_GBU12_LGB : LaserBombCore {
GVAR(caliber) = 250; // Default caliber for bombs
GVAR(dummy) = QGVAR(Bo_GBU12_LGB);
};
class Bomb_04_F : LaserBombCore {
GVAR(caliber) = 250; // Default caliber for bombs
GVAR(dummy) = QGVAR(Bomb_04_F);
};
class Bomb_03_F : Bomb_04_F {
GVAR(dummy) = QGVAR(Bomb_03_F);
};
// Dummy Ammo
class GVAR(Bo_GBU12_LGB) : Bo_GBU12_LGB {
DUMMY_PROPERTIES
model = "\A3\Weapons_F\Ammo\Bomb_01_F.p3d";
};
class GVAR(Bo_Mk82) : Bo_Mk82 {
DUMMY_PROPERTIES
model = "\A3\Weapons_F\Ammo\Bomb_02_F";
};
class GVAR(Bomb_04_F) : Bomb_04_F {
DUMMY_PROPERTIES
model = "\A3\Weapons_F_EPC\Ammo\Bomb_04_F.p3d";
};
class GVAR(Bomb_03_F) : Bomb_04_F {
DUMMY_PROPERTIES
model = "\A3\Weapons_F_EPC\Ammo\Bomb_03_F.p3d";
};
class GVAR(Missile_AA_04_F) : Missile_AA_04_F {
DUMMY_PROPERTIES
model = "\A3\Weapons_F_EPC\Ammo\Missile_AA_04_F.p3d";
};
class GVAR(Missile_AA_03_F) : Missile_AA_03_F {
DUMMY_PROPERTIES
model = "\A3\Weapons_F_EPC\Ammo\Missile_AA_03_F.p3d";
};
class GVAR(Missile_AGM_02_F) : Missile_AGM_02_F {
DUMMY_PROPERTIES
model = "\A3\Weapons_F_EPC\Ammo\Missile_AGM_02_F.p3d";
};
class GVAR(Missile_AGM_01_F) : Missile_AGM_01_F {
DUMMY_PROPERTIES
model = "\A3\Weapons_F_EPC\Ammo\Missile_AGM_01_F.p3d";
};
class GVAR(R_230mm_fly) : R_230mm_fly {
DUMMY_PROPERTIES
model = "\A3\Weapons_F\Ammo\Missile_AT_02_F";
};
class GVAR(R_230mm_HE) : R_230mm_HE {
DUMMY_PROPERTIES
model = "\A3\Weapons_F\Ammo\Missile_AT_02_F";
};
class GVAR(M_PG_AT) : M_PG_AT {
DUMMY_PROPERTIES
model = "\A3\Weapons_F\Ammo\Rocket_01_F";
};
class GVAR(Rocket_04_HE_F) : Rocket_04_HE_F {
DUMMY_PROPERTIES
model = "\A3\Weapons_F_EPC\Ammo\Rocket_04_HE_F.p3d";
};
class GVAR(Rocket_03_HE_F) : Rocket_03_HE_F {
DUMMY_PROPERTIES
model = "\A3\Weapons_F_EPC\Ammo\Rocket_03_HE_F.p3d";
};
class GVAR(Rocket_04_AP_F) : Rocket_04_HE_F {
DUMMY_PROPERTIES
model = "\A3\Weapons_F_EPC\Ammo\Rocket_04_AP_F.p3d";
};
class GVAR(Rocket_03_AP_F) : Rocket_03_AP_F {
DUMMY_PROPERTIES
model = "\A3\Weapons_F_EPC\Ammo\Rocket_03_AP_F.p3d";
};
// Using wrong model
class GVAR(R_80mm_HE) : R_80mm_HE {
DUMMY_PROPERTIES
model = "\A3\Weapons_F_EPC\Ammo\Rocket_03_HE_F.p3d";
};
class GVAR(R_60mm_HE) : R_60mm_HE {
DUMMY_PROPERTIES
model = "\A3\Weapons_F_EPC\Ammo\Rocket_03_HE_F.p3d";
};
class GVAR(R_Hydra_HE) : R_Hydra_HE {
DUMMY_PROPERTIES
model = "\A3\Weapons_F_EPC\Ammo\Rocket_03_HE_F.p3d";
};
// F18 Mod
class js_a_fa18_wing_tank : LaserBombCore {
GVAR(caliber) = 250; // Default caliber for bombs
};
class js_a_fa18x_MK82 : BombCore {};
class js_a_fa18x_GBU39_SDB : js_a_fa18x_MK82 {
GVAR(caliber) = 250; // Default caliber for bombs

View File

@ -0,0 +1,56 @@
class CfgMagazines {
class CA_Magazine;
class 60Rnd_CMFlareMagazine : CA_Magazine {
displayName = CSTRING(flarelauncher);
};
class VehicleMagazine;
class SmokeLauncherMag : VehicleMagazine {
displayName = CSTRING(smokelauncher);
};
class SmokeLauncherMag_boat : VehicleMagazine {
displayName = CSTRING(smokelauncher);
};
class 1000Rnd_Gatling_30mm_Plane_CAS_01_F : VehicleMagazine {
displayName = "30mm HEI";
};
class 500Rnd_Cannon_30mm_Plane_CAS_02_F : 1000Rnd_Gatling_30mm_Plane_CAS_01_F {
displayName = "30mm HEI-T";
};
class 2Rnd_Missile_AA_04_F : VehicleMagazine {
displayName = "AIM-9 Sidewinder";
};
class 2Rnd_Missile_AA_03_F : 2Rnd_Missile_AA_04_F {
displayName = "Wympel R-73";
};
class 6Rnd_Missile_AGM_02_F : VehicleMagazine {
displayName = "AGM-65 Maverick";
};
class 4Rnd_Missile_AGM_01_F : 6Rnd_Missile_AGM_02_F {
displayName = "Kh-25MTP";
};
class 7Rnd_Rocket_04_HE_F : VehicleMagazine {
displayName = "Hydra 70 HE";
};
class 20Rnd_Rocket_03_HE_F : 7Rnd_Rocket_04_HE_F {
displayName = "S-8 HE";
};
class 7Rnd_Rocket_04_AP_F : 7Rnd_Rocket_04_HE_F {
displayName = "Hydra 70 AP";
};
class 20Rnd_Rocket_03_AP_F : 7Rnd_Rocket_04_AP_F {
displayName = "S-8 AP";
};
class 4Rnd_Bomb_04_F : VehicleMagazine {
displayName = "GBU-12"
};
class 2Rnd_Bomb_03_F : 4Rnd_Bomb_04_F {
displayName = "FAB-250M-54"
};
};

View File

@ -14,5 +14,6 @@ class CfgPatches {
#include "CfgEventHandlers.hpp"
#include "CfgVehicles.hpp"
#include "CfgMagazines.hpp"
#include "CfgAmmo.hpp"
#include "ACE_Settings.hpp"

View File

@ -47,6 +47,9 @@ if (_idx == -1 ) then {
_idx = 2;
};
_unit setVariable [QGVAR(selectedWeaponOnRearm), currentWeapon _unit];
_unit action ["SwitchWeapon", _unit, _unit, 99];
[
(DURATION_PICKUP select _idx),
[_unit, _magazine],

View File

@ -17,7 +17,25 @@
*/
#include "script_component.hpp"
private ["_dummy"];
params ["_args"];
_args params ["_unit", "_magazine"];
_unit setVariable [QGVAR(carriedMagazine), _magazine]; // TODO replace by item
_unit setVariable [QGVAR(carriedMagazine), _magazine];
[_unit, QGVAR(vehRearm), true] call EFUNC(common,setForceWalkStatus);
_dummy = _unit getVariable [QGVAR(dummy), objNull];
if !(isNull _dummy) then {
detach _dummy;
deleteVehicle _dummy;
_unit setVariable [QGVAR(dummy), objNull];
};
_ammo = getText (configFile >> "CfgMagazines" >> _magazine >> "ammo");
_dummy = getText (configFile >> "CfgAmmo" >> _ammo >> QGVAR(dummy));
if !(_dummy == "") then {
_dummy = _dummy createVehicle (position _unit);
_dummy attachTo [_unit, [0,0.5,0], "pelvis"];
_dummy setDir 90;
_dummy allowDamage false;
_unit setVariable [QGVAR(dummy), _dummy];
};

View File

@ -21,7 +21,19 @@
*/
#include "script_component.hpp"
private ["_rounds", "_currentRounds", "_maxMagazines"];
#define REARM_SUCCESS \
[_unit, QGVAR(vehRearm), false] call EFUNC(common,setForceWalkStatus); \
_dummy = _unit getVariable [QGVAR(dummy), objNull]; \
if !(isNull _dummy) then { \
detach _dummy; \
deleteVehicle _dummy; \
}; \
_unit setVariable [QGVAR(carriedMagazine), nil, true]; \
_weaponSelect = _unit getVariable QGVAR(selectedWeaponOnRearm); \
_unit selectWeapon _weaponSelect; \
_unit setVariable [QGVAR(selectedWeaponOnRearm), nil];
private ["_rounds", "_currentRounds", "_maxMagazines", "_dummy"];
params ["_args"];
_args params ["_target", "_unit", "_turretPath", "_numMagazines", "_magazine", "_numRounds"];
@ -43,7 +55,11 @@ if (_maxMagazines == 1) then {
// Fill only at most _numRounds
_target setMagazineTurretAmmo [_magazine, ((_target magazineTurretAmmo [_magazine, _turretPath]) + _numRounds) min _rounds, _turretPath];
};
_unit setVariable [QGVAR(carriedMagazine), nil]; // TODO replace by item
[[LSTRING(Hint_RearmedTriple), _numRounds,
getText(configFile >> "CfgMagazines" >> _magazine >> "displayName"),
getText(configFile >> "CfgVehicles" >> (typeOf _target) >> "displayName")], 3, _unit] call EFUNC(common,displayTextStructured);
REARM_SUCCESS
} else {
for "_idx" from 1 to _maxMagazines do {
_currentRounds = _target magazineTurretAmmo [_magazine, _turretPath];
@ -68,7 +84,11 @@ if (_maxMagazines == 1) then {
_target setMagazineTurretAmmo [_magazine, _currentRounds, _turretPath];
};
};
_unit setVariable [QGVAR(carriedMagazine), nil]; // TODO replace by item
[[LSTRING(Hint_RearmedTriple), _rounds,
getText(configFile >> "CfgMagazines" >> _magazine >> "displayName"),
getText(configFile >> "CfgVehicles" >> (typeOf _target) >> "displayName")], 3, _unit] call EFUNC(common,displayTextStructured);
REARM_SUCCESS
};
_target removeMagazineTurret [_magazine, _turretPath];
_numMagazines = _numMagazines - 1;

View File

@ -45,5 +45,33 @@
<English>Pick up ammo</English>
<German>Munition nehmen</German>
</Key>
<Key ID="STR_ACE_Rearm_Hint_RearmedTriple">
<English>Rearmed %1 rounds of %2 on %3</English>
<German>%1 Schuss %2 an %3 aufmunitioniert</German>
</Key>
<Key ID="STR_ACE_Rearm_smokelauncher">
<Original>Smoke Screen</Original>
<English>Smoke Screen</English>
<Czech>Kouřová clona</Czech>
<French>Écran de fumée</French>
<German>Rauchwand</German>
<Italian>Cortina fumogena</Italian>
<Polish>Zasłona dymna</Polish>
<Portuguese>Cortina de fumaça</Portuguese>
<Russian>Дым. завеса</Russian>
<Spanish>Pantalla de humo</Spanish>
</Key>
<Key ID="STR_ACE_Rearm_flarelauncher">
<Original>Flares</Original>
<English>Flares</English>
<Czech>Světlice</Czech>
<French>Fusées</French>
<German>Leuchtkörper</German>
<Italian>Razzi luminosi</Italian>
<Polish>Flary</Polish>
<Portuguese>Sinalizadores</Portuguese>
<Russian>ЛТЦ</Russian>
<Spanish>Bengalas</Spanish>
</Key>
</Package>
</Project>