Jump to content

Recommended Posts

Can someone help me with this:

 

Trying to make a pylon based cannon, similar to the 20mm_twin_cannon of the vanilla buzzard.

I have managed to set it up. The wing mounted cannon shows up and can be fired.

 

Now I wonder how I can make the muzzle flash work.

It must be outside of the plane config, as the original vanilla 20mm_twin has muzzleflashes on any plane I attach it too.

 

Anyone know how it is done? 

 

 

 

 

 

relevant config example from vanilla buzzard for anyone interested:

 

Spoiler

// from cfgMagazine
	
	class 300Rnd_20mm_shells: VehicleMagazine
	{
		author="$STR_A3_Bohemia_Interactive";
		scope=2;
		displayName="$STR_A3_CfgMagazines_1000Rnd_20mm_shells0";
		displayNameShort="$STR_A3_CfgMagazines_300Rnd_20mm_shells_dns";
		ammo="B_20mm";
		count=300;
		initSpeed=1030;
		maxLeadSpeed=85;
		tracersEvery=5;
		nameSound="cannon";
		muzzleImpulseFactor[]={-0.025,0.1};
	};

	class PylonWeapon_300Rnd_20mm_shells: 300Rnd_20mm_shells   // this is the actual pylon "magazine" = cannon
	{
		displayName="$STR_A3_twin_cannon_20mm";
		model="\A3\Weapons_F\DynamicLoadout\PylonPod_Twin_Cannon_20mm.p3d";
		muzzlePos="muzzlePos";
		muzzleEnd="muzzleEnd";
		hardpoints[]=
		{
			"B_A143_BUZZARD_CENTER_PYLON",
			"20MM_TWIN_CANNON"
		};
		pylonWeapon="Twin_Cannon_20mm";
		mass=230;
	};


// from cfg weapons
	

	class gatling_20mm: CannonCore
	{
		scope=1;
		displayName="$STR_A3_GATLING_20MM0";
		nameSound="cannon";
		cursor="EmptyCursor";
		cursorAim="mg";
		magazines[]=
		{
			"2000Rnd_20mm_shells",
			"1000Rnd_20mm_shells",
			"300Rnd_20mm_shells",
			"PylonWeapon_300Rnd_20mm_shells"  // here the "magazine" has to be referenced in the weapon
		};
	...
	...
	...
	};


	class Twin_Cannon_20mm: gatling_20mm
	{
		displayName="$STR_A3_twin_cannon_20mm";
		showAimCursorInternal=0;
		canLock=0;
		ballisticsComputer="4 + 8";
		class manual: manual
		{
			displayName="$STR_A3_twin_cannon_20mm";
		};
	};

 


 

 

Edited by DSabre
*next question*

Share this post


Link to post
Share on other sites

You use the reload animation source in the model.cfg of the gunpod.

e.g.

			class mg_muzzle_flash
			{
				type		= "hide";
				source		= "reload";
				selection	= "muzzleFlash";
				minValue	= 0;
				maxValue	= 1;
				hideValue	= 0;
				unhidevalue	= 0.005;
			};
			class mg_muzzleFlashROT
			{
				type				= "rotationZ";
				source				= "timeRndOffset";      
				sourceAddress		= "loop";     
				selection			= "muzzleFlash";
				axis				= "";
				centerFirstVertex	= true;  
				minValue			= 0;
				maxValue			= 0.14;               
				angle0				="rad 0";
				angle1				="rad 360";
			};

 

Share this post


Link to post
Share on other sites

Thank you very much!

What cfgmodels/cfgskeletons class does a proxy weapon use? I am only familiar with class ArmaMan or class plane.

Is there any example model.cfg available somewhere?

Share this post


Link to post
Share on other sites

It uses what ever skeleton you make for it.

 

You don't have to make skeletons for vehicles, weapons etc. that are inheriting from existing ones - It merely makes it easier when you're making a model that has a lot of common bone names and animations in common with a similar base skeleton, and don't want to rewrite it all.

 

It's important for character stuff - vests, helmets etc. because they have to follow the same .rtm animations from the base character (uniform) model, and are weighed to a common A3 human skeleton to facilitate that.

 

The skele I wrote for the RHS AH-6's gunpods (both M134 and GAU-19) is just this:

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

			"muzzleFlash","",
			"barrel",""
		};
	};
};

 

Those are the only two bones I needed to animate. barrel is used for rotating the barrels on the gatling guns, using the revolving source, and you have the muzzleFlash anim above.

Inheriting from class Default isn't really necessary since I set isDiscrete = 1; anyway, but it's somewhat conventional to do so.

  • Thanks 1

Share this post


Link to post
Share on other sites

awesome, many thanks!!

 

***edit: it works! on first attempt. thx again ***

 

 

my proxy cannon for anyone who is interested:

Spoiler

my config for anyone interested:

 

 

cfgammo:

 


...
...
...
class B_30mm_AP;

class sab_B_37mm_ap_ammo : B_30mm_AP {
        model = "\A3\Weapons_f\Data\bullettracer\tracer_white";
        
