Jump to content
distractor2004

Help With Muzzle Flashes on Multiple Weapon Barrels

Recommended Posts

Hello all,

 

I have been trying to create a weapon with different muzzle flashes depending on which muzzle is selected but have been unsuccessful. A version of the Promet contains a underbarrel shotgun that illustrates what I'm trying to do:

 

https://imgur.com/a/Q4OctaW

 

However, I cannot seem to create a similar muzzle flash for the secondary muzzle. I have tried creating "zasleh" and "zasleh2" muzzle flash proxies and copying the ARX model.cfg using ammorandom.0 & ammorandom.1. I have used the exact same proxy/memory points in my model and the exact same code shown below:

 

class CfgSkeletons
{
    class Skeleton
    {
        isDiscrete=0;
        skeletonInherit="";
        skeletonBones[]={"trigger", "", "zasleh", "", "zasleh2", ""};
    };
};
class CfgModels
{
    class customPlasmaRifle
    {
        htMin=0;
        htMax=0;
        afMax=0;
        mfMax=0;
        mFact=0;
        tBody=0;
        skeletonName="Skeleton";
        sectionsInherit="";
        sections[]={"zasleh", "zasleh2", "camo"};
        class Animations
        {      class zaslehrot
            {
                type="rotationx";
                source="ammorandom.0";
                selection="zasleh";
                sourceAddress="loop";
                minPhase=0;
                maxPhase=4;
                minValue=0;
                maxValue=4;
                memory=0;
                angle0=0;
                angle1=6.283185;
            };
            class zasleh2rot
            {
                type="rotationx";
                source="ammorandom.1";
                selection="zasleh2";
                sourceAddress="loop";
                minPhase=0;
                maxPhase=6;
                minValue=0;
                maxValue=6;
                memory=0;
                angle0=0;
                angle1=6.283185;
            };
            class zasleh_hide
            {
                type="hide";
                source="reload.0";
                selection="zasleh";
                sourceAddress="clamp";
                minPhase=0;
                maxPhase=1;
                minValue=0;
                maxValue=1;
                memory=0;
                hideValue=0;
                unHideValue=0.5;
            };
            class zasleh2_hide
            {
                type="hide";
                source="reload.1";
                selection="zasleh2";
                sourceAddress="clamp";
                minPhase=0;
                maxPhase=1;
                minValue=0;
                maxValue=1;
                memory=0;
                hideValue=0;
                unHideValue=0.5;
            };
		};
	};
};

 

but my weapon only seems to only create the "zasleh" muzzleflash when using the primary muzzle but does not create a "zasleh2" muzzle flash when I switch to my secondary muzzle. Has anyone figured out how to show multiple muzzle flashes from different barrels for an infantry weapon?

 

Thanks in advance!

 

Share this post


Link to post
Share on other sites

I would imagine (Kllrt confirmed it) it is using the reload and perhaps also ammoRandom sources, but indexed to the second muzzle

e.g. reload.1 ammoRandom.1 as sources

 

Gunpods on dynamic loadouts aircraft have to use reload for the muzzle flashes, since the native zasleh hide stuff is not supported outside the main body of the aircraft. So can use similar workarounds.

Example from a gunpod here:

but use reload.1

 

Edit:-

Reyhard has also shared some information that the game doesn't recognise a second proxy for a second muzzle (only multiple proxies for the same muzzle), so it might be necessary to physically place the muzzle flash model inside the weapon as well (in my experience this may also require adding forceNotAlpha property to the geometry LOD, to stop the weapon then rendering behind hands in first person view)

Share this post


Link to post
Share on other sites
11 hours ago, da12thMonkey said:

I would imagine (Kllrt confirmed it) it is using the reload and perhaps also ammoRandom sources, but indexed to the second muzzle

e.g. reload.1 ammoRandom.1 as sources

 

Gunpods on dynamic loadouts aircraft have to use reload for the muzzle flashes, since the native zasleh hide stuff is not supported outside the main body of the aircraft. So can use similar workarounds.

Example from a gunpod here:

but use reload.1

 

