Jump to content
Sign in to follow this  
RR_Raptor65

Small arms - bolt and magazine animation

Recommended Posts

I'm still new to modelling in ArmA 2, I've managed to get several small arms in-game and working thanks to earlier help here. But one thing that continues to bother me is the animations.

Right now I'm focusing on one of the guns, an SMG called the MG39, I think if I can get an understanding of how to get the animations working with that gun I can get them working with the rest.

I've been trying to figure out how to get the bolt to move when firing and the magazine to disappear when reloading with absolutely no success, and my endless searches have shed no light on what I'm doing wrong or what I'm missing.

Here's my Model Config:

class CfgSkeletons
{
   class Default
{
	isDiscrete = 1;
	skeletonInherit = "";
	skeletonBones[] = {};
};

   class RomaGun: Default
   {
       skeletonInherit="";
       skeletonBones[]=
       {
           "magazine","",
           "trigger","",
           "bolt",""
       };
   };
};

class CfgModels
{
   class Default
   {
       sectionsInherit="";
       sections[]={};
       skeletonName="";
   };
   class RomaGun: Default {};

   class R36: RomaGun
   {
	skeletonName="R36";
	class Animations
	{
		class magazine_hide
		{
			type="hide";
			source="reloadMagazine";
			selection="magazine";
			minValue=0.200000;
			maxValue=0.250000;
			hideValue=0.100000;
		};

		class trigger
		{
			type = "rotationZ";
			source = "reload";
			selection = "trigger";
			axis = "trigger_axis";
			minValue = 0;
			maxValue = 3;
			angle0 = 0;
			angle1 = -3;
		};
	};
       sections[]={"zasleh"};
	sectionsInherit="";
};

   class R36_Carbine: RomaGun
   {
	skeletonName="R36_Carbine";
	class Animations
	{
		class magazine_hide
		{
			type="hide";
			source="reloadMagazine";
			selection="magazine";
			minValue=0.200000;
			maxValue=0.250000;
			hideValue=0.100000;
		};

		class trigger
		{
			type = "rotationZ";
			source = "reload";
			selection = "trigger";
			axis = "trigger_axis";
			minValue = 0;
			maxValue = 3;
			angle0 = 0;
			angle1 = -3;
		};
	};
       sections[]={"zasleh"};
	sectionsInherit="";
};

   class R36_Para: RomaGun
   {
	skeletonName="R36_Para";
	class Animations
	{
		class magazine_hide
		{
			type="hide";
			source="reloadMagazine";
			selection="magazine";
			minValue=0.200000;
			maxValue=0.250000;
			hideValue=0.100000;
		};

		class trigger
		{
			type = "rotationZ";
			source = "reload";
			selection = "trigger";
			axis = "trigger_axis";
			minValue = 0;
			maxValue = 3;
			angle0 = 0;
			angle1 = -3;
		};
	};
       sections[]={"zasleh"};
	sectionsInherit="";
};

   class MG39: RomaGun
   {
	skeletonName="MG39";
	class Animations
	{
		class reload_magazine
		{
			type="hide";
			source="reloadMagazine";
			selection="magazine";
			hidevalue=1;
		};

		class trigger
		{
			type = "rotationZ";
			source = "reload";
			selection = "trigger";
			axis = "trigger_axis";
			minValue = 0;
			maxValue = 3;
			angle0 = 0;
			angle1 = -3;
		};

		class bolt_action
		{
			type="translationX";
			source="reload";
			selection="bolt";
			axis="";
			memory="false";
			animPeriod=0;
			minValue=0;
			maxValue=0.09;
		};
	};
       sections[]={"zasleh"};
	sectionsInherit="";
};

   class MG1: RomaGun
   {
	skeletonName="MG1";
	class Animations
	{
		class magazine_hide
		{
			type="hide";
			source="reloadMagazine";
			selection="magazine";
			minValue=0.200000;
			maxValue=0.250000;
			hideValue=0.100000;
		};

		class trigger
		{
			type = "rotationZ";
			source = "reload";
			selection = "trigger";
			axis = "trigger_axis";
			minValue = 0;
			maxValue = 3;
			angle0 = 0;
			angle1 = -3;
		};
	};
       sections[]={"zasleh"};
	sectionsInherit="";
};

   class R01: RomaGun
   {
	skeletonName="R01";
	class Animations
	{
		class magazine_hide
		{
			type="hide";
			source="reloadMagazine";
			selection="magazine";
			minValue=0.200000;
			maxValue=0.250000;
			hideValue=0.100000;
		};

