Jump to content
Sign in to follow this  
Alwarren

Problem with floaty weapon parts

Recommended Posts

Hi all.

I am having an issue with a model which I absolutely fail to understand.

I have a launcher (Javelin) with a CLU attached that I want to disappear when not in use. The following is the model.cfg, which I tried to simply as much as possible:

class CfgSkeletons
{
   class Javelin
   {
       pivotsModel="";
       isDiscrete = 1;
       skeletonInherit = "";
       skeletonBones[]=
       {
           "hide_not_selected",""
       };
   };
};
class CfgModels
{
   class javelin_launcher_loaded {
       skeletonName="Javelin";
       sections[]=
       {
           "hide_not_selected"
       };
       sectionsInherit = "";
       class Animations
       {
           class hide_when_not_selected 
           {
               type="hide";
               source="isSelected";
               selection="hide_not_selected";
               minValue = 0;
               maxValue = 1;
               hideValue = 0;
               unhideValue = 1;
               sourceAddress     = "clamp";
           };
       };
   };
};

The "hide_not_selected" selection is a selection in the Javelin that contains the CLU. When I preview this in Buldozer, it works fine. However, in game, this happens:

The weird part is that if I comment out everything inside class ANimations, the same effect happens.

Anyone has an idea?

Share this post


Link to post
Share on other sites

I should also mention that autocenter=0 is set correctly, and replacing the model with a different one (that is known to work), I get the same effect, so it must somehow be the model.cfg.

Share this post


Link to post
Share on other sites
Hi all.

I am having an issue with a model which I absolutely fail to understand.

Anyone has an idea?

This is rather strange, I have tried it and it worked fine for me with Titan (I have used the same model.cfg just renamed the classes to fit the model name and created selection on the optics unit). The only possible issue I can think of may be some other selection in model interfering with this, but that shouldn't be a problem as it is not addressed in model.cfg :icon_evil:

Share this post


Link to post
Share on other sites
This is rather strange, I have tried it and it worked fine for me with Titan (I have used the same model.cfg just renamed the classes to fit the model name and created selection on the optics unit). The only possible issue I can think of may be some other selection in model interfering with this, but that shouldn't be a problem as it is not addressed in model.cfg :icon_evil:

Thanks for the reply, pettka. I have actually found out what the problem is.

As I wrote in PM already, most launchers have a loaded and unloaded state, The loaded state is selected via the "modelSpecial" property in the magazine's config. I looked at the Titan, since you said it worked with that, and in fact the Titan doesn't have a modelSpecial, it uses hasMagazine to hide the rocket if it isn't loaded. I tried that for the Javelin, and lo and behold, the animation works now.

So, the issue here is that modelSpecial behaves somewhat like a proxy. It cannot be animated. For a launcher with animation, it's better to use a single model and hide the rocket with the hasMagazine animation source.

Thanks for the help :bounce2:

(OH yeah, can we have animatable proxies? Would be nice if that scope attachment or bipod could actually be animated ;))

Share this post


Link to post
Share on other sites

Is there any way to stop Launcher magazine from hiding? I want the same thing like on rifles, magazine dissapear when is deattached from rifle, but after shooting he is still on weapon.

I got AT with CLU and tube whic is attached to CLU, but after shoot the tupe dissapear because of hasMagazine animation source. And the magazine for AT dissapear from inventory after shoot, any way to prevent that?

I used hasMagazine to hide tube when he is not attached to CLU.

class Test_WeaponBase: Rifle
{
	skeletonName = "Test_Weapon";
	sectionsInherit = "";
	sections[] = {};
	class Animations
	{
		class no_magazine
		{
			type="hide";
			source="hasMagazine";
			selection="magazine";
			minValue=0.000000;
			maxValue=1.00000;
			hideValue=0.5;
			unhideValue = -1.0;
		};
	};
};
class bumbar_launcher: Test_WeaponBase {};
};

Share this post


Link to post
Share on other sites

Are you using modelspecial in the missile magazine or something?

When the launcher is on your back it will go to the model defined in your cfgweapons, but when you shoulder the weapon it will use the modelspecial model defined in the magazine. Then when you empty the magazine it will return to the 'weapon on back' model. This might be causing some confusion in how the model is animating.

If you have any modelspecial, remove it and only use the model you want to animate. Use the isSelected source like alwarren suggest, to create a 'weapon on back' version of the model (by hiding the CLU or tube or whatever).

You might need to throw in an isEmpty/isEmptyNoReload source animation in there too to just hide the missile while the tube/magazine is still loaded into the weapon.

Share this post