        hit = 120;
        indirectHit = 5;
        indirectHitRange = 0.5;
        caliber=7;
        deflecting=10;
        typicalSpeed = 1200;
        airFriction = -0.00069;
        tracerScale = 6;
        tracerStartTime = 0.01;
        tracerEndTime = 2.5;

        cost=40;
        aiAmmoUsageFlags=128;
    
    };
...
...
...

 

cfgmagazine:

 


...
...

class VehicleMagazine;

class sab_24rnd_37mm_mag : VehicleMagazine {
		author="[Dust]Sabre";
		displayName="37 mm";
		displayNameShort ="37 mm";
		
		ammo = "sab_B_37mm_ap_ammo";
		scope = public;

	
		initSpeed = 750;
		maxLeadSpeed=85;		
		count = 24;
		tracersEvery = 1;
		
		nameSound="cannon";
		muzzleImpulseFactor[]={-0.025,0.1};
		
	};

	class sab_cannon_37_ap_pylonweapon : sab_24rnd_37mm_mag	{
		
		scope = public;
		
		displayName="BK 37 mm AP";
		displayNameShort = "37 mm AP";

		count=18;
	
		muzzlePos="muzzlePos";
		muzzleEnd="muzzleEnd";
		hardpoints[]=	{"20MM_TWIN_CANNON", "SAB_CANNON_37"};
		ammo = "sab_B_37mm_ap_ammo";
		model = "\sab_secretweapons\weapons\sab_bk37.p3d";
		
		pylonWeapon="sab_pylon_37mm_cannon";
		
		mass=230;
		
	};
	
	class sab_cannon_37_he_pylonweapon : sab_cannon_37_ap_pylonweapon	{
		
	
		displayName="BK 37 mm HE";
		displayNameShort = "37 mm HE ";
		count=18;
		ammo = "sab_B_37mm_he_ammo";
		
	};

...
...
...

cfgweapons:

 


...
...
...
class Twin_Cannon_20mm;

class sab_pylon_37mm_cannon : Twin_Cannon_20mm {
		magazines[] = {"sab_24rnd_37mm_mag","sab_cannon_37_ap_pylonweapon","sab_cannon_37_he_pylonweapon"};
		displayName = "BK 37";	
		showAimCursorInternal=1;
		
		class manual : MGun {
			reloadTime = 0.5;
			
		};
		
		class GunParticles
		{	
			
			class FirstEffect
			{
				effectName="CannonFired";
				positionName="Usti hlavne";
				directionName="Konec hlavne";
			};
			
			class Shell
			{
				positionName="shell_eject_pos";
				directionName="shell_eject_dir";
				effectName="HeavyGunCartridge1";
			};
		};
	};
...
...
...

 

 

model.cfg

 


class CfgSkeletons
{
	class Default;
	class sab_bk37skeleton: Default
	{
		isDiscrete = 1;
    	skeletonInherit="Default";
		skeletonBones[]=
		{
			"muzzleFlash","",
			
		};
	};
};


class CfgModels
{
	class Default;
	
	class sab_bk37: Default
	{
		skeletonName="sab_bk37Skeleton";
		sections[]=
		{
			"muzzleFlash","",
		};
		
		class Animations
		{	
		
			class muzzleFlash_hide
			{
				type			= "hide";
				source		= "reload"; // reload
				selection	= "muzzleFlash";
				minValue	= 0;
				maxValue	= 1;
				hideValue	= 0;
				unhidevalue	= 0.005;
			};
		
		
			class muzzleFlash_rot
			{
				type="rotationZ";
				source="timeRndOffset";            //use ammo count as phase for animation
				sourceAddress="loop";     //loop when phase out of bounds
				selection="muzzleFlash";       //selection we want to rotate
				axis="";                  //no own axis - center of rotation is computed from selection
				centerFirstVertex=true;   //use first vertex of selection as center of rotation
				minValue=0;
				maxValue=4;               //rotation angle will be 360/4 = 90 degrees
				angle0="rad 0";
				angle1="rad 360";
			};			
			
				
		};
	};

};

 

 

P3D:

 

p3d_1.png

muzzleflash

 

 

p3d_2.png

muzzle and chamber

 

 

Edited by DSabre
added reference setup

Share this post


Link to post
Share on other sites

@DSabre and @da12thMonkey thank you both for this thread. I've been struggling with trying to get a pylon cannon to animate for a while now.  I stumbled across this thread today and you've helped me fix it.

  • Thanks 1

Share this post


Link to post
Share on other sites

Hey, got to gravedigg this thread as well a little bit.

 

Did you really get the shells to eject, as well as the smoke effect? I'm trying to get this done right now, but it just won't work and it drives me crazy. I have the memory points in my p3d and reference them in the GunParticles class in CfgWeapons. The muzzleflash is no problem.

Share this post


Link to post
Share on other sites

afaik there are no shell ejects or muzzle effects other than the flash in proxy weapons. the points in my examples are there because i tried. never worked that far.

but i am happy having the flash at least

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

×