Jump to content
Sign in to follow this  
Jantemplar

Wheel animation, animates incorrectly

Recommended Posts

Hey guys, hopefully someone can help.

I have animated my car but have met a problem with the wheels, instead of the wheels turning, they animate themselves into a big circle around the car.

Im not sure what i have done wrong, but too me its fine, and this is what would have worked in ARMA 1, is there something different in ARMA 2 or have i made a mistake.

I hope someone can help.

If you need screen shots or a video just ask but for now here is the code for animating the wheels.

Thanks for reading and looking in on my post.

		class Animations
	{

                      class Steeringwheel 
                      {
                               type = "rotation";
                               source = "drivingwheel";
                               selection = "volant";
                               axis = "osavolantkon";
			memory = "false";
                               angle0 =4;
                               angle1 =-4;
                               minValue = -1;
                               maxValue = 1;
                       };

                       class TireFL
		{
			type="rotationX";
			source="wheel";
			selection="levy predni";
			axis="";
			memory=1;
			sourceAddress="loop";
			minValue=0;
			maxValue=1;
			angle0=0;
			angle1="rad -360";
		};
                       class TireFR: TireFL  
                       {
                               selection = "pravy predni";
			axis="";
                       };
                       class TireRL: TireFL  
                       {
                               selection = "levy zadni";
			axis="RLaxis";
                       };
                       class TireRR: TireFL  
                       {
                               selection = "pravy zadni";
			axis="RRaxis";
                       };

                       class TireFLTurn 
                       {
                        type = "rotationY";
                        source = "Steeringwheel";
                        selection = "levy predni";
                        axis = "";
                        memory = "true";
                        sourceAddress = "clamp";
                        minValue = -1;
                        maxValue = 1;
                        angle0 = "rad 35";
                        angle1 = "rad -35";
                       };
                       class TireFRTurn: TireFLTurn 
                       {
                        selection = "pravy predni";
                        };
	};

Share this post


Link to post
Share on other sites

try this:

class TireFL

{

type="rotationX";

source="wheel";

selection="levy predni";

axis="";

memory=true;

sourceAddress="loop";

minValue=0;

maxValue=1;

angle0=0;

angle1="rad -360";

};

class TireFR: TireFL

{

selection = "pravy predni";

};

class TireRL: TireFL

{

selection = "levy zadni";

};

class TireRR: TireFL

{

selection = "pravy zadni";

};

Share this post


Link to post
Share on other sites

make sure each selection only has the specific wheel selected and nothing else. from reading this, it looks like there might be an additional vertex or something selected which then screws up the rotation.

if that doesn't help, just add an axis in the memory lod for each wheel and change your model.cfg accordingly.

it might not be the best method to fix this, but it'll work.

Edited by TeRp

Share this post


Link to post
Share on other sites

Hmm, i think i found the problem, There was just 1 extra point on the tire connected to a vehicle. Im trying it now.

Edit: Now the rims stay still and the rubber just goes round in a massive circle like it did before.

Edit 2 : Reconnected the rims, but still goes in a big circle around, also the steering wheel is not sticking to its axis and flies around the car.

Edited by Jantemplar

Share this post


Link to post
Share on other sites

I think it's time for some pictures now, showing both the selections for each wheel and the faulty animation. :)

Also, could you please post or link your complete model.cfg.

Edited by TeRp

Share this post


Link to post
Share on other sites

Grhh, fraps wont work !!!!!

Ok heres what i have for now :)

Config.cpp

#define TEast 0
#define TWest 1
#define TGuerrila 2
#define TCivilian 3
#define TSideUnknown 4
#define TEnemy 5
#define TFriendly 6
#define TLogic 7
#define true 1
#define false 0

// type scope
#define private 0
#define protected 1
#define public 2

#define WeaponNoSlot				0// dummy weapons
#define WeaponSlotPrimary		1// primary weapons
#define WeaponSlotSecondary	16// secondary weapons
#define WeaponSlotItem			256// items
#define WeaponSlotBinocular	4096// binocular
#define WeaponHardMounted		65536


class CfgPatches
{
class Monaro
{
 units[] = {"MonaroCiv"};
 weapons[] = {};
 requiredVersion = 1.000000;
};
};

class cfgsounds
{
class Monarostart
{
	sound[]={"\Monaro\Civilian car\sounds\enginestart.wav",.10,1};
	name="Monaro Start";
	titles[]={};
};
};


