Jump to content
HJohnson

How to Animate the Grenade Launcher

Recommended Posts

The following code is what is necessary to animate any underslung grenade launcher in Arma 3. This stops the "weapon magazine animates while the GL animation plays" bug and it also allows you to animate the ugl in general (tube moving back and forth, pseudo shell being inserted,etc. Essentially you duplicate the the parts that you need to move in the GL and the Magazine giving them the proper named selections. In the example below, GL_TUBE_DUMMY is visible when the muzzle of the gun is set to 0 and MAGAZINE_DUMMY is set to visible when the muzzle is set to 1. The dummy parts and their named selections do not move and have no animations outside of disappearing when required. Since these are offset, the moving GL parts are not visible when you are using the rifle and the moving rifle reload parts are not visible during GL usage.

In this case example, this code is used to animate the FNGL on an Arma 2 scar port:

			//Reveal the non-moving UGL related reloading parts when muzzle = 0. Hide them when its is = 1.
		class gl_tube_dummy_hide
		{
			type="hide";
			source="weaponMuzzle";
			selection="gl_tube_dummy";
			minValue = 0.0;
			maxvalue = 0.25;
			hideValue = 0.01;

		};
		//Reveal the moving UGL related reloading  parts when muzzle = 1. Hide them when its is = 0.
		class gl_tube_hide
		{
			type="hide";
			source="weaponMuzzle";
			selection="gl_tube";
			minValue = 0.0;
			maxvalue = 0.25;
			hideValue = 0.00;
			unhideValue = 0.01;

		};
		//Reveal the non-moving magazine reloading parts when muzzle = 1. Hide them when its is = 0.
		class magazine_dummy_hide
		{
			type="hide";
			source="weaponMuzzle";
			selection="magazine_dummy";
			minValue = 0.0;
			maxvalue = 0.25;
			hideValue = 0.00;
			unhideValue = 0.01;
		};
		//Reveal the non-moving magazine reloading parts when muzzle = 0. Hide them when its is = 1.
		class magazine_hide_2
		{
			type="hide";
			source="weaponMuzzle";
			selection="magazine";
			minValue = 0.0;
			maxvalue = 0.25;
			hideValue = 0.01;
		};

Results in something like this. (I'm using Toadie2k's animations for the magazine reload until I get around to making my own).

  • Like 1

Share this post


Link to post
Share on other sites

Amazing.

I think this is are need to all weapon mod.

Share this post


Link to post
Share on other sites

Oh this is so cool! We need you for CUP.

Share this post


Link to post
Share on other sites
Posted a issue in feedback to see if BI can do it to vanilla please vote up: http://feedback.arma3.com/view.php?id=24321

If BI won't do it could this be done to vanilla weapons in a mod?

See above, this is a workaround so if you don't want Bohemia to simply reuse his method 1:1 you should specify what exactly you mean by "do it to vanilla​".

Share this post


Link to post
Share on other sites

This is really cool, great job! I hope this will be used by other mod makers.

Share this post


Link to post
Share on other sites

Is there any way to remove grenade from the barrel, after it being fired?

Share this post


Link to post
Share on other sites

You can hide it based on the "revolving" animation source. It's 1 with the full magazine (= a loaded grenade) and 0 with empty. However, it changes with bullets, too, so there would be some weird interactions in some cases.

Share this post


Link to post
Share on other sites

You can hide it based on the "revolving" animation source. It's 1 with the full magazine (= a loaded grenade) and 0 with empty. However, it changes with bullets, too, so there would be some weird interactions in some cases.

Hmm, RHS team says its imposible, but maybe you could make something... to make it look real?

http://feedback.rhsmods.org/view.php?id=1958

Share this post


Link to post
Share on other sites

 

Yes, that means the magazine would disappear as well. Which is weird.

It depends on what they're hiding on revolving. But adding a hide animation for the grenade wouldn't change behavior of anything else, since it should work with a separate selection. However, since the animation source is the same, the grenade would disappear once the last bullet of a magazine is fired, as well. Btw, firing the grenade triggers the revolving animation source as well, so it affects any animations which uses that source. And switching fire mode between the rifle and UGL changes revolving, too. That's what I meant by "weird interactions".

Share this post


Link to post
Share on other sites

Pretty weird.... Is there something in plans to improve this?

Share this post


Link to post
Share on other sites

We're considering some improvements, but I can't promise anything at the moment.

  • Like 1

Share this post


Link to post
Share on other sites

i'll be working on rifle grenades soon, and hope to develop this a little until i hit the same wall the others have most likely - will post up progress once i've done

  • Like 1

Share this post


Link to post
Share on other sites

btw can somebody post a detailed how-to for animating the GL foresight. I've had a go at it but it will only rotate 45 degrees.  do you HAVE TO use 10 zeroing values, or if you use 4, will the increments spread across 90 degrees for example? mine just wont work properly.  and i have no idea where to put the eye positions to make it look through the ladder correctly.

 

some basic description with examples of how to do this would be massively appreciated.

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

×