Trouble with custom wheels not working
by Ben R Vesco · in Torque Game Engine · 02/23/2006 (6:29 pm) · 13 replies
I have created a custom truck body in Milkshape and exported it as truck.dts. I created a custom wheel in Milkshape and exported it as wheel.dts. I can use my truck.dts with the starter.racing wheel.dts and everything is fine (except the wheels are WAY too small). I can use the starter.racing buggy.dts with my wheel.dts and it still fine. However, when I try to use my truck.dts with my wheel.dts, the mission will not start. Is there anything particular I have to do in order to get my wheel to work with my truck? Is there some common thing I've overlooked like defining a collision mesh for the wheel, or making sure my wheel does something special?
About the author
#2
My truck already has a collision mesh named "Collision-1" and when I changed it to "Col-1" it stopped working altogether.
What do you mean by detail markers?
For the bounds box, I'm using Milkshape which the resource at http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=4273 indicates I should not need the bounds box with that exporter.
02/23/2006 (9:54 pm)
Are you talking about for the truck itself, or the wheel?My truck already has a collision mesh named "Collision-1" and when I changed it to "Col-1" it stopped working altogether.
What do you mean by detail markers?
For the bounds box, I'm using Milkshape which the resource at http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=4273 indicates I should not need the bounds box with that exporter.
#3
Did you find any error reports from torque? Look in the directory the dts is exported to and see if there is a *.dmp file, the Max exporter generates these(others as well) it will contain information about the model and could also show problems.
02/24/2006 (2:59 pm)
I meant the wheel needs the collision mesh. I don't use milkshape, so I do not know how it handles details/markers, but if you have your truck exporting it should be okay.Did you find any error reports from torque? Look in the directory the dts is exported to and see if there is a *.dmp file, the Max exporter generates these(others as well) it will contain information about the model and could also show problems.
#4
The buggy wheel just uses a box as collision mesh and in my own vehicle I did not bother with a wheel collision mesh. (I use Blender)
Which means not a whole lot to Ben. What I suggest you do is open the Milkshape model of the buggy wheel and compare it in every respect to your own model and maybe you will spot the problem.
02/24/2006 (5:49 pm)
The wheeledvehicle class renders the wheel shape itself, i.e. its not treated as a shapebase or TSStatic and therefore the collision mesh actually goes unused.The buggy wheel just uses a box as collision mesh and in my own vehicle I did not bother with a wheel collision mesh. (I use Blender)
Which means not a whole lot to Ben. What I suggest you do is open the Milkshape model of the buggy wheel and compare it in every respect to your own model and maybe you will spot the problem.
#5
I don't have the original Milkshape files for the shapes that came with the torque engine. Or are they available somewhere else?
The very strange thing to me is that my wheels do work with the stock Torque buggy, just not with my truck, while the stock wheels do work with my truck.
02/24/2006 (6:31 pm)
There are no .dmp files. Is Milkshape's exporter always supposed to produce these files or only if there is an error?I don't have the original Milkshape files for the shapes that came with the torque engine. Or are they available somewhere else?
The very strange thing to me is that my wheels do work with the stock Torque buggy, just not with my truck, while the stock wheels do work with my truck.
#6
02/24/2006 (6:35 pm)
Ben, try the showtool pro. I tried the demo once and it does show up all the meshes etc and you can use it to compare your wheel to the buggy wheel.
#7
Do you get any console errors when your mission doesn't load? I've got several vehicles in my game and as I recall from last year some time I had some problems at first with unique tires for each vehicle.
Are you also using the came car.cs file and are just plugging in your dts model names or have you created a new one for the new vehicle (like car2.cs or whatever)?
If you're using unique scripts have you changed changed the data blocks, i.e. "datablock WheeledVehicleTire(CarTire)" to something like datablock "WheeledVehicleTire(CarTire2)" then called for that tire farther down in "datablock WheeledVehicleData(Car2)" where it says "tireDB = "CarTire";" to "tireDB = "CarTire2";"?
I use milkshape also, and your collision mesh named as "collision-1" should be ok, at least mine have worked ok.
Good luck!
-Alan
Really Really Good Things Studio
02/24/2006 (7:17 pm)
Ben,Do you get any console errors when your mission doesn't load? I've got several vehicles in my game and as I recall from last year some time I had some problems at first with unique tires for each vehicle.
Are you also using the came car.cs file and are just plugging in your dts model names or have you created a new one for the new vehicle (like car2.cs or whatever)?
If you're using unique scripts have you changed changed the data blocks, i.e. "datablock WheeledVehicleTire(CarTire)" to something like datablock "WheeledVehicleTire(CarTire2)" then called for that tire farther down in "datablock WheeledVehicleData(Car2)" where it says "tireDB = "CarTire";" to "tireDB = "CarTire2";"?
I use milkshape also, and your collision mesh named as "collision-1" should be ok, at least mine have worked ok.
Good luck!
-Alan
Really Really Good Things Studio
#8
I'm not using the car.cs file directly. I'm using player.cs since in this game the car *IS* the player (racing game).
The names of the datablocks are still things like, DefaultCarTire, DefaultCarSpring, DefaultCar, because I don't have multiple copies of the scripts in the game. Basically, there's no worry about having car.cs and car2.cs both loading. I started this game with a fresh and empty directory structure versus building it inside starter.racing.
02/25/2006 (2:17 pm)
I don't get console errors. In fact, if I place an echo statement at the end of the ::onAdd function, all the wheels are put on the model and the it gets to the last line of the function. I'll post my onAdd function and the console output in the next post.I'm not using the car.cs file directly. I'm using player.cs since in this game the car *IS* the player (racing game).
The names of the datablocks are still things like, DefaultCarTire, DefaultCarSpring, DefaultCar, because I don't have multiple copies of the scripts in the game. Basically, there's no worry about having car.cs and car2.cs both loading. I started this game with a fresh and empty directory structure versus building it inside starter.racing.
#9
and my console output
The activating direct input line is the last thing in the console. The game hangs on the loading screen and I have to kill the process to get out of it.
02/25/2006 (2:19 pm)
Snippet from player.csfunction WheeledVehicleData::onAdd(%this, %obj)
{
echo("******** adding a WheeledVehicleData");
echo("***** about to add wheels *****");
for (%i = (%obj.getWheelCount() - 1); %i >= 0; %i--)
{
echo("***** adding wheel" SPC %i SPC "*****");
%obj.setWheelTire(%i, DefaultCarTire);
%obj.setWheelSpring(%i, DefaultCarSpring);
%obj.setWheelPowered(%i, false);
}
echo("***** done adding wheels *****");
%obj.setWheelSteering(0, true);
%obj.setWheelSteering(1, true);
%obj.setWheelPowered(2, true);
%obj.setWheelPowered(3, true);
echo("***** done adding vehicle *****");
}and my console output
. . . ******** adding a WheeledVehicleData ***** about to add wheels ***** ***** adding wheel 3 ***** ***** adding wheel 2 ***** ***** adding wheel 1 ***** ***** adding wheel 0 ***** ***** done adding wheels ***** ***** done adding vehicle ***** Mapping string: MissionStart to index: 11 *** Initial Control Object Activating DirectInput...
The activating direct input line is the last thing in the console. The game hangs on the loading screen and I have to kill the process to get out of it.
#10
truck.ms3d: Milkshape file for my truck
truck.dts: Milkshape exported dts for the truck
wheel.ms3d: Milkshape file for my wheel
wheel.dts: Milkshape exported dts for the wheel
If I put my custom wheel on the demo dune buggy, it works fine (though the wheel looks huge). The demo buggy wheel used to work on my truck until I modified the model a bit more. I had left some open edges on the model and decided to close them up to see if that would fix the problem, it didn't, and the current version of the model won't work with the default wheels anymore.
sound of hair pulling out :)
02/26/2006 (1:56 am)
I've posted my Milkshape and dts files if anyone would be kind enough to poke into them further. This really has me stymied.truck.ms3d: Milkshape file for my truck
truck.dts: Milkshape exported dts for the truck
wheel.ms3d: Milkshape file for my wheel
wheel.dts: Milkshape exported dts for the wheel
If I put my custom wheel on the demo dune buggy, it works fine (though the wheel looks huge). The demo buggy wheel used to work on my truck until I modified the model a bit more. I had left some open edges on the model and decided to close them up to see if that would fix the problem, it didn't, and the current version of the model won't work with the default wheels anymore.
sound of hair pulling out :)
#11
I try your files and get it to run.
1. the milkshape files:
you forgot an importent joint => the "mass" joint. This joint show the center of the vehicle mass to the engine.
Also your collission box could be bigger, with this small size who stuck already half in the house before the engine notice an impact.
2. I made a script car.cs and with this it works for me. As you can see the wheels are on the truck.

