Jump to content
Sign in to follow this  
AveryTheKitty

Model.cfg animation issue regarding the bolt

Recommended Posts

Whenever I fire the weapon, the bolt (named "CH" on the model) moves properly, except in the wrong direction. As you can see, it comes out the front. I tried a few things but none of them worked.

http://i.imgur.com/zLHmml6.jpg (128 kB)

Model.cfg:

class CfgSkeletons
{
class SCAR_Weapon
{
	pivotsModel="";
	isDiscrete = 0;
	skeletonInherit = "";
	skeletonBones[] =
	{
		"trigger",		"",
		"bolt",			"",
		"bolt_catch",	"",
		"CH", "",
		"CHH","CH",
		"magazine",		"",
		"safety",		"",
		"muzzleFlash",	"",
		"OP",			"",
		"ForeSight",	"",
		"BackSight",	""
	};
};
};
class CfgModels
{
class Default;
class Optic: Default
{
	sections[]=
	{
		"zasleh"
	};
};
class Weapon: Default
{
	sections[]=
	{
		"zasleh"
	};

	htMin = 1;		// Minimum half-cooling time (in seconds)
	htMax = 600;	// Maximum half-cooling time (in seconds)
	afMax = 0;		// Maximum temperature in case the model is alive (in celsius)
	mfMax = 0;		// Maximum temperature when the model is moving (in celsius)
	mFact = 1;		// Metabolism factor - number from interval <0, 1> (0 - metabolism has no influence, 1 - metabolism has full influence (no other temperature source will be considered)).
	tBody = 100;	 // Metabolism temperature of the model (in celsius)

	skeletonName="Weapon";
	class Animations
	{
		class zaslehROT
		{
			type="rotation";
			source="clockMinute";
			sourceAddress="loop";
			selection="zasleh";
			begin="usti hlavne";
			end="konec hlavne";
			memory=1;
			minValue=0.0166665;
			maxValue=0.016666666666666666666666666666667;
			angle0="rad 0";
			angle1="rad 360";
		};
		class magazine_hide
		{
			type="hide";
			source="reloadMagazine";
			sourceAddress="mirror";
			selection="magazine";
			minValue=0.0;
			maxValue=0.4;
			hideValue=0.5;
		};
		class no_magazine
		{
			type="hide";
			source="hasMagazine";
			selection="magazine";
			minValue=0.000000;
			maxValue=1.00000;
			hideValue=0.5;
			unhideValue = -1.0;
		};				
	};
};
class Rifle: Weapon
{
	skeletonName="Rifle";
	sectionsInherit = "";
	sections[] = {"muzzleFlash","Camo"};
	class Animations: Animations
	{
		class magazine_hide:magazine_hide
		{
			sourceAddress="mirror";
			minValue=0.0;
			maxValue=0.56;
			hideValue=0.36;
		};
		class bolt_empty
		{
			type="translation";
			source="isEmpty";
			selection="bolt";
			axis="bolt_axis";
			memory=1;
			minValue=0.000000;
			maxValue=0.500000;
			offset0=0;
			offset1=0.5;
		};
		class bullet_cover
		{
			type="rotation";
			source="reload";
			sourceAddress="mirror";
			selection="bullet_cover";
			axis="bullet_cover_axis";
			memory=1;
			minValue=0.0;
			maxValue=0.5;
			angle0=0;
			angle1=-0.4;
		};
		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_reload_begin
		{
			type="translation";
			source="reloadMagazine";
			selection="bolt";
			axis="bolt_axis";
			memory=1;
			minValue=0.1;
			maxValue=0.15;
			offset0=0;
			offset1=0.5;
		};
		class bolt_reload_end:bolt_reload_begin
		{
			minValue=0.980000;
			maxValue=1.000000;
			offset0=0;
			offset1=-0.5;
		};
	};
};
class SCAR_WeaponBase: Rifle
{
	skeletonName = "SCAR_Weapon";
	sectionsInherit = "";
	sections[] = {"muzzleFlash","Camo"};
	class Animations
	{
		class trigger
		{
			type = "rotation";
			source = "reload";
			sourceAddress = "clamp";
			selection = "trigger";
			axis = "trigger_axis";
			minValue = 0;
			maxValue = "1";
			angle0 = "0";
			angle1 = "rad 03";
		};
/*
	class bolt
		{
			type = "translation";
			source = "reload";
			selection = "bolt";
			axis = "bolt_axis";
			minValue = 0;
			maxValue = "1";
			offset0 = "0";
			offset1 = "1";
		};
*/
		class bolt
		{
			type = "translation";
			source = "reload";
			sourceAddress = clamp;
			selection = "bolt";
			axis = "bolt_axis";
			minValue = 0.5;
			maxValue = 1;
			offset0 = 0;
			offset1 = 0.3;
		};
		class bolt_2: bolt
		{
			minValue = 0;
			maxValue = 0.5;
			offset0 = 0;
			offset1 = 0.7;
		};
		class bolt_empty: bolt{
			source = "isEmptyNoReload";
			minValue = 0;
			maxValue = 1;
			offset0 = 0;
			offset1 = 1;
		};
		class bolt_reload_move_1: bolt_empty {
			source="reloadMagazine";	// z: should work like that only if weapon is empty
			minValue=0;
			maxValue=0.00001;
		};
		class bolt_reload_move_2: bolt_reload_move_1 {
			source="reloadMagazine";	// z: should work like that only if weapon is empty
			minValue=0.78;
			maxValue=0.80;
			offset1 = -1;
		};
		class bolt_catch: bolt {
			selection = "CH";
			axis = "CH_axis";
		};
		class bolt_catch_2: bolt_2 {
			selection = "CH";
			axis = "CH_axis";
		};
		class bolt_catch_empty: bolt_empty {
			selection = "CH";
			axis = "CH_axis";
		};
		class bolt_catch_reload_move_1: bolt_reload_move_1 {
			selection = "CH";
			axis = "CH_axis";
		};
		class bolt_catch_reload_move_2: bolt_reload_move_2 {
			selection = "CH";
			axis = "CH_axis";
		};
		class magazine_hide
		{
			type="hide";
			source="reloadMagazine";
			selection="magazine";
			minValue=0.000000;
			maxValue=1.00000;
			hideValue=0.188;
			unhideValue = 0.550;
		};
		class no_magazine
		{
			type="hide";
			source="hasMagazine";
			selection="magazine";
			minValue=0.000000;
			maxValue=1.00000;
			hideValue=0.5;
			unhideValue = -1.0;
		};
		class magazine_reload_move_1
		{
			type = "translation";
			source = "reloadMagazine";
			selection = "magazine";
			axis = "magazine_axis";
			minValue = 0.145;
			maxValue = 0.170;
			offset0 = 0.0;
			offset1 = 0.5;
		};
		class magazine_reload_move_2: magazine_reload_move_1
		{
			minValue = 0.573;
			maxValue = 0.602;
			offset0 = 0.0;
			offset1 = -0.5;
		};
		class muzzleFlashROT
		{
			type="rotationX";
			source="ammoRandom";
			sourceAddress="loop";
			selection="muzzleFlash";
			axis="";
			centerFirstVertex=true;
			minValue=0;
			maxValue=4;
			angle0="rad 0";
			angle1="rad 360";
		};
		class OP_ROT
		{
			type="rotation";
			source="zeroing2";
			sourceAddress="loop";
			selection="OP";
			axis="OP_axis";
			minValue=0;
			maxValue=3;
			angle0="rad 0";
			angle1="rad 65";
		};
		class BackSight_optic
		{
			type="rotation";
			source="hasOptics";
			selection="BackSight";
			axis="BackSight_axis";
			memory=1;
			minValue=0.0000000;
			maxValue=1.0000000;
			angle0=0.000000;
			angle1=(rad 90);
		};
		class ForeSight_optic: BackSight_optic
		{
			selection="ForeSight";
			axis="ForeSight_axis";
			angle1=(rad 270);
		};
		class safety_mode_rot
		{
			type			= rotation;
			source			= weaponMode;
			selection		= "safety";
			axis			= "safety_axis";
			memory			= 1;
			minValue		= 0;
			maxValue		= 0.25;
			angle0			= 0;
			angle1			= (rad -52);
		};
	};
};
class SCAR_F: SCAR_WeaponBase {};
class SCAR_C_F: SCAR_WeaponBase {};
class SCAR_GL_F: SCAR_WeaponBase {};
};

