Jump to content
Sign in to follow this  
AmericanFAC

How to make Animations for A3A

Recommended Posts

I've spent about the past 2 hours gathering information from multiple arma/ofp websites on how to make animations work with weapons. My understanding is that it goes like this:

Define the selections : "magazine,bolt, etc"

Define those selections in cfg skeleton

Define those selections again in cfg models

Make an animation class in cfg models and then do the animating there.

So while reading this it says a3 allows me to fold optics. Well, when I define optics selections, put that code into the cfg model, it doesn't work.

Another example would be I break apart the cfgskeleton/cfgmodel of another mod that I have to see if the person did something that I did not. Even if I change my model's selections to match theirs it still doesn't work.

Is there something I am missing in this process?

Here is the model.cfg as of right now.

 class CfgSkeletons
{
class Default;
class Weapon: Default
{
	isDiscrete = 0;
	skeletonInherit = "Default";
	skeletonBones[]=
	{
		"magazine",
	};
};

};
class CfgModels
{
class Default;
class Weapon: Default
{
	sections[]=
	{
		"zasleh"
	};
	skeletonName="Weapon";
	class Animations
	{
		class magazine_hide
		{
			type="hide";
			source="reloadMagazine";
			selection="magazine";
			minValue=0.200000;
			maxValue=1.000000;
			hideValue=0.220000;
			unhidevalue = 0.550;
		};
	};
};

};

Edited by AmericanFAC

Share this post


Link to post
Share on other sites

your model.p3d is called weapon? something that is easy to miss, the class defined in cfgmodels must have the same name that the p3d model.. so if your model is called MY_AK47.p3d the class name in cfgweapon should be class MY_AK47 thats how the engine link the model with the model.cfg.

If that is ok it should work!

Share this post


Link to post
Share on other sites

Therefore this should work right?

 class CfgSkeletons
{
class Default
	{
	isDiscrete = 1;
	skeletonInherit = "";
	skeletonBones[] = {};
	};
class m4 : Default
	{
	isDiscrete = 0;
	skeletonBones[]=
	{
		"magazine",
	};
	};

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

	class Animations
	{
		class magazine_hide
		{
			type="hide";
			source="reloadMagazine";
			selection="magazine";
			minValue=0.200000;
			maxValue=1.000000;
			hideValue=0.220000;
			unhidevalue = 0.550;
		};
	};
};
class m4_iron : m4;
class m4_gl : m4;
class m4_gl_iron : m4;
};

Nope, didn't work. Changed the reloadaction to reloadmagazine thinking it would pick it up. Sadly, it didn't

Edited by AmericanFAC

Share this post


Link to post
Share on other sites

Doesn't fix the issue at all, even the optics flipping doesn't work. Nothing, and I mean NOTHING animated.

Share this post


Link to post
Share on other sites

Weid is almost like the config I use, the only diference are skeletoninherit and sections inherits, if adding that doesnt work, it might not be the model.cfg the problem :S

this config works but i dont know if that fix your problem, check the "inherit" lines

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

class ft_fnfal_ske: Default
{
	isDiscrete = 0;
	skeletonInherit = "Default";
	skeletonBones[]=
	{
		"magazine",	"",
		"bolt", ""
	};
};
};

class cfgModels
{
   class Default
   {
       sectionsInherit="";
       sections[] = {};
       skeletonName = "";
   };

class ft_fnfal_test : Default {
       sectionsInherit="Default";
	sections[]=	{ "zasleh" };
	skeletonName="ft_fnfal_ske";
	class Animations
	{
		class Test_Weapon_bolt_action
		{
			type="translationX";
			source="reload";
			selection="bolt";
			axis="";
			memory="false";
			animPeriod=0;
			minValue=0;
			maxValue=0.10;
		};
		class Test_Weapon_bolt_empty
		{
			type="translationx";
			source="isEmpty";
			selection="bolt";
			axis="";
			memory="false";
			animPeriod=0;
			minValue=0;
			maxValue=0.10;
		};
		class Test_Weapon_magazine_hide
		{
				type = "hide";
				source = "reloadMagazine";
				selection = "magazine";
				minValue = 0.000000;
				maxValue = 1.00000;
				hideValue = 0.220;
				unhideValue = 0.550;
			};
			class MuzzleFlashROT
			{
				type="rotationX";
				source="ammoRandom";            //use ammo count as phase for animation
				sourceAddress="loop";     //loop when phase out of bounds
				selection="zasleh";       //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 muzzleflash_hide
{
   type="hide";
   source="hasSuppressor";
   selection="zasleh";
   minValue = 0.0;
   maxvalue = 0.25;
   hideValue = 0.01;
};
	};
};
class ft_fnfal : ft_fnfal_test{};
class ft_fnfal_rail : ft_fnfal_test{};
class ft_fnfal_para : ft_fnfal_test{};
//class ft_fmk3_sil : ft_fmk3{};
};

Share this post


Link to post
Share on other sites

Okay, I see what I did.

The initial class name has to be the exact name of the model, not the cfgweapon classname that the model is assigned to. Still can't get the ironsights to flip, but atleast I have a magazine that'll dissapear!

Alright, new question.

I have the iron sights named backsight as a selection in the main and pilot lods, and an axis in the memory called backsight_axis. It is set to the source of "hasOptics".

Do I need to define that source in the weapons config? Because it isn't doing anything when I assign or remove the optics in game.

Edited by AmericanFAC

Share this post


Link to post
Share on other sites

I guess this is a better representation. Similar problem to the backsights not flipping.

I have the bolt defined as a selection.

In the modelcfg I am telling it to do something when it reloads.

In game it does nothing.

3d9IS9.jpg

Edited by AmericanFAC

Share this post


Link to post
Share on other sites

Angle values are not required in a translation animation, neither is phase. What you're looking for is offset0 and offset1. axis is not required if you're using translationz because translationz automatically uses the z axis. I would suggest just using translation.

Share this post


Link to post
Share on other sites

Yeah, offset did it. I also got it to work with the axis so that I can have the bolt rotate. Now I need to find a tutorial on .rtm's so that I can make custom anims without O2 crashing.

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  

×