Jump to content
Sign in to follow this  
alleycat

No muzzle flash

Recommended Posts

I have no muzzle flash on my weapon. It does however spawn smoke puffs at the muzzle and the bullets spawn too. But no actual flash. it is derived from the Vermin and I have seen the suppressor changes topic

model.cfg

class CfgSkeletons
{
class Default
{
	isDiscrete=1;
	skeletonInherit="";
	skeletonBones[]={};
};
class tb_arifle_m16a4_base: Default
{
	skeletonBones[]=
	{
		"trigger",		"", /// not in this model, but good to use
		"bolt",			"",
		"bolt_catch",	"",
		"magazine",		"",
		"safety",		"",
		"muzzleFlash",	"",
		"OP",			"",
		"ForeSight",	"",
		"BackSight",	""
	};
};

};
class CfgModels
{
class Default
{
	sectionsInherit="";
	sections[]={};
	skeletonName="";
};
class tb_arifle_m16a4_base: Default
{
	sections[]=
	{
		"magazine",
		"bolt"
	};
	skeletonName="tb_arifle_m16a4_base";
	class Animations
	{
	};
};
class cat_thompson_stick: tb_arifle_m16a4_base
{
	class Animations
	{
			class MuzzleFlashROT
			{
				type="rotationX";
				source="ammoRandom";            //use ammo count as phase for animation
				sourceAddress="loop";     //loop when phase out of bounds
				selection="Nabojnicestart";       //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";
			};
		/*
		class bolt_fire_begin
		{
			type="translation";
			source="reload";
			selection="bolt";
			axis="bolt_axis";
			memory=1;
			minValue=0.000000;
			maxValue=0.300000;
			offset0=0;
			offset1=0.5;
		};

		class bolt_fire_end:bolt_fire_begin
		{
			minValue=0.500000;
			maxValue=1.000000;
			offset0=0;
			offset1=-0.5;
		};
		*/

		class bolt
		{
			type = "translation";
			source = "reload";
			selection = "bolt";
			axis = "bolt_axis";
			minValue = 0;
			maxValue = "1";
			offset0 = "0";
			offset1 = "1";
		};


	};			

	};
};
};

Share this post


Link to post
Share on other sites

Do you have a muzzle flash proxy in your model?

If you do, what's the selection called: 'muzzleFlash' or 'zasleh'?

Share this post


Link to post
Share on other sites

I placed a proxy for muzzle with this in the proxy name: \A3\data_f\proxies\weapon_slots\MUZZLE

then I made a selection with that proxy selected and called it zasleh. However what confuses me is that on the example weapon, the selection is called muzzleflash and it is pointing to a diferent proxy with a different name. And in zachs tutorial this selection does not exist at all.

Share this post


Link to post
Share on other sites

The MUZZLE proxy is for muzzle attachments like silencers, there should be another proxy there that's pathed to a file in \A3\Data_f\proxies\muzzle_flash\ - this second proxy is the one that provides the muzzle flash, and should have been the one you named 'zasleh'

It's called 'zasleh' in most game models and community addons but doesn't have to be. BIS changed its name in the example (to muzzleFlash) to prove that we don't need to use the original Czech names for any selections. Back in OFP all model selections were in Czech, and you had to use those exact the same names for selections in your model: So there's still a bit of a lingering urge to copy the BIS names (hence a lot of people still use the name 'zasleh'), even though this isn't true in most cases and hasn't been the case since Arma 1 allowed us to define custom selection names and animate them with what has become the model.cfg.

But yes, copy that muzzle flash proxy from the test weapon and re-path it to a different model in the \A3\Data_f\proxies\muzzle_flash\ folder if you want to use a different muzzle flash shape. Then either keep it named 'muzzleFlash', or rename it 'zasleh' (remember to remove the old 'zasleh' selection you have applied to your MUZZLE suppressor slot)

Your config.cpp will require a line that says:

		selectionFireAnim = "muzzleFlash";

Again, you might want to change this to zasleh, or you may already have this line saying selectionFireAnim = "zasleh"; depending on what you based your weapon config on.

