Jump to content
Sign in to follow this  
Johno89

Animation problem - cant translate -Y?

Recommended Posts

Hi,

I am trying to animate weapon hatches on my attack helicopter. It's a two stage animation; 1st anim phase weapon hatch moves down slightly (translation -y). The is to help prevent clipping with the main body when 2nd anim phase (rotation) occurs.

The problem I can't figure out is translation Y, making the hatch move in negative Y direction. Right now it will only move up in the positive. Any attempts at altering the model.cfg results in translation ignored and rotation only occurring. I've attached my cfg file and omitted parts for easier reading.

I've searched the forums but cant find anything that would help. Thanks for your time.

class CfgSkeletons
{
class Default
{
	isDiscrete = 1;
	skeletonInherit = "";
	skeletonBones[] = {};
};
class heli_skeleton: Default
{
	skeletonInherit="";
	isDiscrete=0;
	skeletonBones[]=
               {
//weapon bay
		"l_holdster","",
               };
};
};
class Rotation
{
type = "rotation";
memory = 1;
minValue = 0;
maxValue = 1;
angle0 = 0;
angle1 = 1;
};
class CfgModels
{
class Default
{
	sectionsInherit="";
	sections[] = {};
	skeletonName = "";
};
class heli: Default
{
	skeletonName="heli_skeleton";
	sectionsInherit="";
	sections[]=
	{

	};
	class Animations
	{
//weapons bay	
		class l_holdster_1pass
		{
			type="translationY";
			source="maxHoldsterValue";
			selection="l_holdster";
			minValue="0";
			maxValue="0.1";
		};
		class l_holdster_2pass: l_holdster_1pass
		{
			type="rotation";
			source="maxHoldsterValue";
			memory=1;
			selection="l_holdster";
			axis="l_holdster_axis";
			minValue=1;
			maxValue=2;
			minPhase=0;
			maxPhase=1;
			angle0=0;
			angle1=2;		
		};
	};
};
};

Share this post


Link to post
Share on other sites

Your model config is slightly wrong in the class that has translation.

Look at mine here

http://forums.bistudio.com/showthread.php?177802-animations-inside-a-vehicle-help

You need to add offset0-1

Also remove that coma from the skeleton bone list. The last(which in your case is the only one) bone definition does not get a coma at the end

Edited by M1lkm8n

Share this post


Link to post
Share on other sites

M1lkm8n you are the best haha.

Ok i'll give the offset value a try and hopefully it'll work. No need to worry about the coma, i removed other skeleton bones from the list to save reading time. 'l_holdster' isnt the last named selection which is why it has a coma in this instance. :)

Unfortunately the offset values haven't worked. Am able to define the direction (-ve or +ve) the selection moves in some other way? So far i have attempted "translation-Y" and max value to "-1" but this hasn't worked.

Edited by Johno232

Share this post


Link to post
Share on other sites

Post your whole model config with the newly added parts. For future reference post your whole configs. Sometimes you can make a mistake just copying it over and that makes it harder to figure out the problem. If it to long for here use pastebin then post the link.

Share this post


Link to post
Share on other sites

Sorry late reply, here is my model.cfg.

