Wheeled Flying Vehicle TGEA
by Stephen · in Torque Game Engine Advanced · 04/10/2009 (1:30 am) · 16 replies
I'm trying to add the Wheeled Flying Vehicle resource to TGEA 1.8.1 but I''m having some problems getting it to worked. Would someone be willing to help me out?
I was reading in the post and someone did port the resource to TGEA but I think it was for a older version of TGEA.
I was reading in the post and someone did port the resource to TGEA but I think it was for a older version of TGEA.
#2
rafb.net/p/wNh2qd86.html
I don't know what's going on.
04/10/2009 (11:26 am)
Okay, I have tried adding your resource but I'm getting this error.rafb.net/p/wNh2qd86.html
I don't know what's going on.
#3
There was major changes between TGEA 1.7.0 and 1.8.1. One of the biggest changes was the audio. It was changed to SFX from audio.
04/10/2009 (6:51 pm)
I have been going over those files and they aren't ported to TGEA 1.8.1. The Wheeled Flying Vehicle resource needs a lot of work to get working in TGEA 1.8.1There was major changes between TGEA 1.7.0 and 1.8.1. One of the biggest changes was the audio. It was changed to SFX from audio.
#4
tek0.net/torque/wheeledflyingvehicle.rar
04/10/2009 (8:33 pm)
So I started from the Flying Vehicle code as the base and added pieces from the Wheeled Flying Vehicle. So take a look and see if this will work. I know I'm not a programmer but I'm trying.tek0.net/torque/wheeledflyingvehicle.rar
#5
04/12/2009 (3:22 am)
Anyone?
#6
04/12/2009 (9:00 am)
yah, the SFX has been documentation we have been asking for months now. This is another case where it might come in handy.
#7
04/12/2009 (1:15 pm)
Yea, I noticed that. So I'm trying to port it over but I'm not a programmer. :S
#9
I have 24 errors left to fix before this can be tested. (that's down from 5132 at the start) Half of the errors are simple to fix and were missed while fixing others. I'll be gone tomorrow, but hopefully will have this finished up by this weekend. :-)
04/13/2009 (8:24 pm)
Just an update so you know I haven't given up on this resource.I have 24 errors left to fix before this can be tested. (that's down from 5132 at the start) Half of the errors are simple to fix and were missed while fixing others. I'll be gone tomorrow, but hopefully will have this finished up by this weekend. :-)
#10
04/19/2009 (7:38 am)
Ok, for those following this, I have finished porting this resource to TGEA 1.8.1. It compiles without error. The only problem I am having with it is in the aircraft.cs script. It crashes torque without an error message telling me why. I have put the files up here. If you can figure out how to fix the script, I'd appreciate it if you post here how you did it.
#11
04/19/2009 (12:52 pm)
Nice, thank you Mike. I'll look into this.
#12
There were a couple of misplaced {'s and
The function in full should read
04/19/2009 (3:30 pm)
The problem appears to be in the WheeledFlyingVehicle::unpackUpdate function.There were a couple of misplaced {'s and
if (((GameConnection *) con)->getControlObject() == this)
return; had to replace if(stream->readFlag()) return;
The function in full should read
void WheeledFlyingVehicle::unpackUpdate(NetConnection *con, BitStream *stream)
{
Parent::unpackUpdate(con,stream);
// Update wheel datablock information
if (stream->readFlag())
{
Wheel* wend = &mWheel[mDataBlock->wheelCount];
for (Wheel* wheel = mWheel; wheel < wend; wheel++)
{
if (stream->readFlag())
{
SimObjectId tid = stream->readRangedU32(DataBlockObjectIdFirst,DataBlockObjectIdLast);
SimObjectId sid = stream->readRangedU32(DataBlockObjectIdFirst,DataBlockObjectIdLast);
if (!Sim::findObject(tid,wheel->tire) || !Sim::findObject(sid,wheel->spring))
{
con->setLastError("Invalid packet WheeledFlyingVehicle::unpackUpdate()");
return;
}
wheel->powered = stream->readFlag();
stream->read(&wheel->steering);
// Create an instance of the tire for rendering
delete wheel->shapeInstance;
wheel->shapeInstance = (wheel->tire->shape == NULL) ? 0:
new TSShapeInstance(wheel->tire->shape);
}
}
// RFB -> support for various speeds
mThrottleLevel = stream->readInt(2);
// <- RFB
}
// RFB -> adding lights
/*
for (int k=0; k<WheeledFlyingVehicleData::MaxLights; k++)
mLightOn[k] = stream->readFlag();
// <- RFB
*/
// After this is data that is stuff we don't need if we're the
// controlling client.
if (((GameConnection *) con)->getControlObject() == this)
return;
mBraking = stream->readFlag();
if (stream->readFlag())
{
Wheel* wend = &mWheel[mDataBlock->wheelCount];
for (Wheel* wheel = mWheel; wheel < wend; wheel++)
{
stream->read(&wheel->avel);
stream->read(&wheel->Dy);
stream->read(&wheel->Dx);
}
}
//}
// RFB -> borrowed from flyingvehicle
createHeightOn = stream->readFlag();
mThrustDirection = ThrustDirection(stream->readInt(NumThrustBits));
// <- RFB
}
#13
As an example change something like this
To this
04/19/2009 (3:35 pm)
I would also cleanup all the warning messages concerning double to F32.As an example change something like this
F32 foo = 0.9;
To this
F32 foo = 0.9f;
#14
04/30/2009 (10:47 am)
Okay, I have added this to TGEA 1.8.1 and it works but for some reason my mouse doesn't work. Any ideas?
#15
I would appriciate if I could take a look at you code and maybe we can help each other.
09/16/2009 (7:40 pm)
Hello Tek0. I have been watching this thread and noticed that there is no more updates. Did it move to another thread? I am currently working on a flying space vehicle with landing gear. I origonally used the helicopter and the flying wheeled vehicle code to make my space vehicle.I would appriciate if I could take a look at you code and maybe we can help each other.
Torque 3D Owner Yuejun Zhang