Edit:-

Reyhard has also shared some information that the game doesn't recognise a second proxy for a second muzzle (only multiple proxies for the same muzzle), so it might be necessary to physically place the muzzle flash model inside the weapon as well (in my experience this may also require adding forceNotAlpha property to the geometry LOD, to stop the weapon then rendering behind hands in first person view)

Thank you for this info. I'm going to apply these tips and report my findings as soon as possible.

 

Update: It worked! Thank you so much for your advice. I do not have my own custom model to show yet, but once I do I will post screenshots to go along with these basic steps. Per your advice, here is how I was able to produce a secondary muzzle flash for an under-barrel weapon:

 

1. I pasted the physical model of a muzzle flash into the 0 LOD  (to be clear: NOT a proxy) and named the selection "muzzleflash2".

2. I went to Geometry LOD and created a new Property named forceNotAlpha with a Value of 1.

3. In my model config, I added the "muzzleflash2" selection to "SkeltonBones[]" and "sections[]" and list it as a selection within a "class zasleh2_hide" Animation, as shown below:

class CfgSkeletons
{
	class Default
	{
		isDiscrete = 1;
		skeletonInherit = "";
		skeletonBones[] = {};
	};
	class customPlasmaRifle_base : Default
	{
		SkeletonBones[]=
		{
			"trigger","",
			"magazine","",
			"zasleh","","muzzleflash2",""//muzzleflash2 model added as a bone
		};
	};
};
class CfgModels
{
	class Default
	{
		sections[] = {};
		sectionsInherit="";
		skeletonName = "";
	};
	class max_plasma_rifle3 : Default
	{
		skeletonName="customPlasmaRifle_base";
		sections[] = {"zasleh","muzzleflash2","Camo"};//muzzleflash2 model added as section
		class Animations
		{
					class trigger
					{
						type="rotation";
						angle0=0;
						angle1=-0.5235988;
						axis="zbran";
						memory=1;
						minValue=0;
						maxValue=1;
						minPhase=0;
						maxPhase=1;
						source="reload";
						sourceAddress=0;
						selection="trigger";
					};
					class zaslehrot
            		{
               		 	type="rotationX";
                		source="ammorandom.0";
                		selection="zasleh";
						axis = "";
                		sourceAddress="loop";
						centerFirstVertex=true;
                		minPhase=0;
                		maxPhase=4;
                		minValue=0;
                		maxValue=4;
                		memory=0;
                		angle0="rad 0";
                		angle1="rad 360";
           	 		};
            		/*class zasleh2rot		//Hiding second muzzle's rotation for now. Will work on keeping it centered later.
            		{
                		type="rotationX";
                		source="ammorandom.1";
                		selection="muzzleflash2";
						axis = "";
                		sourceAddress="loop";
						centerFirstVertex=true;
                		minPhase=0;
                		maxPhase=6;
                		minValue=0;
                		maxValue=6;
                		memory=0;
                		angle0="rad 0";
                		angle1="rad 360";
            		};*/
					class zasleh_hide
            		{
                		type="hide";
                		source="reload.0";
                		selection="zasleh";
               			sourceAddress="clamp";
                		minPhase=0;
                		maxPhase=1;
                		minValue=0;
                		maxValue=1;
                		memory=0;
                		hideValue=0;
                		unHideValue=0.5;
            		};
            		class zasleh2_hide
            		{
                		type="hide";
                		source="reload.1";
                		selection="muzzleflash2";//muzzleflash2 model added as selection
                		sourceAddress="clamp";
                		minPhase=0;
                		maxPhase=1;
                		minValue=0;
                		maxValue=1;
                		memory=0;
                		hideValue=0;
                		unHideValue=0.5;
            		};
		};
	};
};

4. After compiling, the secondary muzzle flash shows up in Arma 3, at least in 3rd person. I'll try to figure out proper rotation and viewing the muzzleflash in 1st person (maybe need to add another LOD?) and post further updates as I progress.

 

Thanks again for all the info!

Edited by distractor2004
Successfully added secondary Muzzle Flash!

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

×