		class trigger
		{
			type = "rotationZ";
			source = "reload";
			selection = "trigger";
			axis = "trigger_axis";
			minValue = 0;
			maxValue = 3;
			angle0 = 0;
			angle1 = -3;
		};
	};
       sections[]={"zasleh"};
	sectionsInherit="";
};

   class R01_Scoped: RomaGun
   {
	skeletonName="R01_Scoped";
	class Animations
	{
		class magazine_hide
		{
			type="hide";
			source="reloadMagazine";
			selection="magazine";
			minValue=0.200000;
			maxValue=0.250000;
			hideValue=0.100000;
		};

		class trigger
		{
			type = "rotationZ";
			source = "reload";
			selection = "trigger";
			axis = "trigger_axis";
			minValue = 0;
			maxValue = 3;
			angle0 = 0;
			angle1 = -3;
		};
	};
       sections[]={"zasleh"};
	sectionsInherit="";
};

   class M22: RomaGun
   {
	skeletonName="M22";
	class Animations
	{
		class magazine_hide
		{
			type="hide";
			source="reloadMagazine";
			selection="magazine";
			minValue=0.200000;
			maxValue=0.250000;
			hideValue=0.100000;
		};

		class trigger
		{
			type = "rotationZ";
			source = "reload";
			selection = "trigger";
			axis = "trigger_axis";
			minValue = 0;
			maxValue = 3;
			angle0 = 0;
			angle1 = -3;
		};
	};
       sections[]={"zasleh"};
	sectionsInherit="";
};
};

Section focusing on the MG39, I've butchered and reconfigured the animations so many times now they're probably wrong now if they were ever right.

    class MG39: RomaGun
   {
	skeletonName="MG39";
	class Animations
	{
		class reload_magazine
		{
			type="hide";
			source="reloadMagazine";
			selection="magazine";
			hidevalue=1;
		};

		class trigger
		{
			type = "rotationZ";
			source = "reload";
			selection = "trigger";
			axis = "trigger_axis";
			minValue = 0;
			maxValue = 3;
			angle0 = 0;
			angle1 = -3;
		};

		class bolt_action
		{
			type="translationX";
			source="reload";
			selection="bolt";
			axis="";
			memory="false";
			animPeriod=0;
			minValue=0;
			maxValue=0.09;
		};
	};
       sections[]={"zasleh"};
	sectionsInherit="";
};

And my Config.cpp:

// config.bin - 08:59:02 03/27/10, generated in 0.03 seconds
// Generated by unRap v1.06 by Kegetys
// Separate rootclasses: Disabled, Automatic comments: Enabled

#define true	1
#define false	0

#define private		0
#define protected		1
#define public		2

class Mode_SemiAuto {};

class Mode_Burst : Mode_SemiAuto {};

class Mode_FullAuto : Mode_SemiAuto {};

class CfgAmmo {
class Default;	// External class reference
class BulletCore;	// External class reference
class BulletBase;	// External class reference
class B_762x51_Ball;	// External class reference
};

class CfgMagazines {
class CA_Magazine;	// External class reference

class R36_basemag : CA_Magazine {
	tracersEvery = 0;
};

class R36_10rnd : R36_basemag {
	scope = public;
	model = "\ca\weapons\mag_univ.p3d";
	displayName = "R36 Magazine";
	picture = "\Roma\gear\R36_mag_10.paa";
	count = 10;
	ammo = "B_762x51_Ball";
	initSpeed = 820;
};

class R36_20rnd : R36_basemag {
	scope = public;
	model = "\ca\weapons\mag_univ.p3d";
	displayName = "R36 20 round Magazine";
	picture = "\Roma\gear\R36_mag_20.paa";
	count = 20;
	ammo = "B_762x51_Ball";
	initSpeed = 820;
};

class MG35_60rnd : R36_basemag {
	scope = public;
	model = "\ca\weapons\mag_univ.p3d";
	displayName = "MG35 Magazine";
	picture = "\Roma\gear\MG35_mag.paa";
	count = 60;
	ammo = "B_45ACP_Ball";
	initSpeed = 360;
};

class MG1_150Rnd : CA_Magazine {
	scope = public;
	model = "\ca\weapons\mag_univ.p3d";
	displayName = "MG1 Belt Magazine";
	picture = "\Roma\gear\MG1_mag.paa";
	count = 100;
	ammo = "B_762x51_Ball";
	initSpeed = 820;
	tracersevery = 5;
};

class R01_Mag : CA_Magazine {
	scope = public;
	model = "\ca\weapons\mag_univ.p3d";
	displayName = "6.5x55mm Stripper Clip";
	picture = "\Ca\weapons\Data\Equip\m_M24_CA.paa";
	count = 6;
	ammo = "B_762x51_Ball";
	initSpeed = 820;
};

class M22_20rnd : R36_basemag {
	scope = public;
	model = "\ca\weapons\mag_univ.p3d";
	displayName = "M22 20 round Magazine";
	picture = "\Roma\gear\R36_mag_10.paa";
	count = 20;
	ammo = "B_762x51_Ball";
	initSpeed = 820;
};
};

