Tank Vehicle built to be part of the rest of Vehicle system
by John "Mythic" Henry · 08/10/2011 (8:28 am) · 23 comments
This all started with the purchase of the Bravetree tank ages ago.
Initially it was a great system with a few issues.
It didn't directly inheret from the Base Vehicle class.
That was what I was unhappy with. So I started over and made a tank class
based roughly on the wheeled vehicle class. This is not truly complete as the treads do not
change speed they are just animated at a set speed.
Here is the main files:
torque.abigholeintheweb.com/public_system/useruploads/tankvehicles.zip
Here are the DataBlocks and script parts:
torque.abigholeintheweb.com/public_system/useruploads/tankscripts.zip
First important note!! These are my working versions of the the following files...
vehicle.(h/cpp)
wheeledvehicle.(h/cpp)
tankvehicle.(h/cpp)
....
And the Tank DataBlocks and Modified Vehicle.cs
Here are a few additional files that will help:
*edit*
Had an older version of the Skeleton in there, this is the correct MS3D Skeleton
Sorry About that
*edit*
torque.abigholeintheweb.com/public_system/useruploads/miscfiles_updated.zip
(Notes)
The txt file is general notes of the nodes and such as I was working on it.
The skeleton.ms3d is the Tank Skeleton I used with Hubs/Springs
The Rigid.h/cpp are modified according to some changes others came up with
for rigid bodyu collisions.
I've done some changes that fit with my preferences to basic vehicles (movement keys mainly)
which can be ignored for wheeledvehicles. The modifications to vehicle base class are needed.
It is pretty heavily commented where I made most changes, but this was not coded to be given out.
So please be aware I may have forgotten to mark some changes :)
This basic system is not complete and needs fine tuning and further testing. I am releasing it
so others can improve on what I've done.
You can see where the majority of my work was done in earlier posts, so I am not going to
duplicate those posts, instead I will provide links to those posts. I am providing this
work to get others involved in improving this system so when vehicles are finally made to
work with Physics, we should be able to convert the tanks over as well. This is really for
any vehicle with a rotating gun mount and more then 4 wheels with or without treads.
The main post is this one:
www.garagegames.com/community/forums/viewthread/126020/2#comment-813803
Where I was asking for assistance with mounting objects (Related):
www.garagegames.com/community/forums/viewthread/126560
Further discussion of mounted nodes:
www.garagegames.com/community/forums/viewthread/126180
The resource I used for solving control of the turret rotation:
www.garagegames.com/community/blogs/view/17759
Good luck and I will watch this and help as best I can for those that attempt to work with and
improve it.
As to the Tank itself... I took the basic shape provided by Bravetree and just removed the
Turret/wheels in Milkshape, then created a new skeleton with hubs/springs for the wheels.
As I did not make my own shape, I cannot provide that one, sorry :(
Good luck and may the force be with you...
Initially it was a great system with a few issues.
It didn't directly inheret from the Base Vehicle class.
That was what I was unhappy with. So I started over and made a tank class
based roughly on the wheeled vehicle class. This is not truly complete as the treads do not
change speed they are just animated at a set speed.
Here is the main files:
torque.abigholeintheweb.com/public_system/useruploads/tankvehicles.zip
Here are the DataBlocks and script parts:
torque.abigholeintheweb.com/public_system/useruploads/tankscripts.zip
First important note!! These are my working versions of the the following files...
vehicle.(h/cpp)
wheeledvehicle.(h/cpp)
tankvehicle.(h/cpp)
....
And the Tank DataBlocks and Modified Vehicle.cs
Here are a few additional files that will help:
*edit*
Had an older version of the Skeleton in there, this is the correct MS3D Skeleton
Sorry About that
*edit*
torque.abigholeintheweb.com/public_system/useruploads/miscfiles_updated.zip
(Notes)
The txt file is general notes of the nodes and such as I was working on it.
The skeleton.ms3d is the Tank Skeleton I used with Hubs/Springs
The Rigid.h/cpp are modified according to some changes others came up with
for rigid bodyu collisions.
I've done some changes that fit with my preferences to basic vehicles (movement keys mainly)
which can be ignored for wheeledvehicles. The modifications to vehicle base class are needed.
It is pretty heavily commented where I made most changes, but this was not coded to be given out.
So please be aware I may have forgotten to mark some changes :)
This basic system is not complete and needs fine tuning and further testing. I am releasing it
so others can improve on what I've done.
You can see where the majority of my work was done in earlier posts, so I am not going to
duplicate those posts, instead I will provide links to those posts. I am providing this
work to get others involved in improving this system so when vehicles are finally made to
work with Physics, we should be able to convert the tanks over as well. This is really for
any vehicle with a rotating gun mount and more then 4 wheels with or without treads.
The main post is this one:
www.garagegames.com/community/forums/viewthread/126020/2#comment-813803
Where I was asking for assistance with mounting objects (Related):
www.garagegames.com/community/forums/viewthread/126560
Further discussion of mounted nodes:
www.garagegames.com/community/forums/viewthread/126180
The resource I used for solving control of the turret rotation:
www.garagegames.com/community/blogs/view/17759
Good luck and I will watch this and help as best I can for those that attempt to work with and
improve it.
As to the Tank itself... I took the basic shape provided by Bravetree and just removed the
Turret/wheels in Milkshape, then created a new skeleton with hubs/springs for the wheels.
As I did not make my own shape, I cannot provide that one, sorry :(
Good luck and may the force be with you...
About the author
#22
04/21/2014 (5:24 pm)
any updates on t3d 3.5.1??
#23
That would be a missing function in ...
worldeditor/gui/objectBuilderGui.ed.gui
any object you want to build in editor needs a corresponding create
function as so:
and will have to dig back thru all my backups to find it :)
But it should be the same as the others, just change to the correct
name:
Should work I think... :)
05/20/2014 (8:58 am)
In reference to that error ::Create(..)That would be a missing function in ...
worldeditor/gui/objectBuilderGui.ed.gui
any object you want to build in editor needs a corresponding create
function as so:
function WheeledVehicleData::create(%block)
{
%obj = new WheeledVehicle() {
dataBlock = %block;
parentGroup = EWCreatorWindow.objectGroup;
};
return %obj;
}My bad I seem to have left that out of the included scripts..and will have to dig back thru all my backups to find it :)
But it should be the same as the others, just change to the correct
name:
function TankVehicleData::create(%block)
{
%obj = new TankVehicle() {
dataBlock = %block;
parentGroup = EWCreatorWindow.objectGroup;
};
return %obj;
}Should work I think... :)

Torque 3D Owner John "Mythic" Henry
EveronWorlds
is updating his Physcis for vehicles. For Multi-player the current
Physics vehicles all have issues.
AkA: https://www.garagegames.com/community/blogs/view/22370
So I haven't tested this out in awhile as all my other work has kept me real busy. Most likely the base class for vehicles has changed enough that adding in the modifications for the child class needs to be fixed.
If I get a chance I'll take a look and see if I can spot it.
I just havent looked at this in quite awhile.
No garruntees tho as I just went to Alpha Test Stage on my game :)