Jump to content
Sign in to follow this  
[aps]gnat

Recoil - reload animation working

Recommended Posts

Looks like the animation for recoil (really its reload) is working.

An example

In the config.cpp

class AnimationSources: AnimationSources

{

class gunBarrel

{

source = "reload";

weapon = GNT_100a;

};

};

(GNT_100a is the name in cfgWeapons)

and in model.cfg

class Animations

{

class main_recoil

{

type="translation";

source="gunBarrel";

selection="main_recoil";

begin="recoil_start";

end="recoil_end";

initPhase=1;

memory=1;

animPeriod =0.2;

sourceAddress = "loop";

offset0=0;

offset1=1;

};

......

......

main_recoil is the gun barrel to move in the model

recoil_start and recoil_end are memory points defining te direction and distance of animation

Sure ... might yet be an easier way again, but this seems to work (better than ArmA1 anyway).

Share this post


Link to post
Share on other sites

I'm not sue if i understand what your trying to say here in this thread.

Are you saying the recoil intensity can be controlled?

Share this post


Link to post
Share on other sites

Well, as far as I understand, yeah. (Meaning that you could actually model & animate some artillery piece's "barrel"/gun to actually react to the recoil the firing sequense causes. But keep in mind that I'm not the expert here.)

Share this post


Link to post
Share on other sites

Nothing to do with hand weapon recoil.

And nothing to do with the "reaction force" created by vehicel mounted weapons.

Simply the animation effect of barrel recoil.

Like Artillary barrel.

Share this post


Link to post
Share on other sites

So we don´t need to make a user Animationsource but can use reload instead? good to know.

Share this post


Link to post
Share on other sites
Simply the animation effect of barrel recoil.

Like Artillary barrel.

I see.. you mean like the M1abrams cannon recoil when fired? (you can see the cannon retract after being fired)

Edit: Maybe this also applies to the handgun pistols.

Share this post


Link to post
Share on other sites

reload worked with pistols in arma1 worked without problems as far i tested it. (only had 1 handgun a c96)

Damn thing is i cant even remember if i ever tried reload for arty or tanks, but there have to be some reason i used a user animationsource for them, so i guess it really didnt worked with reload animationsource on them.

Share this post


Link to post
Share on other sites
Guest RKSL-Rock

Gnat try

Model.cfg

		class cannon_reload
		{
				type="translation";
			source="cannon_reload";
			selection="main_gun_recoil";
			begin="main_gun_recoil_end";
			end="main_gun_recoil_start";
				initphase=0;
				memory=1;
				animperiod =.5;
			sourceaddress="mirror";
				minvalue=0;
				maxvalue=(1/100)/2;
				offset0=0;
				offset1=1;
			}

Config.cpp inside the CFGVehicles section

		class AnimationSources : AnimationSources 
	{
		class cannon_reload 
		{
			source = "reload";
			weapon = "<WEAPON CLASS NAME>";
		};
	};

It works on all my aircraft and tanks. I havent tried it on a ship/boat class yet though.

Share this post


Link to post
Share on other sites

Here's how I think BIS did it:

class recoil_BEGIN

{

Type = "translation";

Source = "recoil_source";

Selection = "recoilhlaven";

axis= "recoilhlaven_axis"

MinValue = 0.50;

MaxValue = 0.80;

MinPhase = 0.50;

MaxPhase = 0.80;

SourceAddress = "clamp";

Offset0 = 0.000000;

Offset1 = -0.200000;

};

class recoil_END

{

Type = "translation";

Source = "recoil_source";

Selection = "recoilhlaven";

axis= "recoilhlaven_axis"

MinValue = 0.85;

MaxValue = 1.00;

MinPhase = 0.85;

MaxPhase = 1.00;

SourceAddress = "clamp";

Offset0 = 0.000000;

Offset1 = 0.200000;

};

The axis (recoilhlaven_axis) is made of two points in memory lod and it tells how long the recoil effect is just like with small arms.

Share this post


Link to post
Share on other sites

sorry to dig up an old thread....

Ive got my recolis working using what is posted here by Norsu....

My only question is how to speed up the animation. right now it goes very slow

Share this post


Link to post
Share on other sites

in a round about way it is.....

right now im inheriting everything from the BIS M256 yet my animation takes 3 times longer to return.

The BIS Abrams fires, recoils, 3 seconds, reload complete

Mine, fires, slowly recoils, and slowly returns returns,

yet i have simply copied everything above and from BIs

Share this post


Link to post
Share on other sites

from config.cpp

class recoil_source

{

source = "reload";

weapon = M284;

animPeriod = 0.01;

};

from model.cfg

class recoil_BEGIN

{

type="translation";

source="recoil_source";

selection="recoil";

axis="recoil_axis";

animPeriod = 0;

minValue = 0.92;

maxValue = 0.99;

sourceAddress = 0;

offset0 = 0.000000;

offset1 = -0.500000;

memory = 1;

};

class recoil_END

{

type="translation";

source="recoil_source";

selection="recoil";

axis="recoil_axis";

animPeriod = 0;

minValue = 0.99;

maxValue = 1;

sourceAddress = 0;

offset0 = 0.000000;

offset1 = 0.500000;

memory = 1;

};

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  

×