Come Fly With Me
by Sean Rice · 03/28/2010 (12:00 pm) · 46 comments
Because this is a paid for resource and not a free one, only the original resources will be provided. You may purchase this resource here www.decane.net/products/torque/fge/ if you do not already have this. This will show you the requirements needed to convert the existing files to the T3D engine.
First, We will work in the engine itself. Copy the 4 files from the 13103.aiflyingvehicleclasses_1.0 (these may be obtained from here www.torquepowered.com/community/resources/view/13103) and the files from the GuiReticleHUD folder. I placed all of the GuiReticleHUD in engine/soruce/gui/controls and the aiflyingclasses in engine/source/T3D/vehicles. You may also wish to copy these resources in when you compile your engine, this way you have the correct resources for the ported game example. www.torquepowered.com/community/resources/view/19519
Edit guiReticleHud.cpp
Change your includes from this
Change all occurrences of (should be 3)
Change this
This
This
This
Next open aiFlyingVehicle.cpp and
change
change (2 occurrences)
change
aiFlyingVehicle.h
change
aiRepairshipFlyingVehicle.cpp
change
change
change
change
This completes the engine changes, you can recompile your engine at this time. We will continue onto the server and client sides next. This will take a bit of time, but you can complete the engine changes now.
First, We will work in the engine itself. Copy the 4 files from the 13103.aiflyingvehicleclasses_1.0 (these may be obtained from here www.torquepowered.com/community/resources/view/13103) and the files from the GuiReticleHUD folder. I placed all of the GuiReticleHUD in engine/soruce/gui/controls and the aiflyingclasses in engine/source/T3D/vehicles. You may also wish to copy these resources in when you compile your engine, this way you have the correct resources for the ported game example. www.torquepowered.com/community/resources/view/19519
Edit guiReticleHud.cpp
Change your includes from this
//#include "dgl/dgl.h" //#include "dgl/gFont.h" #include "gui/core/guiControl.h" #include "gui/core/guiTSControl.h" #include "console/consoleTypes.h" #include "sceneGraph/sceneGraph.h" #include "game/shapeBase.h" #include "game/gameConnection.h" #include "string.h" // Needed for strcmpto this
//#include "dgl/dgl.h" //#include "dgl/gFont.h" #include "gui/core/guiControl.h" #include "gui/3d/guiTSControl.h" #include "gui/core/guiCanvas.h" #include "gfx/gfxDrawUtil.h" #include "console/consoleTypes.h" #include "sceneGraph/sceneGraph.h" #include "T3D/shapeBase.h" #include "T3D/gameBase/gameConnection.h" #include "string.h" // Needed for strcmp #include "platform/platform.h"
Change all occurrences of (should be 3)
ShapeBase* control = conn->getControlObject();to this
GameBase* control = conn->getControlObject();
Change this
ShapeBase *mount = shape->getObjectMount();to this
SceneObject *mount = shape->getObjectMount();
This
pts[idx].x = bounds.min.x; pts[idx].y = bounds.min.y; pts[idx].z = bounds.min.z; idx++; pts[idx].x = bounds.min.x; pts[idx].y = bounds.min.y; pts[idx].z = bounds.max.z; idx++; pts[idx].x = bounds.min.x; pts[idx].y = bounds.max.y; pts[idx].z = bounds.min.z; idx++; pts[idx].x = bounds.min.x; pts[idx].y = bounds.max.y; pts[idx].z = bounds.max.z; idx++; pts[idx].x = bounds.max.x; pts[idx].y = bounds.min.y; pts[idx].z = bounds.min.z; idx++; pts[idx].x = bounds.max.x; pts[idx].y = bounds.min.y; pts[idx].z = bounds.max.z; idx++; pts[idx].x = bounds.max.x; pts[idx].y = bounds.max.y; pts[idx].z = bounds.min.z; idx++; pts[idx].x = bounds.max.x; pts[idx].y = bounds.max.y; pts[idx].z = bounds.max.z;to this
//HNG pts[idx].x = bounds.minExtents.x; pts[idx].y = bounds.minExtents.y; pts[idx].z = bounds.minExtents.z; idx++; pts[idx].x = bounds.minExtents.x; pts[idx].y = bounds.minExtents.y; pts[idx].z = bounds.maxExtents.z; idx++; pts[idx].x = bounds.minExtents.x; pts[idx].y = bounds.maxExtents.y; pts[idx].z = bounds.minExtents.z; idx++; pts[idx].x = bounds.minExtents.x; pts[idx].y = bounds.maxExtents.y; pts[idx].z = bounds.maxExtents.z; idx++; pts[idx].x = bounds.maxExtents.x; pts[idx].y = bounds.minExtents.y; pts[idx].z = bounds.minExtents.z; idx++; pts[idx].x = bounds.maxExtents.x; pts[idx].y = bounds.minExtents.y; pts[idx].z = bounds.maxExtents.z; idx++; pts[idx].x = bounds.maxExtents.x; pts[idx].y = bounds.maxExtents.y; pts[idx].z = bounds.minExtents.z; idx++; pts[idx].x = bounds.maxExtents.x; pts[idx].y = bounds.maxExtents.y; pts[idx].z = bounds.maxExtents.z; // HNG
This
GFX->drawRect(RectI(min.x, min.y, max.x-min.x, max.y-min.y), mRenderColor);
}
else if( strcmp(mRectangleStyle , "c" ) == 0) // corners
{
// draw only the corners of the rectangle
GFX->drawLine(min.x, min.y, min.x + cornerLength, min.y, mRenderColor); // top left
GFX->drawLine(min.x, min.y, min.x, min.y + cornerLength, mRenderColor); // top left
GFX->drawLine(max.x, min.y, max.x - cornerLength, min.y, mRenderColor); // top right
GFX->drawLine(max.x, min.y, max.x, min.y + cornerLength, mRenderColor); // top right
GFX->drawLine(min.x, max.y, min.x + cornerLength, max.y, mRenderColor); // bottom left
GFX->drawLine(min.x, max.y, min.x, max.y - cornerLength, mRenderColor); // bottom left
GFX->drawLine(max.x, max.y, max.x, max.y - cornerLength, mRenderColor); // bottom right
GFX->drawLine(max.x, max.y, max.x - cornerLength, max.y, mRenderColor); // bottom rightto this// HNG
GFX->getDrawUtil()->drawRect(RectI(min.x, min.y, max.x-min.x, max.y-min.y), mRenderColor);
}
else if( strcmp(mRectangleStyle , "c" ) == 0) // corners
{
// draw only the corners of the rectangle
GFX->getDrawUtil()->drawLine(min.x, min.y, min.x + cornerLength, min.y, mRenderColor); // top left
GFX->getDrawUtil()->drawLine(min.x, min.y, min.x, min.y + cornerLength, mRenderColor); // top left
GFX->getDrawUtil()->drawLine(max.x, min.y, max.x - cornerLength, min.y, mRenderColor); // top right
GFX->getDrawUtil()->drawLine(max.x, min.y, max.x, min.y + cornerLength, mRenderColor); // top right
GFX->getDrawUtil()->drawLine(min.x, max.y, min.x + cornerLength, max.y, mRenderColor); // bottom left
GFX->getDrawUtil()->drawLine(min.x, max.y, min.x, max.y - cornerLength, mRenderColor); // bottom left
GFX->getDrawUtil()->drawLine(max.x, max.y, max.x, max.y - cornerLength, mRenderColor); // bottom right
GFX->getDrawUtil()->drawLine(max.x, max.y, max.x - cornerLength, max.y, mRenderColor); // bottom right
// HNGThis
GFX->setBitmapModulation(mFillColorDefault); GFX->drawText(mProfile->mFont, offset, name); GFX->clearBitmapModulation();to this
// HNG GFX->getDrawUtil()->setBitmapModulation(mFillColorDefault); GFX->getDrawUtil()->drawText(mProfile->mFont, offset, name); GFX->getDrawUtil()->clearBitmapModulation(); // HNG
Next open aiFlyingVehicle.cpp and
change
#include "aiFlyingVehicle.h" #include "../console/consoleInternal.h" #include "../core/realComp.h" #include "../math/mMatrix.h" #include "moveManager.h"to this
#include "aiFlyingVehicle.h" #include "console/consoleInternal.h" //#include "core/realComp.h" #include "math/mMatrix.h" #include "T3D/gameBase/moveManager.h"
change (2 occurrences)
mCross( forward, up, right );to this
mCross( forward, up, &right );
change
Con::executef(getDataBlock(), 2, name, scriptThis());to this
Con::executef(getDataBlock(), name, scriptThis());
aiFlyingVehicle.h
change
#include "game/vehicles/flyingVehicle.h"to this
#include "T3D/vehicles/flyingVehicle.h"
aiRepairshipFlyingVehicle.cpp
change
#include "AIRepairshipFlyingVehicle.h" #include "../console/consoleInternal.h" #include "../core/realComp.h" #include "../math/mMatrix.h" #include "moveManager.h"to this
#include "AIRepairshipFlyingVehicle.h" #include "console/consoleInternal.h" //#include "../core/realComp.h" #include "math/mMatrix.h" #include "T3D/gameBase/moveManager.h"
change
mCross( forward, up, right );to this
mCross( forward, up, &right );
change
Con::executef(getDataBlock(), 2, name, scriptThis());to this
Con::executef(getDataBlock(), name, scriptThis());
change
#include "game/vehicles/flyingVehicle.h"to this
#include "T3D/vehicles/flyingVehicle.h"
This completes the engine changes, you can recompile your engine at this time. We will continue onto the server and client sides next. This will take a bit of time, but you can complete the engine changes now.
About the author
http://www.hngamers.com
#42
06/23/2010 (5:06 am)
Any news on the port? Is it still ongoing?
#43
but i want to build a dogfight game :(
01/01/2011 (12:29 am)
yes. please, i have no source of the torque 3d(to expansive)but i want to build a dogfight game :(
#44
01/01/2011 (6:03 am)
this is not available without source for T3d. You will need to obtain the source in order to do any work with this kit.
#45
01/01/2011 (9:03 pm)
The bulk of the kit will work without needing to make any source code changes. Only two things in the kit require access to the source:- the reticle code
- flying vehicle AI
#46
01/03/2011 (3:48 pm)
I bring it not to work, some advice will help me, please. 
Torque Owner Sean Rice
HNGamers
FGE, NO Weapons, Kill count 10000+: the bots will fly around and crash into the landscape and each other. The death count will continue to climb and was left running for 48 hours without a single crash. Removal of modded code in stdgameprocess.cpp causes bots to stop moving.
FGE, Weapons, Kill Count 10000+: Engine crashes after 5 deaths, this is regardless of which weapon is on the bot. Removal of modded code in stdgameprocess.cpp causes bots to stop moving.
NON FGE with FGE Engine Code: Immediate crash at the same location as the FGE, Weapons, Kill Count 10000+. Removal of modded code in stdgameprocess.cpp resolves the crash.