3D Game Programming All in One (Course Technology PTR Game Development Series)

In order to test the runabout, we first need to export it from MilkShape.

  1. After saving your work, choose File, Export, Torque Game Engine DTS. You will see the Torque Game Engine (DTS) Exporter dialog box appear.

  2. Use defaults, but make sure they are correct.

    You want to have Export animation and Export material information selected, and Collision Mesh should be set to Collision Meshes (this is automatic if the exporter finds a mesh whose name starts with "Collision"). Click OK when ready.

  3. Export your runabout to DTS format as C:\3DGPAi1\racing\ data\shapes\car\runabout.dts.

  4. Open your wheel model and export it as C:\3DGPAi1\racing\data\shapes\car\wheel.dts.

Next, you need to edit the script that controls the vehicle so it will look for your model and not the default one.

  1. Locate the file C:\3DGPAi1\racing\server\scripts\car.cs and open it with UltraEdit.

  2. There are two lines that say this:

    shapeFile = "~/data/shapes/rifle/weapon.dts";

    Replace each of them with this line:

    shapeFile = "~/data/shapes/tommygun/tommygun.dts";

  3. Then find the line that says this:

    shapeFile = "~/data/shapes/buggy/wheel.dts";

    And replace it with this line:

    shapeFile = "~/data/shapes/car/wheel.dts";

  4. Save the file.

Okay, now it's time to run the racing demo. The following may look familiar to you, since we did this back in Chapter 9.

  1. Browse to C:\3DGPAi1 and click the Run racing Demo shortcut.

  2. Click Start Mission.

  3. In the Launch dialog box, make sure that the Multiplayer Mission box is cleared.

  4. Select Car Race Track from the mission list.

  5. Click Launch.

  6. After the game loads, have at it! You probably should switch to Chase view by pressing the Tab key—there's more to see. See Table 15.1 for the keyboard controls.

Table 15.1: Torque Racing Demo Controls

Key

Description

mouse

steering left or right

Up Arrow

accelerate

Down Arrow

brake

Tab

toggle from first- to third-person viewpoint

Escape

exit the game

Категории