Jump to content
Sign in to follow this  
willrobinson

Vehicle anim problem

Recommended Posts

Hello, so I'm attempting to config a vehicle, and cannot get the model.cfg animations to work. Its definitely just some dumb noob mistake so i'm hoping some of you more experienced addon makers can help me out. here are the configs:

config.cpp

class CfgModels
{
class default {};
class Vehicle: default {};
class Car: Vehicle {};
class Rat: Car {};
};


class CfgPatches
{
    class Rat
    {
        units[] = {Rat};
        weapons[] = {};
        requiredVersion = 1.0;
    };

};
class CfgVehicles
{

    class All {};
    class AllVehicles: All {};
    class Land: AllVehicles {};
    class LandVehicle: Land {};
    class Car: LandVehicle {};
    class Rat: Car
    {                               
       displayName="1946 RatRod";
terrainCoef = 2.0;		
model= \rat\pickup;	      	
side=3;			
crew="Civilian2";	
maxSpeed=360;
       transportSoldier=0;     
       scope = 2;		
     };
}

model.cfg

class CfgSkeletons
{
class vehicle;
class rat: vehicle
   {
	skeletonInherit="";
	skeletonBones[]=
	{
		"levy predni","pravy predni","drivewheel",""
	};
};
};
class CfgModels
{
class vehicle;
class rat: vehicle
{
	skeletonName = "rat";
	class Animations
	{
		class Right_Wheel_Turn
		{
			type="rotationY";
			source="drivingWheel";
			selection="levy predni";
			axis="wheel_1_1_steering_axis";
			memory=1;
			animPeriod=0;
			sourceAddress="loop";
			minValue="rad -180";
			maxValue="rad +180";
			angle0="rad +90";
			angle1="rad -90";
		};
		class Left_Wheel_Turn: Right_Wheel_Turn
		{
			selection="pravy predni";
			axis="wheel_2_1_steering_axis";
		};
		class SteeringWheel
		{
			type="rotation";
			source="drivingWheel";
			selection="drivewheel";
			axis="drivewheel axis";
			memory=1;
			animPeriod=0;
			minValue=-1;
			maxValue=1;
			angle0=18;
			angle1=-18;
		};
	};
};
};	

Edited by WillRobinson

Share this post


Link to post
Share on other sites

the class name in the model.cfg has to be the the same as your .p3d name

https://community.bistudio.com/wiki/Model_Config

class cfgModels

{

class NameOfP3d

{

class Animations

{

class ModelClassName

{

selection=BoneName;

source=AnimClassName; //optional

source=user; //optional. default AnimClassName==ModelClassName

};

};

};

};

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  

×