class Mode_SemiAuto;
class Mode_Burst;
class Mode_FullAuto;
class CfgWeapons;
class cfgSkeletons
{
class Monaro_Skeleton
{
	isDiscrete=1;

	skeletonInherit="";
	skeletonBones[]=
	{
		"pravy predni","",
		"pravy zadni","",
		"levy predni","",
		"levy zadni","",

		"volant","",

	};
};
};

class cfgModels
{
class Civcar
{
	sectionsInherit="";
	sections[]=
	{
		"levy predni","pravy predni","levi zadni","pravy zadni","volant",

	};

	skeletonName="Monaro_Skeleton";

	class Animations
	{

                      class Steeringwheel 
                      {
                               type = "rotation";
                               source = "drivingwheel";
                               selection = "volant";
                               axis = "osavolantkon";
			memory = "false";
                               angle0 =4;
                               angle1 =-4;
                               minValue = -1;
                               maxValue = 1;
                       };

		class TireFL
		{
			type="rotationX";
			source="wheel";
			selection="levy predni";
			axis="";
			memory=true;
			sourceAddress="loop";
			minValue=0;
			maxValue=1;
			angle0=0;
			angle1="rad -360";
		};
		class TireFR: TireFL
		{
		selection = "pravy predni";
		};
		class TireRL: TireFL
		{
		selection = "levy zadni";
		};
		class TireRR: TireFL
		{
		selection = "pravy zadni";
		}; 

                       class TireFLTurn 
                       {
                        type = "rotationY";
                        source = "Steeringwheel";
                        selection = "levy predni";
                        axis = "";
                        memory = "true";
                        sourceAddress = "clamp";
                        minValue = -1;
                        maxValue = 1;
                        angle0 = "rad 35";
                        angle1 = "rad -35";
                       };
                       class TireFRTurn: TireFLTurn 
                       {
                        selection = "pravy predni";
                        };
	};
};
};


class CfgVehicleClasses
{
class Monaro
{
 displayName = "MonaroCiv";
};
};



class CfgVehicles
{
class All{};
class AllVehicles: All{};
class Land: AllVehicles{};
class LandVehicle: Land{};
class Car : LandVehicle
{
	class Exhausts;
	class AnimationSources;
};
class Car_sedan  : Car {};
class Monaro: Car_sedan
{

	scope=public;

	vehicleClass="Monaro";
	displayName="Holden Monaro Civilian";
	picture="\Monaro\icons\picture.pac";
	icon="\Monaro\icons\icon.pac";
	model="\Monaro\Civiliancar\Civcar";
	nameSound="car";
	autocenter=false;
	accuracy=.90;
	canlock = true;

	crew="Doctor";
	side=3;
	type=1;
	typicalCargo[]={};
	cargoIsCoDriver[] = {1,0 };
	magazines[] = {};
	unloadInCombat = false;
	class TransportWeapons{};
	transportSoldier=3;
	transportMaxMagazines=0;
	transportMaxWeapons=0;
	viewCargoShadow = true;

	maxSpeed=209;
	turnCoef=1.9500000;
  		terrainCoef=3.550000;
               brakeDistance=20.00;
	cost=30000;
	fuelCapacity=35;

	armorWheels=0.07;
	armor=18; 
	armorStructural=8.0; 
	armorEngine=2.2;

               soundEngine[]={"\Monaro\Civiliancar\sounds\engine.wav",.10,1};  

	selectionBrakeLights="BLight";
	selectionBackLights="Blight";
	class Exhausts
	{
		class exhaust1
		{
			position = "vyfuk start";
			direction = "vyfuk konec";
			effect ="ExhaustsEffect";

		};
		class exhaust2:exhaust1
		{
			position = "exhaust2start";
			direction = "exhaust2end";

		};
	};

	class Library {libTextDesc = "Holden Monaro.";};


	class HitEngine  {armor = 0.4;material = 60;name = "motor";visual = "motor";passThrough = 1;};
 		class HitBody    {armor = 1;material = 51;name = "karoserie";visual = "karoserie";passThrough = 1;};
 		class HitFuel    {armor = 0.3;material = 51;name = "palivo";passThrough = 1;};
	class HitLFWheel {armor=0.38;material=-1;name="levy predni tlumic";visual="levy predni tlumic";passThrough=0;};
	class HitRFWheel {armor=0.38;material=-1;name="pravy predni tlumic";visual="pravy predni tlumic";passThrough=0;};
	class HitLBWheel {armor=0.38;material=-1;name="levy zadni tlumic";visual="levy zadni tlumic";passThrough=0;};
	class HitRBWheel {armor=0.38;material=-1;name="pravy zadni tlumic";visual="pravy zadni tlumic";passThrough=0;};



	};
};

