User Tools

Site Tools


arma2:custom_artillery

Custom Artillery

How to create custom artillery. Its difficult, in fact, we haven't been able to create fully custom one yet, we just inherit from M119 for arty and M252 for mortars. Yes it works, but its ugly. Here is our research so far, maybe this helps someone.

Modules Arty

arma2\modules\arty\config.cpp
oa\modules\arty\config.cpp
are identical configs (epp diff).

class CfgCloudlets
{
	class Default;
	class ARTY_ExplosionStreamersSmall: Default
 
class MLRS: Tank
class GRAD_Base: Ural_Base_withTurret
class D30_Base: StaticCannon
class M119: StaticCannon
class M252: StaticMortar
class 2b14_82mm: StaticMortar
 
class CfgAmmo
{
	class ShellBase;
	class ARTY_Sh_Base: ShellBase
	{
		ARTY_IncomingSounds[] = {};
		ARTY_IncomingSoundAlt = 200;
		ARTY_IncomingSoundAltError = 50;
		ARTY_TrailFX = "\ca\modules\ARTY\data\fx\scripts\shellTrailsMedium.sqf";
		whistleOnFire = 2;
	};
 
ARTY_IsArtyVehicle = 1;
 
class CfgMagazines
 
class ARTY_30Rnd_105mmHE_M119: VehicleMagazine
{
    scope = public;
    displayName = "$STR_CfgMagazines_ARTY_30Rnd_105mmHE_M119_DN";
    ammo = "ARTY_Sh_105_HE";
    count = 30;
    initSpeed = 850;
    nameSound = "heat";
    ARTY_Ballistics = "\ca\modules\arty\data\tables\m119\105mm_ballistics.sqf";
};
 
class ARTY_8Rnd_81mmHE_M252: VehicleMagazine
{
    scope = public;
    displayName = "$STR_CfgMagazines_ARTY_8Rnd_81mmHE_M252_DN";
    ammo = "ARTY_Sh_81_HE";
    count = 8;
    initSpeed = 650;
    nameSound = "heat";
    ARTY_Ballistics = "\ca\modules\arty\data\tables\m252\m821A1_ballistics.sqf";
};
 
class CfgWeapons
{
    class CannonCore;
    class M119: CannonCore
    {
        magazines[] = 
        {
            "30Rnd_105mmHE_M119",
            "ARTY_30Rnd_105mmHE_M119",
            "ARTY_30Rnd_105mmWP_M119",
            "ARTY_30Rnd_105mmSADARM_M119",
            "ARTY_30Rnd_105mmLASER_M119",
            "ARTY_30Rnd_105mmSMOKE_M119",
            "ARTY_30Rnd_105mmILLUM_M119"
        };
    };
 
    class M252: CannonCore
    {
        magazines[] = 
        {
            "ARTY_8Rnd_81mmHE_M252",
            "ARTY_8Rnd_81mmWP_M252",
            "ARTY_8Rnd_81mmILLUM_M252"
        };
    };

Ballistic things:

ARTY_Ballistics = "\ca\modules\arty\data\tables\m119\105mm_ballistics.sqf";
ARTY_Ballistics = "\ca\modules\arty\data\tables\m252\m821A1_ballistics.sqf";
ARTY_Ballistics = "\ca\modules\arty\data\tables\m270\xm31_ballistics.sqf";
ARTY_Ballistics = "\ca\modules\arty\data\tables\d30\122mm_ballistics.sqf";
ARTY_Ballistics = "\ca\modules\arty\data\tables\2b14\82mm_ballistics.sqf";
ARTY_Ballistics = "\ca\modules\arty\data\tables\bm21\9M28F_HE_ballistics.sqf";

OA Bin

oa\bin\config.cpp

class ArtilleryRocketCore: RocketCore
class ArtilleryTarget: All

OA UI

oa\ui\config.cpp

class RscDisplayArtillery: RscStandardDisplay

OA Weapons_e

oa\weapons_e\config.cpp

class ARTY_Sh_Base: ShellBase{};
class ARTY_Sh_120_HE: ARTY_Sh_Base
 
class 24Rnd_120mmHE_M120: VehicleMagazine
ammo = "ARTY_Sh_120_HE";
 
class M119: CannonCore
{
	magazines[] =
	{
		"30Rnd_105mmHE_M119",
		"30Rnd_105mmWP_M119",
		"30Rnd_105mmSADARM_M119",
		"30Rnd_105mmLASER_M119",
		"30Rnd_105mmSMOKE_M119",
		"30Rnd_105mmILLUM_M119",
		"ARTY_30Rnd_105mmHE_M119",
		"ARTY_30Rnd_105mmWP_M119",
		"ARTY_30Rnd_105mmSADARM_M119",
		"ARTY_30Rnd_105mmLASER_M119",
		"ARTY_30Rnd_105mmSMOKE_M119",
		"ARTY_30Rnd_105mmILLUM_M119"
	};
 
artilleryLock = 1;
artilleryDispersion = 0.35;
artilleryCharge = 0.48;

Illumination and WP rounds:

// cfgAmmo
	class Sh_81_HE: ShellBase
	{
		hit = 160;
		indirectHit = 50;
		indirectHitRange = 20;
		typicalSpeed = 800;
		explosive = 0.8;
		cost = 200;
		timeToLive = 180;
		model = "\ca\Weapons\shell";
		CraterEffects = "ArtyShellCrater";
		ExplosionEffects = "ARTY_ShellExplosionSmall";
		muzzleEffect = "BIS_Effects_HeavyCaliber";
		whistleOnFire = 0;
		whistleDist = 20;
		artilleryLock = 1;
		airFriction = 0.0;
		sideairFriction = 0.0;
		thrust = 0;
	};
 