class CfgPatches {
class Roma {
	Units[] = {};
	weapons[] = {"R36"};
	requiredVersion = 1.0;
	requiredAddons[] = {};
};
};

class CfgWeapons {
class Rifle;	// External class reference
class M16A2;	// External class reference

class R36 : M16A2 {
	scope = 2;
	value = 0;
	displayName = "Rifle Model 1936";
	optics = 1;
	model = "\Roma\R36.p3d";
	picture = "\Roma\gear\R36_icon.paa";
	magazines[] = {"R36_10rnd"};
	modes[] = {"Single"};
	handAnim[] = {"OFP2_ManSkeleton", "\Ca\weapons\data\Anim\M24.rtm"};

	class Single : Mode_SemiAuto {
		sound[] = {"\Roma\sound\R36_shot.wss", 1.77828, 1, 900};
		recoil = "recoil_single_primary_10outof10";
		recoilProne = "recoil_single_primary_10outof10";
	};
};

class R36_Carbine : M16A2 {
	scope = 2;
	value = 0;
	displayName = "Rifle Carbine Model 1936-40";
	optics = 1;
	model = "\Roma\R36_Carbine.p3d";
	picture = "\Roma\gear\R36_Carbine_icon.paa";
	magazines[] = {"R36_10rnd"};
	modes[] = {"Single"};
	handAnim[] = {"OFP2_ManSkeleton", "\Ca\weapons\data\Anim\M24.rtm"};

	class Single : Mode_SemiAuto {
		sound[] = {"\Roma\sound\R36_Carbine_shot.wss", 1.77828, 1, 900};
		recoil = "recoil_single_primary_10outof10";
		recoilProne = "recoil_single_primary_10outof10";
	};
};

class R36_Para : M16A2 {
	scope = 2;
	value = 0;
	displayName = "Paratrooper Rifle Model 1936-40";
	optics = 1;
	model = "\Roma\R36_Para.p3d";
	picture = "\Roma\gear\R36_Para_icon.paa";
	magazines[] = {"R36_20rnd"};
	modes[] = {"Single"};

	class Single : Mode_SemiAuto {
		sound[] = {"\Roma\sound\R36_Carbine_shot.wss", 1.77828, 1, 900};
		recoil = "recoil_single_primary_10outof10";
		recoilProne = "recoil_single_primary_10outof10";
	};
};

class MG39 : Rifle {
	scope = public;
	model = "\Roma\MG39.p3d";
	picture = "\Roma\gear\MG39_icon.paa";
	magazines[] = {"MG35_60rnd"};
	displayName = "MG39 Submachine Gun";
	dexterity = 1.75;
	drySound[] = {"\ca\Weapons\Data\Sound\AK47_dry_v1", 0.000316228, 1, 10};
	reloadMagazineSound[] = {"\ca\Weapons\Data\Sound\MP5_reload", 0.001, 1, 20};
	distanceZoomMin = 50;
	distanceZoomMax = 50;
	value = 1000;
	initSpeed = 400;
	modes[] = {"FullAuto"};		
	handAnim[] = {"OFP2_ManSkeleton", "\Ca\weapons\data\Anim\M16GL.rtm"};