and some oxygen screenies there over 100kb so links:

http://i264.photobucket.com/albums/ii191/Jantemplar/levyp.png

http://i264.photobucket.com/albums/ii191/Jantemplar/levyz.png

http://i264.photobucket.com/albums/ii191/Jantemplar/pravy.png

http://i264.photobucket.com/albums/ii191/Jantemplar/pravyz.png

Faulty animation Images in order:

http://i264.photobucket.com/albums/ii191/Jantemplar/arma22009-08-2222-46-40-13.jpg

http://i264.photobucket.com/albums/ii191/Jantemplar/arma22009-08-2222-46-47-04.jpg

http://i264.photobucket.com/albums/ii191/Jantemplar/arma22009-08-2222-46-49-16.jpg

http://i264.photobucket.com/albums/ii191/Jantemplar/arma22009-08-2222-46-51-22.jpg

http://i264.photobucket.com/albums/ii191/Jantemplar/arma22009-08-2222-46-53-01.jpg

http://i264.photobucket.com/albums/ii191/Jantemplar/arma22009-08-2222-46-54-76.jpg

http://i264.photobucket.com/albums/ii191/Jantemplar/arma22009-08-2222-47-00-42.jpg

http://i264.photobucket.com/albums/ii191/Jantemplar/arma22009-08-2222-47-01-61.jpg

http://i264.photobucket.com/albums/ii191/Jantemplar/arma22009-08-2222-47-02-86.jpg

http://i264.photobucket.com/albums/ii191/Jantemplar/arma22009-08-2222-47-04-18.jpg

http://i264.photobucket.com/albums/ii191/Jantemplar/arma22009-08-2222-47-05-89.jpg

http://i264.photobucket.com/albums/ii191/Jantemplar/arma22009-08-2222-47-07-33.jpg

If you guys need anything more just ask, its 11pm over here so i need to head to bed.

I hope we can figure out what is wrong.

p.s, ignore the shadow, its my fault i haven't completed the shadow lod.

Edited by Jantemplar

Share this post


Link to post
Share on other sites

Well, cfgSkeletons and cfgModels do not belong into the config.cpp file but into a file called model.cfg. you have to paste those classes in there and put the file into the same folder where your p3d is at.

Then try restarting bulldozer and try the anims again.

Switch anim sources using [ and ] and animate them with your mouse wheel.

You don't need to start ArmA to test anims.

Check this biki article for more info on o2 and bulldozer.

Also, change memory=true; to memory=false; or memory=0; as there is no axis present for those anims.

Edited by TeRp

Share this post


Link to post
Share on other sites

Hmm, i thought i read somewhere you could put them in the config.cpp

Thanks for that bulldozer trick, didn't know about it. Trying now :P

---------- Post added at 11:00 PM ---------- Previous post was at 10:56 PM ----------

No longer fixed, it works in bulldozer but the animations do not work in game.

Edited by Jantemplar

Share this post


Link to post
Share on other sites

A Monaro! awesome

memory=true; --> memory="true";

"volant","", --> drop the last comma

"volant", --> drop the last comma

... might help ... maybe

Share this post


Link to post
Share on other sites

Thanks Gnat, oh and you would also be pleased to know the wheel is on the Right hand side :)

---------- Post added at 08:11 AM ---------- Previous post was at 07:33 AM ----------

Hmm interesting, the animations work correctly in bulldozer, but when i compile and put it in game they do not. Any thoughts or suggestions ??

Share this post


Link to post
Share on other sites

I assume you're not binarizing your addon?

Share this post


Link to post
Share on other sites

Yes. Certain things dont work properly until you do, and you never can tell exactly what until you do.

.... only takes a few minute to run BinPBO. You destination directory can be straight into your mod testing game directory :)

Share this post


Link to post
Share on other sites

ahh, i didn't know what he meant by binarize, yes i am compiling it into a PBO each time i test it in game.

Hang on maybe i made a mistake testing now.

Damit CPBO!!!, i just find out it does not binarize!!!, ok binarizing using binpbo now.

