Okay, Knight was asking me about how to make wheels for the Robot Wars mod, so I'm going to bump this thread and provide a little more information.
Gazea got the most important bit, which is
use Serge's compiler and decompiler. Dummy's doesn't know how to handle node parents and will break any wheels you try to edit.
After you do that, editing wheels is pretty much the same as any other component. The format is a bit different, however, so I'm just going to go over how wheels are set up so you know what you're doing.
If you press F12 in the bot lab, you'll notice that all the wheels have a wonky collision box around them. This is something unique to wheels and is called the
traction zone. It's invisible and doesn't collide with anything, but the game uses it to determine if a wheel is getting traction or not.
This zone needs to be slightly bigger than the wheel's actual collision mesh. If it's too small, the wheel won't get traction when it's supposed to and the bot won't move. If it's too big, funny things will happen when the bot gets close to walls.
In the bot lab, you'll also notice that all the wheels are aligned to rotate on the Z axis. This is not a coincidence. Because RA2 is finicky,
wheels will ONLY work if they spin on the Z axis. Keep that in mind if you're making a custom wheel model.
Now let's look inside the gmf file, using the rubber wheel as an example. Wheels are funny because they have two separate objects in one file, the wheel itself and the traction zone. The thing about having two objects is, you can only use one attach point to put it on a bot, meaning that the other object is going to be hanging loose. Normally, the loose object will fall into the eternal gray abyss at the bottom of the bot lab, never to be seen again.
To solve this problem, you need to link the two objects together. Motors do this with an axle constraint. Wheels do it with something called a node parent. Here's the relevant part in the gmf file.
The node parent is a blank "dummy" object that the other objects are linked to. It's usually called wheel_rbodies. To link the objects, you need to put a NODE_PARENT line right under the NODE_NAME, and specify the name of the node parent. This line does not appear in any other components, and is the reason why you can't use Dummy's compiler to work with wheels.
The rest of the wheel gmf is like any other component until you get to the RB Collection at the bottom.
Here there are two rigidbody lists, where normally there is just one. The first one contains wheel_rbodies, the node parent. See that NUMBER_OF_CHILDREN line? That tells the game how many objects are linked to the node parent. In this case, it's 2.
The second rigidbody list is like what you would find in any other component. There's one very important line here that you don't ever need to worry about with other components, however, and that is the DISABLE_COLLISIONS line for the traction zone. THIS NEEDS TO BE SET TO 1 or the wheel will turn red when you try to attach it in-game and tell you that components must not overlap other components. I think. It's been a while since I forgot to set that to 1.
The .txt fileThe .txt file is pretty simple. There are just a couple of new lines that you won't see in other components. Here is what they do.
contact = tells the game which object to use as the traction zone.
grip = Think of grip as a speed multiplier. Bot speed is determined by motor power x wheel grip. "Normal" grip is around 1. Fast is 1.2, and "whooooa I can move my SHW with 2WD angle motors" is 2.
resistance = Resistance is kind of hard to explain. It has to do with turning. The best way to figure it out is to mess with it and see how it affects your driving. Low resistance seems to result in more skidding and sliding, while high resistance seems to make sharper, tighter turns. All the stock wheels use resistance = 0.2, except the shiny hub wheel which has 0.12 because somebody at Gabriel made a typo, I guess. The maximum seems to be 1.