	class FullAuto : Mode_FullAuto {
		begin1[] = {"\Roma\sound\MG39_shot1.wss", 1.77828, 1, 1000};
		begin2[] = {"\Roma\sound\MG39_shot2.wss", 1.77828, 1, 1000};
		begin3[] = {"\Roma\sound\MG39_shot3.wss", 1.77828, 1, 1000};
		soundBegin[] = {"begin1", 0.5, "begin2", 0.5, "begin3", 0.5};
		soundContinuous = 0;
		reloadTime = 0.1;
		ffCount = 1;
		recoil = "recoil_auto_primary_2outof10";
		recoilProne = "recoil_auto_primary_prone_2outof10";
		dispersion = 0.003;
		minRange = 0;
		minRangeProbab = 0.2;
		midRange = 20;
		midRangeProbab = 0.7;
		maxRange = 40;
		maxRangeProbab = 0.05;
	};
};

class MG35 : Rifle {
	scope = public;
	model = "\ca\weapons\bizon\bizon"; //Needs Model, and stuff
	picture = "\CA\weapons\data\Equip\W_bizon_CA.paa";
	magazines[] = {"MG35_60rnd"};
	displayName = "Victor MG35 Submachine Gun";
	dexterity = 1.75;
	drySound[] = {"\ca\Weapons\Data\Sound\AK47_dry_v1", 0.000316228, 1, 10};
	reloadMagazineSound[] = {"\ca\Weapons\Data\Sound\MP5_reload", 0.001, 1, 20};
	distanceZoomMin = 50;
	distanceZoomMax = 50;
	value = 1000;
	initSpeed = 400;
	handAnim[] = {"OFP2_ManSkeleton", "\Ca\weapons\data\Anim\HKMP5.rtm"};
	modes[] = {"FullAuto"};

	class FullAuto : Mode_FullAuto {
		begin1[] = {"\Roma\sound\MG35_shot1.wss", 1.77828, 1, 1000};
		begin2[] = {"\Roma\sound\MG35_shot2.wss", 1.77828, 1, 1000};
		begin3[] = {"\Roma\sound\MG35_shot3.wss", 1.77828, 1, 1000};
		begin4[] = {"\Roma\sound\MG35_shot4.wss", 1.77828, 1, 1000};
		begin5[] = {"\Roma\sound\MG35_shot5.wss", 1.77828, 1, 1000};
		soundBegin[] = {"begin1", 0.5, "begin2", 0.5, "begin3", 0.5, "begin4", 0.5, "begin5", 0.5};
		soundContinuous = 0;
		reloadTime = 0.066;
		ffCount = 1;
		recoil = "recoil_auto_primary_2outof10";
		recoilProne = "recoil_auto_primary_prone_2outof10";
		dispersion = 0.001;
		minRange = 0;
		minRangeProbab = 0.2;
		midRange = 20;
		midRangeProbab = 0.7;
		maxRange = 40;
		maxRangeProbab = 0.05;
	};
};

class MG1 : Rifle {
	bullet1[] = {"ca\sounds\weapons\shells\big_shell_metal_01", 0.0707946, 1, 15};
	bullet2[] = {"ca\sounds\weapons\shells\big_shell_metal_03", 0.0707946, 1, 15};
	bullet3[] = {"ca\sounds\weapons\shells\big_shell_metal_02", 0.0707946, 1, 15};
	bullet4[] = {"ca\sounds\weapons\shells\big_shell_metal_01", 0.0707946, 1, 15};
	bullet5[] = {"ca\sounds\weapons\shells\big_shell_dirt_01", 0.0707946, 1, 15};
	bullet6[] = {"ca\sounds\weapons\shells\big_shell_dirt_02", 0.0707946, 1, 15};
	bullet7[] = {"ca\sounds\weapons\shells\big_shell_dirt_03", 0.0707946, 1, 15};
	bullet8[] = {"ca\sounds\weapons\shells\big_shell_dirt_04", 0.0707946, 1, 15};
	bullet9[] = {"ca\sounds\weapons\shells\big_shell_soft_01", 0.0707946, 1, 15};
	bullet10[] = {"ca\sounds\weapons\shells\big_shell_soft_02", 0.0707946, 1, 15};
	bullet11[] = {"ca\sounds\weapons\shells\big_shell_soft_03", 0.0707946, 1, 15};
	bullet12[] = {"ca\sounds\weapons\shells\big_shell_soft_04", 0.0707946, 1, 15};
	soundBullet[] = {"bullet1", 0.083, "bullet2", 0.083, "bullet3", 0.083, "bullet4", 0.083, "bullet5", 0.083, "bullet6", 0.083, "bullet7", 0.083, "bullet8", 0.083, "bullet9", 0.083, "bullet10", 0.083, "bullet11", 0.083, "bullet12", 0.083};
	scope = public;
	model = "\Roma\MG1.p3d";
	picture = "\Roma\gear\MG1_icon.paa";
	displayName = "MG1 Light Machine Gun";
	handAnim[] = {"OFP2_ManSkeleton", "\Ca\weapons\data\Anim\SAW.rtm"};
	modes[] = {"manual", "close", "short", "medium", "far"};