Edit: Ok well the animations still do not work. but the load time is ten times faster, also in generated a 3gb text file as well, what the hell is it??.

Edited by Jantemplar

Share this post


Link to post
Share on other sites

got a question about the same thing, im edited the landrovers currently to a 6 x 6 version (very very very wip so far) and just wanting to know how to get that 2 extra wheels to rotate on their own, is there another section name? or?

Share this post


Link to post
Share on other sites

I can answer that one rhodesy. In your model.cfg that you have your skeleton bones. In that add the names of what ever you called your brand new wheels like so.

			"wheel5","",
		"wheel6","",

Once youve done that then scroll down your model.cfg to your class animations, where you have your original wheels animating. Should look something like this:

		class Animations
	{

                      class Steeringwheel 
                      {
                               type = "rotation";
                               source = "drivingwheel";
                               selection = "volant";
                               axis = "osavolantkon";
			memory = "false";
                               angle0 =4;
                               angle1 =-4;
                               minValue = -1;
                               maxValue = 1;
                       };

		class TireFL
		{
			type="rotationX";
			source="wheel";
			selection="levy predni";
			axis="";
			memory=true;
			sourceAddress="loop";
			minValue=0;
			maxValue=1;
			angle0=0;
			angle1="rad -360";
		};
		class TireFR: TireFL
		{
		selection = "pravy predni";
		};
		class TireRL: TireFL
		{
		selection = "levy zadni";
		};
		class TireRR: TireFL
		{
		selection = "pravy zadni";
		}; 

                       class TireFLTurn 
                       {
                        type = "rotationY";
                        source = "Steeringwheel";
                        selection = "levy predni";
                        axis = "";
                        memory = "true";
                        sourceAddress = "clamp";
                        minValue = -1;
                        maxValue = 1;
                        angle0 = "rad 35";
                        angle1 = "rad -35";
                       };
                       class TireFRTurn: TireFLTurn 
                       {
                        selection = "pravy predni";
                        };
	};
};
};

Once you find the sections you are looking for, all you need to add will be this

			class TireML: firsttireanimated
		{
		selection = "wheel5";
		};
		class TireMR: firsttireanimated
		{
		selection = "wheel6";
		}; 

if you have trouble post up your code and i will do it for you.

Now back to me, i have tried many things to fix it and now when ever i get in the drivers seat of the car the game crashes LOL. But when i get an ai to drive it around there is still the animation fault. So if anyone has an idea on how to fix it or would like the binarized or unbinarized for purely testing purposes only just ask, or give suggestion on how i could possibly fix it.

Share this post


Link to post
Share on other sites

champion, wont be awhile till i work on it some more, was only some experiments, but will be doign it in the future

Share this post


Link to post
Share on other sites

Stuff it guys, im just going to restart and do the config, model selections etc.

Share this post


Link to post
Share on other sites

If after this you still having trouble, consider sending me the file, but your call.

Share this post


Link to post
Share on other sites

Hi all! Gnat I can see you helped many of people here, I'm a noob in this and I would kindly ask for help. OK, so I'm done with my first model, it is a car, Lamborghini Murcielago, no textures yet or anything just model, I'm gonna start with config soon, and what I'm interested in are two things;

1. Do I have to use levy predni, pravi predni, etc... for wheels in config file or can I just use like l_front, r_front etc as those are my wheel names on model...? (how does game knows those are wheels anyways? How it recognizes them as ''wheels''?)

2. I have disc brakes with calipers on my model... how the hell do I animate those to turn left and right with front wheels lol? I can't link them to wheels cause they will rotate then?

I'm sorry if I'm bothering you it's just I don't know any other place to ask lol and I can see you're helping people around with these kind of things...

Thanks in advance!

P.S. Jan you said your game crashes when you enter in car, I've had same problem with my test object (ugly extremly-low-poly car lol) when I inherited skeleton from VWGolf for my car and I used czech names on skeleton/wheels(?)... I dunno if this helps I'm just saying I had same problem which occurred when I changed names to czech... or skeleton inherit caused the problem, I have no idea...

Edited by Minoza

Share this post


Link to post
Share on other sites

Crashing normally occurs if you are missing the view lods, in this case the View Pilot lod.

Each model should at least have the following lods in order to not cause any crashes:

  • A Resolution Lod
  • A View Pilot Lod
  • A Geometry Lod with a box and mass applied
  • A Landcontact Lod with vertices

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  

×