class CfgSkeletons
{
class Default
{
	isDiscrete = 1;
	skeletonInherit = "";
	skeletonBones[] = {};
};
class heli_skeleton: Default
{
	skeletonInherit="";
	isDiscrete=0;
	skeletonBones[]=
	{
//rotors
		"velka vrtule","",
		"mala vrtule","",
//doors
		"door_1","",
		"door_2","",
//weapon bay
		"l_holdster","", 
//front left gear
		"fl_gear_a","",
		"fl_gear_w","fl_gear_a",
		"fl_gear_a","",
		"fl_gear_b","fl_gear_a",
		"fl_gear_b","",
		"fl_gear_c","fl_gear_b",
		"fl_gear_h1","",
//front right gear
		"fr_gear_a","",
		"fr_gear_w","fr_gear_a",
		"fr_gear_a","",
		"fr_gear_b","fr_gear_a",
		"fr_gear_b","",
		"fr_gear_c","fr_gear_b",
		"fr_gear_h1","",
//rear gear	
		"r_gear","",
		"r_gear_h1","",
		"r_gear_h2",""	
	};
};
};
class Rotation
{
type = "rotation";
memory = 1;
minValue = 0;
maxValue = 1;
angle0 = 0;
angle1 = 1;
};
class CfgModels
{
class Default
{
	sectionsInherit="";
	sections[] = {};
	skeletonName = "";
};
class heli: Default
{
	skeletonName="heli_skeleton";
	sectionsInherit="";
	sections[]=
	{

	};
	class Animations
	{
//rotors
		class HRotor
  			{
  				type="rotationY";
   				source="rotorH";
   				selection="velka vrtule";
   				axis="velka osa";
   				memory=1;
   				sourceAddress="loop";
   				minValue=0;
   				maxValue=1;
   				angle0=0;
   				angle1="rad +360";
  			};
  			class HRotor2
  			{
   				type="rotationY";
   				source="rotorH";
   				selection="mala vrtule";
   				axis="mala osa";
   				memory=1;
   				sourceAddress="loop";
   				minValue=0;
   				maxValue=1;
   				angle0=0;
   				angle1="rad -360";
  			};
//doors
		class door_1
		{
			type="rotation";
			source="Doors";
			selection="door_1";
			axis="door_1_axis";
			memory=1;
			animPeriod=1;
			angle0=0
			angle1=1	
		};
		class door_2
		{
			type="rotation";
			source="Doors";
			selection="door_2";
			axis="door_2_axis";
			memory=1;
			animPeriod=1;
			angle0=0
			angle1=-1	
		};
//weapons bay	
		class l_holdster_1pass
		{
			type="translationY";
			source="maxHoldsterValue";
			selection="l_holdster";
			minValue="0";
			maxValue=".01";	
		};
		class l_holdster_2pass: l_holdster_1pass
		{
			type="rotation";
			source="maxHoldsterValue";
			memory=1;
			selection="l_holdster";
			axis="l_holdster_axis";
			minValue=1;
			maxValue=2;
			minPhase=0;
			maxPhase=1;
			angle0=0;
			angle1=2;		
		};
//front left gear	
		class fl_gear_1pass
		{
			type="rotation";
			source="gear";
			selection="fl_gear_a";
			axis="fl_gear_a_axis";
			memory=1;
			minValue=0;
			maxValue=1;
			angle0=0;
			angle1=1.1;
		};
		class fl_gear_2pass: fl_gear_1pass
		{
			type="translation";
			minValue="0.2";
			maxValue="0.5";
			offset0="0";
			offset1="0";
		};
		class fl_gear_b
		{
			type="rotation";
			source="gear";
			selection="fl_gear_b";
			axis="fl_gear_b_axis";
			memory=1;
			minValue=0;
			maxValue=1;
			angle0=0;
			angle1=0.9;
		};
		class fl_gear_c_1pass
		{
			type="rotation";
			source="gear";
			selection="fl_gear_c";
			axis="fl_gear_c_axis";
			memory=1;
			minValue=0;
			maxValue=1;
			angle0=0;
			angle1=-2.6;
		};
		class fl_gear_c_2pass: fl_gear_c_1pass
		{
			type="translation";
			minValue="0";
			maxValue="1";
			offset0="0";
			offset1="0";
		};	
		class fl_gear_w 
		{
			type="rotation";
			source="wheel";
			selection="fl_gear_w";
			axis="fl_gear_w_axis";
			memory=1;
			sourceAddress="loop";
			minValue=0;
			maxValue=1;
			angle0=0;
			angle1="rad +360";
		};
		class fl_gear_h1
		{
			type="rotation";
			source="gear";
			selection="fl_gear_h1";
			axis="fl_gear_h1_axis";
			memory=1;
			minValue=0;
			maxValue=2.5;
			angle0=1.8;
			angle1=0;
		};
//front right gear 
		class fr_gear_1pass
		{
			type="rotation";
			source="gear";
			selection="fr_gear_a";
			axis="fr_gear_a_axis";
			memory=1;
			minValue=0;
			maxValue=1;
			angle0=0;
			angle1=-1.1;
		};
		class fr_gear_2pass: fr_gear_1pass
		{
			type="translation";
			minValue="0.2";
			maxValue="0.5";
			offset0="0";
			offset1="0";
		};
		class fr_gear_b
		{
			type="rotation";
			source="gear";
			selection="fr_gear_b";
			axis="fr_gear_b_axis";
			memory=1;
			minValue=0;
			maxValue=1;
			angle0=0;
			angle1=-0.9;
		};
		class fr_gear_c_1pass
		{
			type="rotation";
			source="gear";
			selection="fr_gear_c";
			axis="fr_gear_c_axis";
			memory=1;
			minValue=0;
			maxValue=1;
			angle0=0;
			angle1=2.6;
		};
		class fr_gear_c_2pass: fr_gear_c_1pass
		{
			type="translation";
			minValue="0";
			maxValue="1";
			offset0="0";
			offset1="0";
		};	
		class fr_gear_w 
		{
			type="rotation";
			source="wheel";
			selection="fr_gear_w";
			axis="fr_gear_w_axis";
			memory=1;
			sourceAddress="loop";
			minValue=0;
			maxValue=1;
			angle0=0;
			angle1="rad +360";
		};
		class fr_gear_h1
		{
			type="rotation";
			source="gear";
			selection="fr_gear_h1";
			axis="fr_gear_h1_axis";
			memory=1;
			minValue=0;
			maxValue=2.5;
			angle0=-1.8;
			angle1=0;
		};
//rear gear
		class r_gear
		{
			type="rotation";
			source="gear";
			selection="r_gear";
			axis="r_gear_axis";
			memory=1;
			minValue=0;
			maxValue=1;
			angle0=0;
			angle1=1.7;
		};
		class r_gear_h1
		{
			type="rotation";
			source="gear";
			selection="r_gear_h1";
			axis="r_gear_h1_axis";
			memory=1;
			minValue=0;
			maxValue=2.5;
			angle0=2;
			angle1=0;
		};
	        class r_gear_h2
		{
			type="rotation";
			source="gear";
			selection="r_gear_h2";
			axis="r_gear_h2_axis";
			memory=1;
			minValue=0;
			maxValue=2.5;
			angle0=-2;
			angle1=0;
		};	
	};
};
};