I made the script for TGE 1.4, Starter.Racing and it replace the original car.cs (backup this file before). The Truck models have to be in a folder "/data/shapes/truck"
The particle and other things in the script are set to the buggy stuff, so you have to change the script to your particles.
I hope this will help you.
-Sven
02/26/2006 (3:43 am)
Hello Ben,I try your files and get it to run.
1. the milkshape files:
you forgot an importent joint => the "mass" joint. This joint show the center of the vehicle mass to the engine.
Also your collission box could be bigger, with this small size who stuck already half in the house before the engine notice an impact.
2. I made a script car.cs and with this it works for me. As you can see the wheels are on the truck.

I made the script for TGE 1.4, Starter.Racing and it replace the original car.cs (backup this file before). The Truck models have to be in a folder "/data/shapes/truck"
The particle and other things in the script are set to the buggy stuff, so you have to change the script to your particles.
I hope this will help you.
-Sven
#12
Now I have an even more interesting problem. If I load your car.cs into starter.racing, everything works great. If I load your script into my game, it is still broken, though the console log says the car finished loading successfully.
I'll keep researching the problem.
02/26/2006 (11:47 am)
Thanks very much for looking at the files. The collision box was small because I wanted to make sure it wasn't interfering with the wheels or the ground in case that was my problem.Now I have an even more interesting problem. If I load your car.cs into starter.racing, everything works great. If I load your script into my game, it is still broken, though the console log says the car finished loading successfully.
I'll keep researching the problem.
#13
When I activate
trace(true);
I can see that we enter this function, get all the way down to where we call
Canvas.setContent(PlayGui);
which returns successfully, but we never return from initialControlSet();
Here is the console output:
It ends abruptly right there. Now, If I comment out the call to
// Canvas.setContent(PlayGui);
and instead call that manually from the console once the mission finishes loading, everything works fine. I'm having a hard time figuring out why that is. Would there be a more appropriate forum to post in?
02/26/2006 (1:13 pm)
More interesting. In client/serverConnection.cs (same as starter.racing) we have this function:client/serverConnection.cs
function GameConnection::initialControlSet(%this)
{
echo ("*** Initial Control Object");
// The first control object has been set by the server, we're ready to go.
// first check if the editor is active
if ( ! Editor::checkActiveLoadDone())
{
if (Canvas.getContent() != PlayGui.getId())
{
Canvas.setContent(PlayGui);
}
}
echo ("*** Initial Control Object");
}When I activate
trace(true);
I can see that we enter this function, get all the way down to where we call
Canvas.setContent(PlayGui);
which returns successfully, but we never return from initialControlSet();
Here is the console output:
.
.
.
Entering GameConnection::initialControlSet(1385)
*** Initial Control Object
Entering editor::checkActiveLoadDone()
Leaving editor::checkActiveLoadDone() - return 0
Entering [CanvasCursor]GuiCanvas::setContent(Canvas, playGui)
Entering LoadingGui::onSleep(1213)
Leaving LoadingGui::onSleep() - return
Entering [FPSMod]playGui::onWake(1254)
Entering playGui::onWake(1254)
Activating DirectInput...
keyboard0 input device acquired.
Leaving playGui::onWake() - return
Entering [FPSMod]showFPS()
Entering [FPSMod]FPSshow()
Leaving [FPSMod]FPSshow() - return 1
Leaving [FPSMod]showFPS() - return 1
Leaving [FPSMod]playGui::onWake() - return 1
Entering [CanvasCursor]GuiCanvas::checkCursor(Canvas)
Entering cursorOff()
Leaving cursorOff() - return
Leaving [CanvasCursor]GuiCanvas::checkCursor() - return
Leaving [CanvasCursor]GuiCanvas::setContent() - return
*** Initial Control ObjectIt ends abruptly right there. Now, If I comment out the call to
// Canvas.setContent(PlayGui);
and instead call that manually from the console once the mission finishes loading, everything works fine. I'm having a hard time figuring out why that is. Would there be a more appropriate forum to post in?
Torque 3D Owner Martin "Founder" Hoover
I would suggest looking for any error reports from torque about the model. (It will report errors when the file that containes the datablock for the wheel is executed)