Game Development Community

Racing-to-Tank

by Okashira · in Torque Game Engine · 08/31/2006 (7:03 pm) · 7 replies

How would I go about changing the car in the starter.racing example into a tank? Like not one that a player like Kork rides in, just one that the player always controls, just like the car in the example.

The only things I can find have to do with making something for Kork to ride in.

Please note that I am new to both TGE & TorqueScript.

Thanks,
Okashira

#1
08/31/2006 (7:09 pm)
The best way to figure that one out would be to open up the starter.racing demo game, and look at the server/scripts/car.cs and game.cs files. It's really simple, and is outlined there. The starter.racing demo works the way you are asking about. One word of warning tho, the starter.racing demo will not work across the net without fixing the net code.
#2
08/31/2006 (7:20 pm)
Are you talking physics or just appearance? I use the starter.fps for everything. All you really need is the car.cs file anyway. I just put it in the fps one. Then you just need to change the object you start as inside game.cs. This is just appearance though. If you want it to drive like a tank you need to write your own vehicle code (based on hover would be a good place to look) or get the Brave Tree tank pack to get something that is already mature and should provide good examples.
#3
08/31/2006 (7:29 pm)
Thanks guys.

I am talking physics and camera. Also, what do you mean by fix the net code? Scripting or C++?

@Frank
You said to try BraveTree's tank pack - but isn't that made to be mounted on by a character like Kork? Again I am very new to this engine and am only in early design of my game so please educate me.
#4
08/31/2006 (8:14 pm)
@Okashira

all of the vehicles, including the tank in the tank pack, can be set up to start with the player AS the vehicle OR set up to mount a player to a vehicle.

the important thing to look at is in game.cs

look for this:


// Create the player object
%player = new Player() {
dataBlock = PlayerBody;
client = %this;
};


and replace it with whatever you want to start as, in the case of the tank:


// BraveTree Tank Pack
// Create a tank instead...
%player = new TankShape() {
dataBlock = AbramsTank;
client = %this;
};
%player.mountable = false;

instructions for this are also included in the tank pack read me.
#5
08/31/2006 (9:24 pm)
Okashira,

I own the Tank Pack and can tell you first hand it's a great place to start for a tank based game. As Joe points out, using the tank as a main player object is extremely easy.

The Tank Pack will give you a pretty realistic tank. With two weapons, ifl based track animations, multiple camera controls, wheels that conform to the terrain, a nice model template for you to learn from and independent turret control amongst other things.

It will not give you a targeting / crosshair solution, an object based from the vehicle class (it's derived from the player class), sound files or a camera that moves with the turret. All of which may or may not matter to you and all have a solution.

The Tank Pack is not compatible with 1.4 out of the box. This thread will solve that for you.
Tank Pack and TGE 1.4

The Tank Pack is a great purchase and certainly worth the price.

- Tim.
#6
09/01/2006 (6:20 am)
Thanks guys, I might purchase that. Though it seems that maybe BraveTree should update their pack? A lot of editing to make it work it seems...
#7
09/01/2006 (6:34 am)
Yes, updating it is on the list of things to do. Since our purchase by GarageGames, we have been very busy and just have not had the time to address this, though we will soon.