Jump to content
BluePhoenix

Vehicle animation problem

Recommended Posts

Hi guys, I need some help with my work.

I'm working on a submarine, since it's quite big I splitted it in many pieces (5 parts for the hull, then the launch tubes, and their hatches) which are attached together with a script in the preview. The sub has no spawning problem, except for some glitch I still have to work on, but nothing abnormal.

The problem is: i want the hatches to open (just a basic 90 degrees rotation), do I have to use a model.cfg? Because I tried it but it didn't work, I guess it has something to do with the spawn script, or the number of polys (because i tried even with a small section of tubes+hull+ hatches, to stay within the game engine parameters and not using the script, but nope).

I'm sure there's no error in the config.cpp or the model.cfg (i mean braces, different names, etc), but since I'm a newbie in the world of modding I don't know if I even have to use the model.cfg.

 

Any suggestion? :huh:

 

 

(edit: with "it doesn't work" I mean the action appears in the menu but the hatch does not move)

Share this post


Link to post
Share on other sites

You don't have to use a model.cfg unless you want your model to animate in game.   So for a start, you do need one.  If it didn't work, that's typical for modding ARMA.  Keep at it.

 

Since you're new I strongly recommend you put your submarine aside for an hour and take the Test_Boat_01 from ARMA's Samples_F folder and get that boat working in game.  I've suggested this before to people and then weeks later I still see them posting questions that show they didn't bother.  Get that boat working, then start messing around with it and the model.cfg and the config.cpp and you'll have a good sense about how to get your hatches to work.

  • Like 1

Share this post


Link to post
Share on other sites

You don't have to use a model.cfg unless you want your model to animate in game.   So for a start, you do need one.  If it didn't work, that's typical for modding ARMA.  Keep at it.

 

Since you're new I strongly recommend you put your submarine aside for an hour and take the Test_Boat_01 from ARMA's Samples_F folder and get that boat working in game.  I've suggested this before to people and then weeks later I still see them posting questions that show they didn't bother.  Get that boat working, then start messing around with it and the model.cfg and the config.cpp and you'll have a good sense about how to get your hatches to work.

 

^ totally agree.  You're getting into a complicate project that can quickly squash all of your dreams for the future, much like the 2016 presidential candidates.  Play around with the boat.  Making a big ship is a pain in the neck by itself.  Once you've played around with the boat I can let you know what I've learned about "big boats".

  • Like 1

Share this post


Link to post
Share on other sites

You don't have to use a model.cfg unless you want your model to animate in game.   So for a start, you do need one.  If it didn't work, that's typical for modding ARMA.  Keep at it.

 

Since you're new I strongly recommend you put your submarine aside for an hour and take the Test_Boat_01 from ARMA's Samples_F folder and get that boat working in game.  I've suggested this before to people and then weeks later I still see them posting questions that show they didn't bother.  Get that boat working, then start messing around with it and the model.cfg and the config.cpp and you'll have a good sense about how to get your hatches to work.

This is the first thing i did. The boat worked fine, and that's why I wanted to try something bigger, starting with a static model and then (in the future) a drivable one. I'm proceding step by step, also because I have not much time to dedicate to it. Made a lot of animating shapes, all of them working, but this... doesn't.

I also had a look at the USS Iowa and Atlas LHD to get how they made it, but it looks like they all use vanilla animations which don't need a model.cfg (this also made me doubt if this was the right way to get what I want).

Share this post


Link to post
Share on other sites

This is the first thing i did. The boat worked fine, and that's why I wanted to try something bigger, starting with a static model and then (in the future) a drivable one. I'm proceding step by step, also because I have not much time to dedicate to it. Made a lot of animating shapes, all of them working, but this... doesn't.

I also had a look at the USS Iowa and Atlas LHD to get how they made it, but it looks like they all use vanilla animations which don't need a model.cfg (this also made me doubt if this was the right way to get what I want).

Any model that is animated has a model.cfg.  If you're extracting .pbo contents to explore how they're done, you won't see the cfg (they don't get extracted) but it exists nonetheless.  If you're animating your ship, static or not, you need model.cfg.

Share this post


Link to post
Share on other sites

check rpt for errors

also, use Buldozer from objectbuilder to test your model's animation directly (which is the only way to confirm non working of animations).

Share this post


Link to post
Share on other sites

Ok it seems there was some mistake with the p3d file

Share this post


Link to post
Share on other sites

What was the mistake and how did you get your model to animate?

Share this post


Link to post
Share on other sites

What was the mistake and how did you get your model to animate?

Sorry, I forgot to explain... looks like there were two different meshes in the same selection, and this didn't allow the animation to work properly. Convex hull, merging the meshes, solved the problem. My mistake. :rolleyes:

  • Like 1

Share this post


Link to post
Share on other sites

One more question.

I have two objects, hatch_1 and hatch_1_1 (the first is the hatch itself, the second is the mechanism that raises it). They both rotate around their own axis, respectively hatch_1_axis and hatch_1_1_axis.

http://i.imgur.com/I9U9o8B.jpg?1

I tried to create two linked animations and it works in Buldozer, but not in the preview (let's say: in the preview the hatch works, but not the mechanism below).

Here are the files:

Config.cpp

class CfgPatches {
        class Hatch_1 {
                units[] = {"Hatch_1"};
                weapons[] = {};
                requiredVersion = 0.1;
                requiredAddons[] = {};
        };
};
 
class CfgVehicles 
{
        class Static {
		};
        class Hatch_1 : Static 
		{
                scope = 2;
                model = "\Hatch_1\Hatch_1.p3d";
                displayName = "Hatch_1";
                vehicleClass = "small_items";
               
                class AnimationSources 
				{
                        class HatchRotation1 
						{
                                source = "user";
                                initPhase = 0;
                                animPeriod = 10;
                        };   			
                };
			
               
                class UserActions 
				{
                        class openHatch1 
						{
                                displayName = "Open hatch";
                                position = "hatch_1_ap";
                                radius = 10;
                                onlyForPlayer = 0;
                                showWindow = 0;
                                condition = true;
                                statement = "this animate [""HatchMove"", 1];";
                        };     
												
                                          
						class closeHatch1 
						{
                                displayName = "Close hatch";
                                position = "hatch_1_ap";
                                radius = 10;
                                onlyForPlayer = 0;
                                showWindow = 0;
                                condition = true;
                                statement = "this animate [""HatchMove"", 0];";
                      
                        };						
                };
        };
};

model.cfg

class CfgModels
{
	
	class Hatch_1
	{
		sectionsInherit="";
		sections[]={};
		skeletonName="hatch_1_bones";
		
		
		class Animations
		{
			class HatchMove
			{
					type = "rotation";
                    source = "HatchRotation1";
                    selection = "hatch_1";
                    axis = "hatch_1_axis";
                    memory = 1;
                    minValue = 0;
                    maxValue = 1;
                    animPeriod = 0;
                    angle0 = 0;
                    angle1 = "rad 90";
			};
			
			class HatchMove_1
			{
					type = "rotation";
					source = "HatchRotation1";
                    selection = "hatch_1_1";
                    axis = "hatch_1_1_axis";
                    memory = 1;
                    minValue = 0;
                    maxValue = 1;
                    animPeriod = 0;
                    angle0 = 0;
                    angle1 = "rad 90";
			};

		};
	};
};

Tried different code options, but didn't find a solution. I'm sure I'm missing a stupid thing, but can't understand what.

 

EDIT: as i guessed, just a stupid thing. Just added the second action in the statement in UserActions

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

×