	class manual : Mode_FullAuto {
		recoil = "recoil_auto_machinegun_6outof10";
		recoilProne = "recoil_auto_machinegun_prone_1outof10";
		dispersion = 0.003;
		begin1[] = {"\Roma\sound\MG1_shot1", 1.77828, 1, 1000};
		begin2[] = {"\Roma\sound\MG1_shot2", 1.77828, 1, 1000};
		begin3[] = {"\Roma\sound\MG1_shot3", 1.77828, 1, 1000};
		begin4[] = {"\Roma\sound\MG1_shot4", 1.77828, 1, 1000};
		begin5[] = {"\Roma\sound\MG1_shot5", 1.77828, 1, 1000};
		soundBegin[] = {"begin1", 0.5, "begin2", 0.5, "begin3", 0.5, "begin4", 0.5, "begin5", 0.5};
		soundContinuous = 0;
		soundBurst = 0;
		minRange = 0;
		minRangeProbab = 0.3;
		midRange = 5;
		midRangeProbab = 0.58;
		maxRange = 10;
		maxRangeProbab = 0.04;
		showToPlayer = true;
		reloadTime = 0.0705;
	};

	class close : manual {
		burst = 5;
		aiRateOfFire = 0.5;	// delay between shots at given distance
		aiRateOfFireDistance = 50;
		minRange = 10;
		minRangeProbab = 0.05;
		midRange = 20;
		midRangeProbab = 0.58;
		maxRange = 50;
		maxRangeProbab = 0.04;
		showToPlayer = false;
	};

	class short : close {
		burst = 3;
		aiRateOfFire = 2;	// delay between shots at given distance
		aiRateOfFireDistance = 300;
		minRange = 50;
		minRangeProbab = 0.05;
		midRange = 150;
		midRangeProbab = 0.58;
		maxRange = 300;
		maxRangeProbab = 0.04;
	};

	class medium : close {
		burst = 4;
		aiRateOfFire = 3;	// delay between shots at given distance
		aiRateOfFireDistance = 600;
		minRange = 200;
		minRangeProbab = 0.05;
		midRange = 400;
		midRangeProbab = 0.58;
		maxRange = 600;
		maxRangeProbab = 0.04;
	};

	class far : close {
		burst = 6;
		aiRateOfFire = 5;	// delay between shots at given distance
		aiRateOfFireDistance = 1000;
		minRange = 400;
		minRangeProbab = 0.05;
		midRange = 600;
		midRangeProbab = 0.4;
		maxRange = 900;
		maxRangeProbab = 0.01;
	};
	aiDispersionCoefY = 21.0;
	aiDispersionCoefX = 21.0;
	dexterity = 0.51;
	type = 1	 + 	4;
//		type = VArmor;
	ace_type = 5;
	reloadMagazineSound[] = {"\Ca\sounds\Weapons\rifles\reload-belt-1", 0.0562341, 1, 25};
	magazines[] = {"MG1_150Rnd"};
};

class R01 : M16A2 {
	scope = public;
	value = 0;
	displayName = "Rifle Model 1901";
	optics = 1;
	model = "\Roma\R01.p3d";
	picture = "\Roma\gear\R01_icon.paa";
	magazines[] = {"R01_Mag"};
	handAnim[] = {"OFP2_ManSkeleton", "\Ca\weapons\data\Anim\M24.rtm"};
	backgroundReload = true;
	recoil = "recoil_single_primary_6outof10";
	recoilProne = "recoil_single_primary_prone_5outof10";
	aiRateOfFire = 1.1;	// delay between shots at given distance
	aiRateOfFireDistance = 1000;
	modes[] = {"Single"};