Link to post
Share on other sites

Is there any page where are all animation sources with descriptions?

The problem is actually in count, variable that is in magazine definition.

Im magazine I use model of tube. No modelSpecial, just model, for weapon and for magazine.

This work very well, but only if magazine has count more than 1.

So if I put in magazine count 10, the AT will shoot 10 rockets, and the tube will not dissapear when is empty.

But if i put 1, the tube will dissapear.

So, I need to go more deeper, to try to add some fake magazine or to set reloadtime to 99999999999999999 for AT so it will never load second rocket.

Thats how i currently make this to work.

My model.cfg with animations.

So when the weapon is on the back, the CLU will hide and the two hatches will appear in front and in back of tube to close it. On back will be only tube with two hatches.

Weapon in hands, CLU appead, hatches dissapear, AT have two rocket, one shoot, tube dont dissapear, still here, but still one rocket left, that rocket will never releoad because i set reload time to 99999999.

When Tube/magazine was deattached from CLU, in hand only CLU appear, on back nothing appear but CLU is in inventory. On ground we will see tube with hatches.

Thats everything I want. I just need a way to solve dissapearing when count is set to 1.

So i actually need source that will unHide tube after shoot, but i am not sure is that possible.

	class Test_WeaponBase: Rifle
{
	skeletonName = "Test_Weapon";
	sectionsInherit = "";
	sections[] = {};
	class Animations
	{
		class no_magazine
		{
			type="hide";
			source="hasMagazine";
			selection="magazine";
			minValue=0.000000;
			maxValue=1.00000;
			hideValue=0.5;
			unhideValue = -1.0;
		};
	    class no_magazine_hide_foam
		{
			type="hide";
			source="hasMagazine";
			selection="foam";
			minValue=0.000000;
			maxValue=1.00000;
			hideValue=0.5;
			unhideValue = -1.0;
		};
		class hide_foam
           {
               type="hide";
               source="isSelected";
               selection="foam";
			minValue=0.000000;
			maxValue=1.00000;
			hideValue=0.5;
			unhideValue = -1.0;
           };
		class hide_clu
           {
               type="hide";
               source="isSelected";
               selection="clu";
			minValue=0.000000;
			maxValue=1.00000;
			hideValue=0.0;
			unhideValue = 1.0;
           };
       };
};
class bumbar_launcher: Test_WeaponBase {};
};

Also, a one bug, the weapon hiddenselections dont work when weapon is on ground.

How to test:

Make weapon

Create hiddenselection

Hide selection in config

Go in game and put weapon with hiddenselection to ground, the hidden selection will appear.

Also, we are definitely need magazine as a proxy, we can make some cool things with ATs, esspecialy with ATs like Javelin, Eryx .... Deaatach magazine from weapon in inventory, in hands weapon dont have magazine, put on ground, magazine appear.

Edited by mladjaSRB

Share this post


Link to post
Share on other sites
When the launcher is on your back it will go to the model defined in your cfgweapons, but when you shoulder the weapon it will use the modelspecial model defined in the magazine.

I had to find out the hard way this is no longer the case. In Arma 3, the behavior changed, you will always get the modelSpecial model when the weapon is loaded, no matter if you have it selected or on your back. That's the reason I wanted to hide the CLU with isSelected, because when you have a loaded Javelin with CLU on your back, that looks weird :D

---------- Post added at 19:09 ---------- Previous post was at 19:08 ----------

Is there any page where are all animation sources with descriptions?

Here. Look for "Animation Sources"

Share this post


Link to post
Share on other sites
Are you using modelspecial in the missile magazine or something?

When the launcher is on your back it will go to the model defined in your cfgweapons, but when you shoulder the weapon it will use the modelspecial model defined in the magazine. Then when you empty the magazine it will return to the 'weapon on back' model. This might be causing some confusion in how the model is animating.

If you have any modelspecial, remove it and only use the model you want to animate. Use the isSelected source like alwarren suggest, to create a 'weapon on back' version of the model (by hiding the CLU or tube or whatever).

You might need to throw in an isEmpty/isEmptyNoReload source animation in there too to just hide the missile while the tube/magazine is still loaded into the weapon.

I tried isEmptyNoReload but still dissapearing when count is set to 1.

So I suppose the only solution is some script? Like INKO Disposaple?

I can make it INKO Compatible but I dont want the whole AT get useless, just tube, because rocket is in tube.

Can try to add CLU as optic attachment, and make it compatible with INKO, think that will solve problem.

But then the problem is i dont want to INKO be requirement, so is there any source code?

@Alwarren

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  

×