Lastly, your model.cfg will want to look like this:

class CfgSkeletons
{
class Default
{
	isDiscrete=1;
	skeletonInherit="";
	skeletonBones[]={};
};
class tb_arifle_m16a4_base: Default
{
	skeletonBones[]=
	{
		"trigger",		"", /// not in this model, but good to use
		"bolt",			"",
		"bolt_catch",	"",
		"magazine",		"",
		"safety",		"",
		"muzzleFlash",	"",
		"OP",			"",
		"ForeSight",	"",
		"BackSight",	""
	};
};

};
class CfgModels
{
class Default
{
	sectionsInherit="";
	sections[]={};
	skeletonName="";
};
class tb_arifle_m16a4_base: Default
{
	sections[]=
	{
		"magazine",
		"bolt",
		"muzzleFlash"
	};
	skeletonName="tb_arifle_m16a4_base";
	class Animations
	{
	};
};
class cat_thompson_stick: tb_arifle_m16a4_base
{
	class Animations
	{
			class MuzzleFlashROT
			{
			type="rotationX";
			source="ammoRandom";      //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";
			};
		/*
		class bolt_fire_begin
		{
			type="translation";
			source="reload";
			selection="bolt";
			axis="bolt_axis";
			memory=1;
			minValue=0.000000;
			maxValue=0.300000;
			offset0=0;
			offset1=0.5;
		};

		class bolt_fire_end:bolt_fire_begin
		{
			minValue=0.500000;
			maxValue=1.000000;
			offset0=0;
			offset1=-0.5;
		};
		*/

		class bolt
		{
			type = "translation";
			source = "reload";
			selection = "bolt";
			axis = "bolt_axis";
			minValue = 0;
			maxValue = "1";
			offset0 = "0";
			offset1 = "1";
		};

	};			

};
};

And yet again, you might want to change the references from muzzleFlash, to zasleh, depending on what you call the selection.

Share this post


Link to post
Share on other sites

This advice fixed it for the most part, the muzzle flash now appears and it explained how the proxy system works. However one tiny issue:

arma3_2014_08_09_21_58_49_2.jpg

The muzzle is offset about 0.5m down and 20cm to the left (which looks like the player models center axis)

Share this post


Link to post
Share on other sites

comment out this animation

   class MuzzleFlashROT
            {
               type="rotationX";
               source="ammoRandom";      //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";
            }; 

and check again.

Also, how is your proxy positioned? you might have chosen the wrong vertex

Share this post


Link to post
Share on other sites

prox.jpg

commenting teh animation out does not change it.

What do you mean by chosen wrong vertex?

Share this post


Link to post
Share on other sites

Yea, comment that out for a sec - it is probably related to that animation. You'll probably want to put it back later (with some fixes) to randomise the muzzle flash shape a bit, but for the meantime it'll indicate if the muzzle flash proxy is in the right place to begin with.

When it comes to adding the animation back in, first check that you have autocenter = 0 in the geometry LOD's named properties (described here).

If that doesn't work (or you already have the autocenter property and it's not working) try changing the centerFirstVertex = true; value to centerFirstVertex= 1; - sometimes in configs true/false text strings need to be defined as having a 1/0 boolean value before they work, so entering the bool value directly instead of 'true' might fix it.

Finally, if all else fails, change that animation to this:

  class MuzzleFlashROT
            {
               type="rotationX";
               source="ammoRandom";      //use ammo count as phase for animation
               sourceAddress="loop";     //loop when phase out of bounds
               selection="muzzleFlash";  //selection we want to rotate
               axis="flashROT_axis";
               memory = 1;
               minValue=0;
               maxValue=4;               //rotation angle will be 360/4 = 90 degrees
               angle0="rad 0";
               angle1="rad 360";
            };  

And create an axis along the bore-line of your barrel called 'flashROT_axis' (using two memory points as per usual)

Share this post


Link to post
Share on other sites

The autocenter property fixed it. Thanks both for helping to get this to work.

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  

×