Thanks!

Share this post


Link to post
Share on other sites

When you animate the bolt catch, you inherit most of the animation properties from other animations, including offset, which affect the direction of a translation as well. If I understand your issue, you can either change direction of the CH_axis in the model, or you can add the offset1 property to all animations affecting the CH selection and change the +/- sign of its value. If I'm not mistaken, the following code might do the trick (just replace those classes and please let me know, if it did something useful :)).

class bolt_catch: bolt
{
selection zz= "CH";
axis = "CH_axis";
offset1 = -0.3;
};
class bolt_catch_2: bolt_2
{
selection = "CH";
axis = "CH_axis";
offset1 = -0.7;
};
class bolt_catch_empty: bolt_empty
{
selection = "CH";
axis = "CH_axis";
offset1 = -1;
};
class bolt_catch_reload_move_1: bolt_reload_move_1
{
selection = "CH";
axis = "CH_axis";
offset1 = -0.00001;
};
class bolt_catch_reload_move_2: bolt_reload_move_2
{
selection = "CH";
axis = "CH_axis";
offset1 = 1;
};

Share this post


Link to post
Share on other sites
When you animate the bolt catch, you inherit most of the animation properties from other animations, including offset, which affect the direction of a translation as well. If I understand your issue, you can either change direction of the CH_axis in the model, or you can add the offset1 property to all animations affecting the CH selection and change the +/- sign of its value. If I'm not mistaken, the following code might do the trick (just replace those classes and please let me know, if it did something useful :)).

class bolt_catch: bolt
{
selection zz= "CH";
axis = "CH_axis";
offset1 = -0.3;
};
class bolt_catch_2: bolt_2
{
selection = "CH";
axis = "CH_axis";
offset1 = -0.7;
};
class bolt_catch_empty: bolt_empty
{
selection = "CH";
axis = "CH_axis";
offset1 = -1;
};
class bolt_catch_reload_move_1: bolt_reload_move_1
{
selection = "CH";
axis = "CH_axis";
offset1 = -0.00001;
};
class bolt_catch_reload_move_2: bolt_reload_move_2
{
selection = "CH";
axis = "CH_axis";
offset1 = 1;
};

It worked! Thanks. :)

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  

×