Share this post


Link to post
Share on other sites

try this

class CfgSkeletons
{
class Default
{
	isDiscrete = 1;
	skeletonInherit = "";
	skeletonBones[] = {};
};
class heli_skeleton: Default
{
	skeletonInherit="";
	isDiscrete=0;
	skeletonBones[]=
	{
//rotors
		"velka vrtule","",
		"mala vrtule","",
//doors
		"door_1","",
		"door_2","",
//weapon bay
		"l_holdster","", 
//front left gear
		"fl_gear_a","",
		"fl_gear_w","fl_gear_a",
		"fl_gear_a","",
		"fl_gear_b","fl_gear_a",
		"fl_gear_b","",
		"fl_gear_c","fl_gear_b",
		"fl_gear_h1","",
//front right gear
		"fr_gear_a","",
		"fr_gear_w","fr_gear_a",
		"fr_gear_a","",
		"fr_gear_b","fr_gear_a",
		"fr_gear_b","",
		"fr_gear_c","fr_gear_b",
		"fr_gear_h1","",
//rear gear	
		"r_gear","",
		"r_gear_h1","",
		"r_gear_h2",""	
	};
};
};
[color="#FF0000"]class Translation;[/color]
class Rotation;
class CfgModels
{
class Default
{
	sectionsInherit="";
	sections[] = {};
	skeletonName = "";
};
class heli: Default
{
	skeletonName="heli_skeleton";
	sectionsInherit="";
	sections[]=
	{

	};
	class Animations
	{
//rotors
		class HRotor
  			{
  				type="rotationY";
   				source="rotorH";
   				selection="velka vrtule";
   				axis="velka osa";
   				memory=1;
   				sourceAddress="loop";
   				minValue=0;
   				maxValue=1;
   				angle0=0;
   				angle1="rad +360";
  			};
  			class HRotor2
  			{
   				type="rotationY";
   				source="rotorH";
   				selection="mala vrtule";
   				axis="mala osa";
   				memory=1;
   				sourceAddress="loop";
   				minValue=0;
   				maxValue=1;
   				angle0=0;
   				angle1="rad -360";
  			};
//doors
		class door_1
		{
			type="rotation";
			source="Doors";
			selection="door_1";
			axis="door_1_axis";
			memory=1;
			animPeriod=1;
			angle0=0
			angle1=1	
		};
		class door_2
		{
			type="rotation";
			source="Doors";
			selection="door_2";
			axis="door_2_axis";
			memory=1;
			animPeriod=1;
			angle0=0
			angle1=-1	
		};
//weapons bay	
		class l_holdster_1pass  [color="#FF0000"]//seems to be missing the axis information in this class and if it is to translate it needs the offset0= and offset1= values
[/color]			{
			type="translationY";     
			source="maxHoldsterValue";
			selection="l_holdster";
			minValue="0";
			maxValue=".01";	
		};
		class l_holdster_2pass: l_holdster_1pass
		{
			type="rotation";
			source="maxHoldsterValue";
			memory=1;
			selection="l_holdster";
			axis="l_holdster_axis";
			minValue=1;
			maxValue=2;
			minPhase=0;
			maxPhase=1;
			angle0=0;
			angle1=2;		
		};
//front left gear	
		class fl_gear_1pass
		{
			type="rotation";
			source="gear";
			selection="fl_gear_a";
			axis="fl_gear_a_axis";
			memory=1;
			minValue=0;
			maxValue=1;
			angle0=0;
			angle1=1.1;
		};
		class fl_gear_2pass: fl_gear_1pass
		{
			type="translation";
			minValue="0.2";
			maxValue="0.5";
			offset0="0";
			offset1="0";
		};
		class fl_gear_b
		{
			type="rotation";
			source="gear";
			selection="fl_gear_b";
			axis="fl_gear_b_axis";
			memory=1;
			minValue=0;
			maxValue=1;
			angle0=0;
			angle1=0.9;
		};
		class fl_gear_c_1pass
		{
			type="rotation";
			source="gear";
			selection="fl_gear_c";
			axis="fl_gear_c_axis";
			memory=1;
			minValue=0;
			maxValue=1;
			angle0=0;
			angle1=-2.6;
		};
		class fl_gear_c_2pass: fl_gear_c_1pass
		{
			type="translation";
			minValue="0";
			maxValue="1";
			offset0="0";
			offset1="0";
		};	
		class fl_gear_w 
		{
			type="rotation";
			source="wheel";
			selection="fl_gear_w";
			axis="fl_gear_w_axis";
			memory=1;
			sourceAddress="loop";
			minValue=0;
			maxValue=1;
			angle0=0;
			angle1="rad +360";
		};
		class fl_gear_h1
		{
			type="rotation";
			source="gear";
			selection="fl_gear_h1";
			axis="fl_gear_h1_axis";
			memory=1;
			minValue=0;
			maxValue=2.5;
			angle0=1.8;
			angle1=0;
		};
//front right gear 
		class fr_gear_1pass
		{
			type="rotation";
			source="gear";
			selection="fr_gear_a";
			axis="fr_gear_a_axis";
			memory=1;
			minValue=0;
			maxValue=1;
			angle0=0;
			angle1=-1.1;
		};
		class fr_gear_2pass: fr_gear_1pass
		{
			type="translation";
			minValue="0.2";
			maxValue="0.5";
			offset0="0";
			offset1="0";
		};
		class fr_gear_b
		{
			type="rotation";
			source="gear";
			selection="fr_gear_b";
			axis="fr_gear_b_axis";
			memory=1;
			minValue=0;
			maxValue=1;
			angle0=0;
			angle1=-0.9;
		};
		class fr_gear_c_1pass
		{
			type="rotation";
			source="gear";
			selection="fr_gear_c";
			axis="fr_gear_c_axis";
			memory=1;
			minValue=0;
			maxValue=1;
			angle0=0;
			angle1=2.6;
		};
		class fr_gear_c_2pass: fr_gear_c_1pass
		{
			type="translation";
			minValue="0";
			maxValue="1";
			offset0="0";
			offset1="0";
		};	
		class fr_gear_w 
		{
			type="rotation";
			source="wheel";
			selection="fr_gear_w";
			axis="fr_gear_w_axis";
			memory=1;
			sourceAddress="loop";
			minValue=0;
			maxValue=1;
			angle0=0;
			angle1="rad +360";
		};
		class fr_gear_h1
		{
			type="rotation";
			source="gear";
			selection="fr_gear_h1";
			axis="fr_gear_h1_axis";
			memory=1;
			minValue=0;
			maxValue=2.5;
			angle0=-1.8;
			angle1=0;
		};
//rear gear
		class r_gear
		{
			type="rotation";
			source="gear";
			selection="r_gear";
			axis="r_gear_axis";
			memory=1;
			minValue=0;
			maxValue=1;
			angle0=0;
			angle1=1.7;
		};
		class r_gear_h1
		{
			type="rotation";
			source="gear";
			selection="r_gear_h1";
			axis="r_gear_h1_axis";
			memory=1;
			minValue=0;
			maxValue=2.5;
			angle0=2;
			angle1=0;
		};
	        class r_gear_h2
		{
			type="rotation";
			source="gear";
			selection="r_gear_h2";
			axis="r_gear_h2_axis";
			memory=1;
			minValue=0;
			maxValue=2.5;
			angle0=-2;
			angle1=0;
		};	
	};
};
};


Share this post


Link to post
Share on other sites

I'm pretty sure the maxHoldsterValue animation source fires eventhandler scripts. You may need supporting scripts

Share this post


Link to post
Share on other sites

M1lkm8n I've added the offset values and axis but still the hatch will only move upwards in positive Y, it then rotates as it should. I'm new to all this so forgive me if this sounds silly. But it would be so much easier if it would recognize maxValue="-1" so that it would translate the hatch -Y. If maxValue="1" moves in the positive, why can't -1 move it in the negative?

WarLord554 im currently working on the animations & model.cfg, thus far i havn't worked on eventhandlers and scripts. Is this something that would help translate negative Y?

Edited by Johno232

Share this post


Link to post
Share on other sites

You may have to flip the numbers around to get it to go the other direction

So if the numbers were

0

1

Try

1

0

Or even try adding a negative

In the min/max and the two offset slots. It does work I was just using it last night in a crane I was animating.

I'll look at my model config and post it for you today.

Share this post


Link to post
Share on other sites

Strange as I've already attempted what you provided. I've put negative values and switched the values between min/max. It seems that 'maxValue' will only except values that are positive.

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  

×