	class Single : Mode_SemiAuto {
		sound[] = {"\Roma\sound\R01_shot1.wss", 1.77828, 1, 900};
		recoil = "recoil_single_primary_10outof10";
		recoilProne = "recoil_single_primary_10outof10";
		reloadTime = 1.1;
		dispersion = 0.00012;
	};
};

class R01_Scoped : Rifle {
	scope = public;
	model = "\Roma\R01_Scoped.p3d";
	picture = "\Roma\gear\R01_Scoped_icon.paa";
	displayName = "Rifle 1901 Sharpshooter";
	dexterity = 1.35;
	modelOptics = "\ca\weapons\2Dscope_MilDot_10";
	opticsPPEffects[] = {"OpticsCHAbera1", "OpticsBlur1"};
	opticsFlare = true;
	opticsDisablePeripherialVision = true;
	opticsZoomMin = 0.0249;
	opticsZoomMax = 0.0249;
	opticsZoomInit = 0.0249;
	distanceZoomMin = 300;
	distanceZoomMax = 300;
	handAnim[] = {"OFP2_ManSkeleton", "\Ca\weapons\data\Anim\M24.rtm"};
	begin1[] = {"\Roma\sound\R01_scoped_shot1.wss", 1.77828, 1, 1000};
	soundBegin[] = {"begin1", 1};
	soundContinuous = 0;
	drySound[] = {"Ca\sounds\Weapons\rifles\dry", 0.01, 1, 10};
	reloadMagazineSound[] = {"ca\sounds\weapons\rifles\reload-m16-3", 0.1, 1, 20};
	minRange = 0;
	minRangeProbab = 0.1;
	midRange = 500;
	midRangeProbab = 0.7;
	maxRange = 1000;
	maxRangeProbab = 0.05;
	dispersion = 0.00012;
	magazines[] = {"R01_Mag"};
	reloadTime = 1.1;
	backgroundReload = true;
	recoil = "recoil_single_primary_6outof10";
	recoilProne = "recoil_single_primary_prone_5outof10";
	value = 1000;
	aiRateOfFire = 3.0;	// delay between shots at given distance
	aiRateOfFireDistance = 1000;
};

class M22 : M16A2 {
	scope = 2;
	value = 0;
	displayName = "Model 1922 Kinston Automatic Rifle";
	optics = 1;
	model = "\Roma\M22.p3d";
	picture = "\Roma\gear\M22_icon.paa";
	magazines[] = {"M22_20rnd"};
	handAnim[] = {"OFP2_ManSkeleton", "\Ca\weapons\data\Anim\M24.rtm"};
	modes[] = {"manual", "close", "short", "medium", "far"};

	class manual : Mode_FullAuto {
		recoil = "recoil_single_primary_7outof10";
		recoilProne = "recoil_single_primary_9outof10";
		dispersion = 0.006;
		begin1[] = {"\Roma\sound\M22_shot1", 1.77828, 1, 1000};
		begin2[] = {"\Roma\sound\M22_shot2", 1.77828, 1, 1000};
		begin3[] = {"\Roma\sound\M22_shot3", 1.77828, 1, 1000};
		begin4[] = {"\Roma\sound\M22_shot4", 1.77828, 1, 1000};
		begin5[] = {"\Roma\sound\M22_shot5", 1.77828, 1, 1000};
		soundBegin[] = {"begin1", 0.5, "begin2", 0.5, "begin3", 0.5, "begin4", 0.5, "begin5", 0.5};
		soundContinuous = 0;
		soundBurst = 0;
		minRange = 0;
		minRangeProbab = 0.3;
		midRange = 5;
		midRangeProbab = 0.58;
		maxRange = 10;
		maxRangeProbab = 0.04;
		showToPlayer = true;
		reloadTime = 0.109;
	};

	class close : manual {
		burst = 5;
		aiRateOfFire = 0.5;	// delay between shots at given distance
		aiRateOfFireDistance = 50;
		minRange = 10;
		minRangeProbab = 0.05;
		midRange = 20;
		midRangeProbab = 0.58;
		maxRange = 50;
		maxRangeProbab = 0.04;
		showToPlayer = false;
	};

	class short : close {
		burst = 3;
		aiRateOfFire = 2;	// delay between shots at given distance
		aiRateOfFireDistance = 300;
		minRange = 50;
		minRangeProbab = 0.05;
		midRange = 150;
		midRangeProbab = 0.58;
		maxRange = 300;
		maxRangeProbab = 0.04;
	};

	class medium : close {
		burst = 4;
		aiRateOfFire = 3;	// delay between shots at given distance
		aiRateOfFireDistance = 600;
		minRange = 200;
		minRangeProbab = 0.05;
		midRange = 400;
		midRangeProbab = 0.58;
		maxRange = 600;
		maxRangeProbab = 0.04;
	};