	class Sh_81_WP: Sh_81_HE
	{
		hit = 35;
		indirectHit = 30;
		indirectHitRange = 20;
		explosive = 0.8;
		ExplosionEffects = "WPExplosion";
		soundHit[] = {"\ca\weapons\data\sound\explosion\grenade_new1",3.162278,1};
		CraterEffects = "";
	};
 
	class Sh_81_ILLUM: Sh_81_HE
	{
		hit = 5;
		indirectHit = 0;
		indirectHitRange = 0;
		explosive = 0;
		ExplosionEffects = "";
		soundHit[] = {"",0,1};
		CraterEffects = "";
		whistleDist = 0;
	};
 
	class Sh_105_HE: ShellBase
	{
		artilleryLock = 1;
		thrust = 0;
		timeToLive = 180;
		airFriction = 0;
		sideAirFriction = 0;
	};
 
	class Sh_105_ILLUM: Sh_105_HE
	{
		hit = 8;
		indirectHit = 0;
		indirectHitRange = 0;
		explosive = 0;
		ExplosionEffects = "";
		soundHit[] = {"",0,1};
		CraterEffects = "";
		whistleDist = 0;
	};
 
	class Sh_105_WP: Sh_105_HE
	{
		hit = 60;
		indirectHit = 50;
		indirectHitRange = 30;
		explosive = 0.8;
		ExplosionEffects = "WPExplosion";
		CraterEffects = "ExploAmmoCrater";
		soundHit[] = {"\ca\weapons\data\sound\explosion\grenade_new1",3.162278,1};
		whistleDist = 60;
	};
 
// cfgMagazines
	class 8Rnd_81mmHE_M252: VehicleMagazine
	{
		scope = public;
		displayName = "$STR_CfgMagazines_ARTY_8Rnd_81mmHE_M252_DN";
		ammo = "Sh_81_HE";
		count = 8;
		initSpeed = 243;
		nameSound = "heat";
	};
 
	class 8Rnd_81mmWP_M252: 8Rnd_81mmHE_M252
	{
		displayName = "$STR_CfgMagazines_ARTY_8Rnd_81mmWP_M252_DN";
		ammo = "Sh_81_WP";
	};
 
	class 8Rnd_81mmILLUM_M252: 8Rnd_81mmHE_M252
	{
		displayName = "$STR_CfgMagazines_ARTY_8Rnd_81mmILLUM_M252_DN";
		ammo = "Sh_81_ILLUM";
	};
 
	class 30Rnd_105mmHE_M119: VehicleMagazine
	{
		displayNameShort = "$STR_EP1_SN_HE";
		initSpeed = 370;
	};
 
	class 30Rnd_105mmWP_M119: 30Rnd_105mmHE_M119
	{
		displayName = "$STR_CfgMagazines_ARTY_30Rnd_105mmWP_M119_DN";
		ammo = "Sh_105_WP";
	};
 
	class 30Rnd_105mmILLUM_M119: 30Rnd_105mmHE_M119
	{
		displayName = "$STR_DN_30Rnd_M119_105mmILLUM";
		ammo = "Sh_105_ILLUM";
	};

OA Weapons_e\M119_Howitzer

oa\weapons_e\M119_Howitzer\config.cpp

artilleryScanner = 1;
ARTY_IsArtyVehicle = 0;

ArmA2\Data\ParticleEffects

arma2\Data\ParticleEffects\config.cpp

class ArtyShellCrater
class ArtyShellExplosion

Inherit mess

M252 as an example:

  1. arma2\weapons\m252_81mm_mortar\config.cpp is creating the vehicle + weapon.
  2. arma2\modules\arty\config.cpp adds to that config; magazine “ARTY_8Rnd_81mmHE_M252” and ARTY_IsArtyVehicle = 1;.

Summary

Adding artilleryScanner = 1; to your arty VEHICLE will activate the artillery computer action menu.

Adding ARTY_IsArtyVehicle = 1; to your vehicle, will activate target artillery action menu.

arma2\weapons\m252_81mm_mortar\config.cpp
oa\weapons\m252_81mm_mortar\config.cpp
are the same, except arma2 cursor = “Missile”; was replaced by oa's cursor = “\ca\UI\data\cursor_w_tank_gs”;

BIS models analysis

BIS artillery models analysis

M252 81mm mortar

81mortar.p3d

Resolution LOD selections: otochlaven, otocvez, proxys cargo and gunner.
Geometry: very rough box shape, proxys.
Memory:
aimpoint - center of tube.
cargoview - aligned with ground plate, bit to the right.
gun_chamber - almost bottom of tube.
gun_muzzle - end point of tube.
gunnerview - slightly behind and left of ground plate.
konec hlavne - same as gun_chamber.
osahlaven - horizontal two points where tube connects to ground plate.
osaveze - vertical two points where tube connects to ground plate.
otochlaven - gun_muzzle and gun_chamber.
otocvez - osahlaven, cargoview, gunnerview, pos_cargo, pos_cargo_dir, pos_gunner and pos_gunner_dir.
pos_cargo - cargo getin point, back right.
pos_cargo_dir - cargo getin direction (towards model).
pos_gunner - gunner getin point, back left.
pos_gunner_dir - gunner getin direction (towards model).
usti hlavne - end point of tube (gun_muzzle).
zamerny - center of tube (aimpoint).

podnos 2b14 82mm

podnos_2b14_82mm.p3d

Pretty much the mirror image technically modelwise as 81mortar.p3d. Only thing worth mentioning is that gun_muzzle looks to be like almost same spot as in M252, which suggests BIS just used its memory points “as is”.

arma2/custom_artillery.txt · Last modified: 2011-07-01 10:10 by snakeman