Game Development Community

Vehicle tutorial

by Edward Gardner · in Torque Game Engine · 11/17/2001 (9:31 am) · 12 replies

I cannot get vehicles to work in 1.1

Has ANYONE gotten them to work?

I follow the tutorial, and I can get a spawning flying vehicle but I cannot mount it.

I have tried with mount0 assignations as well as with no joints created (which is how I had it in 1.0

Very lost and frustrated, find me on IRC or post here :(

#1
11/17/2001 (6:01 pm)
Yup, same problem. I see lots of errors in the scripts that may contribute to this... trying to track each one down.

Durned shrike keeps flying around on its own... :-(
#2
11/18/2001 (1:25 am)
Hmm..

They seem to work for me, but I remember having to change some of the mount code... It was listed in another forum here, just look around I'm sure you'll find it.
#3
11/18/2001 (1:33 am)
Erf, searching for mount was less than useful :(

Any suggested keywords?
#4
11/18/2001 (5:44 am)
Well, which tut did you use, anyway?

The one I used spawned the vehicle at the eyepoint, so mounting was not a problem.. my problem was that once i jumped off the vehicle, i couldn't mount it again. Fixing that involved changing the mount/dismount code, as I said.

And a search for mount in your cs files should have pointed you in the right direction. That is, if it's the same tut I used...

Sorry, I would be more specific, but I don't have my code handy right now.
#5
11/18/2001 (5:50 am)
I used the only tut I know :)

http://gameznet.com/v12/scripting/vehicletutorial.shtml

I am using custom vehicles, I suppose it is time to breal out t2 and see if the t2 vehicles work, but this vehicle tut worked fine as is in 1,0.

Yeah, I corrected the "remount" code in version 1.0 with this:

function Player::setMountVehicle(%this, %val)
{
// Allow the player back on to a vehicle
%this.mountVehicle = %val;
}

-edit-
Not my vehicle model, T2 vehicles are unmountable as well.

This is a fairly recent rev of 1.1, maybe 2 weeks old tops.

Am I missing something obvious?
#6
11/18/2001 (7:35 am)
In player.cs, above this: if ((%className $= WheeledVehicleData || %className $= FlyingVehicleData || %className $= HoverVehicleData) && %obj.mountVehicle && %obj.getState() $= "Move" && %col.mountable) {

I was missing this:
%className=%this.className;


Then follow the dismount instructions in this thread:

http://www.garagegames.com/index.php?sec=mg&mod=forums&page=result.thread&qt=1126

Works like a charm now.
#7
11/20/2001 (12:15 am)
Great, thanks. I can get on the thing now and ride it. The flight dynamics are quite strange ...

Anyway - I can't dismount ! When I hit my jump key, I just end up turning in my seat, facing different directions ... Is there a change that needs to be made to the dismount code too ?
#8
11/20/2001 (4:47 am)
Dismount instructions in that link thread above :)
#9
11/20/2001 (5:40 am)
DOH!
#10
11/20/2001 (3:34 pm)
works a treat ! thanks !
#11
11/20/2001 (4:08 pm)
Would someone like to recap this entire "adding vehicle thing" and maybe write a small tutorial for the Torque community and post it as a resource?

That would be very nice.

// Clocks out
#12
12/06/2001 (11:13 pm)
After i dismount i can no longer pick up a gun or use one that i already had on me. Anyone had this problem?