	class far : close {
		burst = 6;
		aiRateOfFire = 5;	// delay between shots at given distance
		aiRateOfFireDistance = 1000;
		minRange = 400;
		minRangeProbab = 0.05;
		midRange = 600;
		midRangeProbab = 0.4;
		maxRange = 900;
		maxRangeProbab = 0.01;
	};
	aiDispersionCoefY = 21.0;
	aiDispersionCoefX = 21.0;
};
};

class cfgVehicles {
class ReammoBox;	// External class reference

class RIAWeaponBox : ReammoBox {
	scope = public;
	accuracy = 1000;	// accuracy needed to recognize type of this target
	displayName = "Roman Imperial Army Weapons";
	model = "\ca\weapons\AmmoBoxes\USBasicWeapons.p3d";

	class TransportMagazines {
		class R36_10rnd {
			magazine = "R36_10rnd";
			count = 200;
		};
		class R36_20rnd {
			magazine = "R36_20rnd";
			count = 200;
		};
		class MG35_60rnd {
			magazine = "MG35_60rnd";
			count = 200;
		};
		class MG1_150rnd {
			magazine = "MG1_150rnd";
			count = 100;
		};
		class R01_Mag {
			magazine = "R01_Mag";
			count = 100;
		};
		class M22_20rnd {
			magazine = "M22_20rnd";
			count = 100;
		};
	};

	class TransportWeapons {
		class R36 {
			weapon = "R36";
			count = 12;
		};
		class R36_Carbine {
			weapon = "R36_Carbine";
			count = 12;
		};
		class R36_Para {
			weapon = "R36_Para";
			count = 12;
		};
		class MG39 {
			weapon = "MG39";
			count = 12;
		};
		class MG35 {
			weapon = "MG35";
			count = 12;
		};
		class MG1 {
			weapon = "MG1";
			count = 12;
		};
		class R01 {
			weapon = "R01";
			count = 12;
		};
		class R01_Scoped {
			weapon = "R01_Scoped";
			count = 12;
		};
		class M22 {
			weapon = "M22";
			count = 12;
		};
	};
};
};

Section focusing on the MG39:

	class MG39 : Rifle {
	scope = public;
	model = "\Roma\MG39.p3d";
	picture = "\Roma\gear\MG39_icon.paa";
	magazines[] = {"MG35_60rnd"};
	displayName = "MG39 Submachine Gun";
	dexterity = 1.75;
	drySound[] = {"\ca\Weapons\Data\Sound\AK47_dry_v1", 0.000316228, 1, 10};
	reloadMagazineSound[] = {"\ca\Weapons\Data\Sound\MP5_reload", 0.001, 1, 20};
	distanceZoomMin = 50;
	distanceZoomMax = 50;
	value = 1000;
	initSpeed = 400;
	modes[] = {"FullAuto"};		
	handAnim[] = {"OFP2_ManSkeleton", "\Ca\weapons\data\Anim\M16GL.rtm"};

	class FullAuto : Mode_FullAuto {
		begin1[] = {"\Roma\sound\MG39_shot1.wss", 1.77828, 1, 1000};
		begin2[] = {"\Roma\sound\MG39_shot2.wss", 1.77828, 1, 1000};
		begin3[] = {"\Roma\sound\MG39_shot3.wss", 1.77828, 1, 1000};
		soundBegin[] = {"begin1", 0.5, "begin2", 0.5, "begin3", 0.5};
		soundContinuous = 0;
		reloadTime = 0.1;
		ffCount = 1;
		recoil = "recoil_auto_primary_2outof10";
		recoilProne = "recoil_auto_primary_prone_2outof10";
		dispersion = 0.003;
		minRange = 0;
		minRangeProbab = 0.2;
		midRange = 20;
		midRangeProbab = 0.7;
		maxRange = 40;
		maxRangeProbab = 0.05;
	};
};

And a link to the P3D:

http://www.speedyshare.com/files/23838309/MG39.p3d

Share this post


Link to post
Share on other sites

I won't help much because I don't model at all... but may be you can find an addon or some original weapon with some of similar parts animated and unpack\extract it's configs and models and see how it works?

Share this post


Link to post
Share on other sites

EDIT: added what I needed to add. Ignore the text which has been crossed out.

Right, well I'm not the most experienced at this but I have added working bolts/mags before.

