Wheeled Flying Vehicle
by Robert Brower · 04/03/2005 (9:43 am) · 74 comments
Download Code File
This resource file contains the engine files for a wheeled flying vehicle. The vehicle is a combination of the existing wheeled vehicle and flying vehicles that come with the Torque SDK. There is a script for the vehicle and a sample Max file demonstrating some of the additional features I added, e.g. flaps and rudder animations. The key bindings and options dialog have been changed to support throttle levels. Press Q to throttle up, and E to throttle down. The vehicle takes off and lands when the velocity is at the threshold values for taking off and landing. All files required to make it work are included. There is no readme file. Use at your own risk.
The screenshots show the aircraft taxiing, and taking off.
Enjoy,
Robert
This resource file contains the engine files for a wheeled flying vehicle. The vehicle is a combination of the existing wheeled vehicle and flying vehicles that come with the Torque SDK. There is a script for the vehicle and a sample Max file demonstrating some of the additional features I added, e.g. flaps and rudder animations. The key bindings and options dialog have been changed to support throttle levels. Press Q to throttle up, and E to throttle down. The vehicle takes off and lands when the velocity is at the threshold values for taking off and landing. All files required to make it work are included. There is no readme file. Use at your own risk.
The screenshots show the aircraft taxiing, and taking off.
Enjoy,
Robert
About the author
#22
This modify prevented from crashing
03/26/2006 (11:16 pm)
wheeledflyingvehicle.cc in WheeledFlyingVehicleData::preload function, then change code in bold// RFB 02-16-2005 -> use all available collision details
int nDetailNumber = 0;
while (collisionDetails[nDetailNumber] [b]>= 0 /*-= -1*/[/b])
{
//if (collisionDetails[0] != -1) {
MatrixF imat(1);
PlaneExtractorPolyList polyList;
polyList.mPlaneList = &rigidBody.mPlaneList;
polyList.setTransform(&imat, Point3F(1,1,1));
si->animate(collisionDetails[nDetailNumber]);
si->buildPolyList(&polyList,collisionDetails[nDetailNumber]);
nDetailNumber ++;
}
// <- RFB 02-16-2005This modify prevented from crashing
#23
wheeledflyingvehicle.cc in WheeledFlyingVehicleData::preload function, then change code in bold
03/26/2006 (11:30 pm)
This previous post only work in debug version, not in release version so I change again.wheeledflyingvehicle.cc in WheeledFlyingVehicleData::preload function, then change code in bold
// RFB 02-16-2005 -> use all available collision details
[b]//int nDetailNumber = 0;
for (int nDetailNumber = 0; nDetailNumber < collisionDetails.size(); nDetailNumber++)
//while (collisionDetails[nDetailNumber] -= -1)[/b]
{
//if (collisionDetails[0] != -1) {
MatrixF imat(1);
PlaneExtractorPolyList polyList;
polyList.mPlaneList = &rigidBody.mPlaneList;
polyList.setTransform(&imat, Point3F(1,1,1));
si->animate(collisionDetails[nDetailNumber]);
si->buildPolyList(&polyList,collisionDetails[nDetailNumber]);
[b] //nDetailNumber ++;[/b]
}
// <- RFB 02-16-2005
#24
I'm just about to try to implement this in 1.4. Can I just clarify after all the alterations made above....
To get this to work, do I add the resource and then just change Shannons stuff above to stop any problems, or do I have to sift through the other changes and implement them too?
Also, once these changes are made, does it all work okay, bug free etc?
Cheers for any help
04/20/2006 (4:53 am)
Hi allI'm just about to try to implement this in 1.4. Can I just clarify after all the alterations made above....
To get this to work, do I add the resource and then just change Shannons stuff above to stop any problems, or do I have to sift through the other changes and implement them too?
Also, once these changes are made, does it all work okay, bug free etc?
Cheers for any help
#25
- ,bug free as bug free gets,
Hi Harvey, Yes it works with the changes made.. I havent had any problems with the engine change, just watch what u do with your datablocks in your aircraft.cs file
anyway seems to work fine on mine, dont know about anyone else.
----------------------------------------------------------------------------------------
see below
- http://www.rackspace.jp/gmdev/wheeledFlyingVehicle.zip
-------------------------------------------------------------------------------------
04/28/2006 (6:33 pm)
1.4tge - ,bug free as bug free gets,
Hi Harvey, Yes it works with the changes made.. I havent had any problems with the engine change, just watch what u do with your datablocks in your aircraft.cs file
anyway seems to work fine on mine, dont know about anyone else.
----------------------------------------------------------------------------------------
see below
- http://www.rackspace.jp/gmdev/wheeledFlyingVehicle.zip
-------------------------------------------------------------------------------------
#26
I have edited the .cc file to allow energy drain to cut the engine once energy gets to zero.
this is controled in the aircraft.cs file, - minjetEnergy, jetenergydrain etc..
the aircraft.cs file uses a mix of original aircraft.cs and warsparrow data, maybe its a little buggy, so if you see anything that could be done better please let me know, as I havent go around to fixing things in that yet..
http://www.rackspace.jp/gmdev/wheeledFlyingVehicle.zip
Have Fun,
04/28/2006 (6:49 pm)
Infact, here,s the link to my .cc , .h and aircraft.cs / game.cs files, I have edited the .cc file to allow energy drain to cut the engine once energy gets to zero.
this is controled in the aircraft.cs file, - minjetEnergy, jetenergydrain etc..
the aircraft.cs file uses a mix of original aircraft.cs and warsparrow data, maybe its a little buggy, so if you see anything that could be done better please let me know, as I havent go around to fixing things in that yet..
http://www.rackspace.jp/gmdev/wheeledFlyingVehicle.zip
Have Fun,
#27
Much Appreciated
04/29/2006 (3:30 am)
Fantastic! Thank you so much. I'll have a good play with it all !! 8)Much Appreciated
#28
Thankyou so much for sharing your source! I got this resource working like a charm but for one thing. I'm using the TGE Vehicle resource and I get this error in the console when trying ThottleUp and down.
base/server/scripts/commands.cs (243): Unknown command getThrottleLevel.
Object (1924) Player -> ShapeBase -> GameBase -> SceneObject -> NetObject -> SimObject
Any ideas?
05/23/2006 (10:35 pm)
@ebee t,Thankyou so much for sharing your source! I got this resource working like a charm but for one thing. I'm using the TGE Vehicle resource and I get this error in the console when trying ThottleUp and down.
base/server/scripts/commands.cs (243): Unknown command getThrottleLevel.
Object (1924) Player -> ShapeBase -> GameBase -> SceneObject -> NetObject -> SimObject
Any ideas?
#29
anyway let me know if you have problems...
06/04/2006 (5:57 pm)
Hi Teko, One thing I had to do on Game start is setup the throttleup throttle down keys, you can do this in the options when you first start the game, else try looking at the defaultbind.cs that is included in the original resource, make sure you added that as well as my addition, I relized i had forgotten to add the defaultbind.cs to that .zip so please use the original and also do the key map in the options when you first start.anyway let me know if you have problems...
#30
Does this make sence?
I have also started a thread to see if anyone else would help me out to fix this problem.
06/04/2006 (11:53 pm)
I know what you are saying but that's not the problem. I have got the aircraft working fine if I spawn as the aircraft but I'm going to have it where you can mount the aircraft. I have everything working fine, like when you mount the aircraft it changes the keymaps to the aircraft that has the throttleup and down command to the server. The problem is in the actual throttleup and down function. I think what's going on is that when you mount the aircraft and try to throttleup or down, it checks the vehicle but for some reason it doesn't work right. So when I mount the aircraft and try to throttleup or down, I get that error in the console.Does this make sence?
I have also started a thread to see if anyone else would help me out to fix this problem.
#31
The energy drain works perfectly.. set to 50 barely enough to get going good.. set to 1000 I was able to fly around a long while...
ebee t.. the throttle is like vehicle acceleration correct.. as in you keep the key pressed to maintain speed? Is it possible to set it in increments like other flight sims.. ie. once= 10%, twice=20%.. or using binds.. like Red Baron 1-0 being hotkeys to set throttle lvl.. I will have to rest some then play around with it.
edit: had mispelled ebee t's name :)
06/06/2006 (2:41 am)
Using ebee t's .cc,.h and script files and using Browser's shapes and files I was able to get this working flawlessly in tge 1.4 in about 30 minutes. The energy drain works perfectly.. set to 50 barely enough to get going good.. set to 1000 I was able to fly around a long while...
ebee t.. the throttle is like vehicle acceleration correct.. as in you keep the key pressed to maintain speed? Is it possible to set it in increments like other flight sims.. ie. once= 10%, twice=20%.. or using binds.. like Red Baron 1-0 being hotkeys to set throttle lvl.. I will have to rest some then play around with it.
edit: had mispelled ebee t's name :)
#32
The recent changes I have made to the wheeledflyingvehicle.cc is as follows
I have re-coded the landing, to check for distance from ground, instead of =>thottle zero = driving mode>
so if your flying and you come down to 2 meters off the ground, landing gear lowers and you can land auto.
once flying when you run out of fuel, you keep going forward motion,and dropping, and driving mode doesnt kick in untill you are 2 meters above the ground for a landing.
so basicly when you run out of fuel, the aircraft doesnt go into driving mode, untill you reach the 2 meter ground call, ... its a much nicer look... anyway download the new files below
O.K ------ New Resource Added--------------------------------------------------------------------------------
New .zip for download here - www.rackspace.jp/gmdev/wheeledflyinghieghtAdapt.zip
Includes WheeledFlyingVehicle.cc and .h
06/06/2006 (4:51 pm)
Hi Teko and Tank, I have made some improvements to the overall resource, I was looking at the player/ aircraft mounting - thottleup / thottle down problem yesterday, but unfortunitly I couldnt get it to work either on the player/vehicle scripting side, I ll give this more attention when i get time,...The recent changes I have made to the wheeledflyingvehicle.cc is as follows
I have re-coded the landing, to check for distance from ground, instead of =>thottle zero = driving mode>
so if your flying and you come down to 2 meters off the ground, landing gear lowers and you can land auto.
once flying when you run out of fuel, you keep going forward motion,and dropping, and driving mode doesnt kick in untill you are 2 meters above the ground for a landing.
so basicly when you run out of fuel, the aircraft doesnt go into driving mode, untill you reach the 2 meter ground call, ... its a much nicer look... anyway download the new files below
O.K ------ New Resource Added--------------------------------------------------------------------------------
New .zip for download here - www.rackspace.jp/gmdev/wheeledflyinghieghtAdapt.zip
Includes WheeledFlyingVehicle.cc and .h
#33
I am looking at the .cc code currently, because Tek0 discovered a problem when you start as player, instead of the playerless aircraft, once you mount it appears it doesnt recognise the thottleup / down keypesses, I dont know if this is a scripting side control prob or .cc as of yet...
06/06/2006 (5:06 pm)
@Tank, The accel is set, so its not like the vehicle acceleration. you have 3 level changes, which is set in the manueringForce1 ,2 ,3 in aircraft.cs, so yes one press is 800, second press is 1600 so on..I am looking at the .cc code currently, because Tek0 discovered a problem when you start as player, instead of the playerless aircraft, once you mount it appears it doesnt recognise the thottleup / down keypesses, I dont know if this is a scripting side control prob or .cc as of yet...
#34
http://www.garagegames.com/mg/forums/result.thread.php?qt=44954#345518
this fixes the issue....
06/06/2006 (8:11 pm)
O.K TO fix the issue Tek0 was having with onmount of player and thottle up/down please see this threadhttp://www.garagegames.com/mg/forums/result.thread.php?qt=44954#345518
this fixes the issue....
#35
06/07/2006 (8:18 am)
Great work ebee t! Thanks for the fast reply.. off to fly it now :)
#36
starter.fps/server/scripts/game.cs (303): Unable to instantiate non-conobject class WheeledFlyingVehicle.
Set::add: Object "0" doesn't exist. and also
starter.fps/server/scripts/aircraft.cs (0): Unable to instantiate non-conobject class WheeledFlyingVehicleData.
I am novice and struggling with it.
plz can any one send me complete set of Working files.
06/22/2006 (5:43 am)
My log file reads like this.....starter.fps/server/scripts/game.cs (303): Unable to instantiate non-conobject class WheeledFlyingVehicle.
Set::add: Object "0" doesn't exist. and also
starter.fps/server/scripts/aircraft.cs (0): Unable to instantiate non-conobject class WheeledFlyingVehicleData.
I am novice and struggling with it.
plz can any one send me complete set of Working files.
#37
06/22/2006 (8:40 am)
That means that you didn't the the source correctly to the engine. I pretty sure that's what that is.
#38
select solution explorer - and find the folder named ,vehicles, right click on that and choose add>existing solution, browse to your wheeledflyingvehicle.cc and .h and add them to the project. then do a build..or rebuild..
also another problem which got me when I first complied this resource was, make sure you have Release selected - the location of this is up top of the main program screen, just under the Community option, make sure you select Release instead of debug..otherwise it only works in debug mode.
@@Tek0 - could you get the onmount and control working?
06/22/2006 (5:18 pm)
Yes - make sure you have added the WheeledFlyingVehicle.cc and .h files to the C:\Torque\engine\game\vehicles directory - then open up your compiler and the torque project.select solution explorer - and find the folder named ,vehicles, right click on that and choose add>existing solution, browse to your wheeledflyingvehicle.cc and .h and add them to the project. then do a build..or rebuild..
also another problem which got me when I first complied this resource was, make sure you have Release selected - the location of this is up top of the main program screen, just under the Community option, make sure you select Release instead of debug..otherwise it only works in debug mode.
@@Tek0 - could you get the onmount and control working?
#39
06/23/2006 (5:11 pm)
can you up date the main file to reflect these changes so we can put all this behind us :P
#40
and also try to use a "please before the "can you" and people will be more than willing to help you.
06/23/2006 (7:32 pm)
Yes Glitch just read above where the link says New .zip for download here - www.rackspace.jp/gmdev/wheeledflyinghieghtAdapt.zip and also try to use a "please before the "can you" and people will be more than willing to help you.

Torque 3D Owner Dave Young
Dave Young Games