Game Development Community

Newb question - HoverVehicle

by Richard Hart · in Torque Game Engine · 01/24/2005 (7:53 am) · 2 replies

Hi guys.
Looking for a bit of advice for a Torque n00b. (Note, I know coding well enough. I just need to get to grips with the Torque engine).

I'm currently trying to adjust the car demo so that the car acts like a HoverVehicle.
WHat I've done so far is:

* Created a HoverVehicle object. I know this is running in-code fine .via the debugger

* Created hoverboard.cs, which is based off the car.cs file which comes with the demo. I know this file is being read by the system. I can adjust paramters in the .cs file and can see them being read by the code - again - .via the debugger.

* In my new hoverboard.cs file, I have removed the wheels (onAdd does nothing) and set HoverVehicle specific parameters. WHat I have set at this moment:

dragForce = 0.01;
mainThrustForce = 0.5;
reverseThrustForce = 0.2;
strafeThrustForce = 0.2;
floatingGravMag = 0.1;
floatingThrustFactor = 2.0;

At the moment, the no-wheel hovercar doesn't float, or go anywhere. It actually looks like it's stuck in the ground. In the debugger, I can see that in HoverVehicle::updateForces, it's hitting this code:

if (getContainer()->castRay(stabPoints[j].wsPoint, stabPoints[j].wsPoint + stabPoints[j].wsExtension * 2.0,
TerrainObjectType | InteriorObjectType | WaterObjectType, &rinfo)) {
reallyFloating = false;

I'm reading this as - if the car is currently pointing into ground - or some other impassable place - we can't REALLY be floating.

Only trouble is the car STARTS on the ground. How can I get it to float in the first place?
Anybody got any ideas? I'd really appreciate it. Someone could save me a lot of messing around here - potentially...

Thx in advance,
Rich

[edit]
Apologies if I've posted this in the wrong section. Maybe this should be in 'Discussion' - or perhaps 'Getting Started'. Mods, feel free to move it if nessesary...
[/edit]

#1
01/24/2005 (8:07 am)
Rich,

The whole problems with HoverVehicles is getting a correct, working datablock to start with. Search the forums and resources, you'll find that other people were already stuck in the same point you are, and you'll probably find a good hovervehicle Datablock on one of those threads.
#2
01/24/2005 (8:24 am)
Ahh - yes. Thx.
Did a search on 'Hover' in resources, and found exactly what I was looking for. I now have a working Hover Vehicle.

..really should have tried that first eh? ;)

Thx again