Anyway, down to business, firstly:

class CfgSkeletons

{

class Default

{

isDiscrete = 1;

skeletonInherit = "";

skeletonBones[] = {};

};

class RomaGun: Default

{

skeletonInherit="";

skeletonBones[]=

{

"magazine","",

"trigger","",

"bolt",""

};

};

};

Needs to be defined with the actual P3D's name, so in this case rather tha calling your class RomaGun you have to call it MG39, you could of course rename your P3D but its probably easier to change the class name. Also I don't believe you need the default class in there at all, below is the corrected version (hopefully) it should work if you copy/pasted this into your model.cfg:

class RomaGun:

{

isDiscrete = 0; --- not too sure what this does but I have mine set to 0 and it works ok

skeletonInherit="";

skeletonBones[]=

{

"magazine","",

"trigger","",

"bolt",""

};

};

};

Much of the model.cfg section seems to be fine for the MG39, the changes I would make are below:

class MG39: RomaGun

{

skeletonName="RomaGun";

class Animations

{

class reload_magazine

{

type="hide";

source="reloadMagazine";

selection="magazine";

hidevalue=1;

};

class trigger

{

type = "rotationZ";

source = "reload";

selection = "trigger";

axis = "trigger_axis";

minValue = 0;

maxValue = 3;

angle0 = 0;

angle1 = -3;

};

class bolt

{

type="translation";

source="reload";

selection="bolt";

axis="bolt_axis";

begin="bolt_axis_begin";

end="bolt_axis_end";

animPeriod=0;

minValue=0;

maxValue=0.09;

offset0="0";

offset1="1";

};

};

sections[]={"zasleh"};

sectionsInherit="";

};

As you can see I have changed the bolt class slightly, I've added in the axis for what it will move along and removed translationX as I don't think thats needed (to specify X that is). I'm not too sure what offset do, I guess its to do with direction of the movement, so from forward then backwards or backwards then forwards. Also, although I have left AnimPeriod in there, you probably don't need that unless you want to make the bolt move more slowly... Also the skeleton name needs to be the same as the skeleton RomaGun you set up earlier.

The only other issue I found was with your model, you need to rename Bolt and Magazine to bolt and magazine. The model.cfg has the selection names in lower case so the selections on the model need to be too.

Edited by STALKERGB

Share this post


Link to post
Share on other sites

You're a life saver, the CfgSkeletons is what was confusing me, the sample Cfgs from BIS are very unclear about a lot of things and horribly messy.

Share this post


Link to post
Share on other sites
You're a life saver, the CfgSkeletons is what was confusing me, the sample Cfgs from BIS are very unclear about a lot of things and horribly messy.

Thats ok mate, if you need any help just say, and I'll do my best. Also hopefully you'll notice but I corrected myself earlier on with the cfgskeletons as (after looking at my weapons model.cfg) you dont need to call the skeleton class after you model name. I've updated my post correcting it. The only thing you need to do is make sure that the skeleton you point your model to in the cfgmodels section is called the same as the skeleton you created in cfgskeletons. With a bit of luck that made sense.

Below is the combined version of the stuff I corrected above,

class CfgSkeletons

class RomaGun:

{

isDiscrete = 0;

skeletonInherit="";

skeletonBones[]=

{

"magazine","",

"trigger","",

"bolt",""

};

};

};

class CfgModels

class MG39: RomaGun

{

skeletonName="RomaGun";

class Animations

{

class reload_magazine

{

type="hide";

source="reloadMagazine";

selection="magazine";

hidevalue=1;

};

class trigger

{

type = "rotationZ";

source = "reload";

selection = "trigger";

axis = "trigger_axis";

minValue = 0;

maxValue = 3;

angle0 = 0;

angle1 = -3;

};

class bolt

{

type="translation";

source="reload";

selection="bolt";

axis="bolt_axis";

begin="bolt_axis_begin";

end="bolt_axis_end";

animPeriod=0;

minValue=0;

maxValue=0.09;

offset0="0";

offset1="1";

};

};

sections[]={"zasleh"};

sectionsInherit="";

};

By the way, nice looking model matey :)

Edited by STALKERGB

Share this post


Link to post
Share on other sites

Yeah, the MG39 and the M22 are the only two that fire from an open bolt, -0.09 for the MG39 and -0.085 for the M22. However when I tried this in-game the bolts no longer moved. I'll give your updated bolt animation a try.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×