Game Development Community

Tank Pack and TGE 1.4

by Pat AfterMoon · in Torque Game Engine · 12/01/2005 (1:59 pm) · 69 replies

I would like to implement Tank Pack with TGE 1.4 but it seem more difficult than expected. A lot of things have changed since 1.3.

I follow the BraveTree guideline for integrating in "custom version of Torque" (TankPackReadMe.htm) bug I'm stucked at start with too much change in "consoleTypes.h".

Anyone working on same subject ?
#21
07/31/2006 (2:26 am)
Am trying to get the tank pack to work with 1.4 as well.
have followed the intructions above but cant compile the tankshape.cc. have a clean 1.4, added as instructed and modified tankshape but when i compile i get 106 errors in the tankshape.cc.
the first lines of the output seem to point to variable declaration errors.
error c2601 line 788, followed by c2601 line 807...total of 5 c2601s
line 829 c2655 definition or redeclaration illegal in current scope
line 230 (tankshape.h) see declaration TankFxData::dynclassRep

any help would be appreciated

just a thot, if anyone has successfully modified the tankshape.cc & tankshape for use in 1.4 could they post them here or email them to me. thanks in advance

have tried to compile the original shipped tankshape and getting errors with that as well, so maybe its my problem c2065 undeclared indentifier..... hope this makes sense to someone. not very experienced with c++ so could be missing a major simple but obvious item
#22
07/31/2006 (6:22 am)
I'd help you out by posting the pre-modified tank source code for 1.4; unfortunately I think I would be in severe strife with BraveTree if I did.

I would contact BraveTree and request the pack gets updated to comply with version 1.4 of Torque.
#23
07/31/2006 (9:34 am)
I think I'm just going to start over. I may have missed a step, or forgot to copy one of the C++ files into my project. I got so close! all the weapons for the tank load under the shape catigory, and also show up in the static shape catigory in the world editor creator, but the tank only shows up as a static shape. Is anyone also using the soldier pack with this? could that be my problem?
I will send an email to brave tree with a link to this forum so that they can fix the tank pack if they want to.
Thanks again!
#24
07/31/2006 (10:04 am)
Hey Mark Dryden,

Just to set you on the right track you do realize that having the tank appear in the shapes directory does not mean a thing. Any shapes placed in that directory with a basic datablock will show up in there.

I read through your console and from the errors you're reporting...
starter.fps/server/scripts/game.cs (308): Unable to instantiate non-conobject class TankShape
...it's quite clear that you haven't compiled the tank source code! All other errors stem from this as well.

Just copy / pasting the .cc and .h files into your folder structure will do nothing! You will have to add them to your project via your compiler and rebuild your Torque exe.

I describe this process to another user above who had the same misconception. I even included big screens!

I think BraveTree should update the code as soon as possible, but in their defense I would have to say some of the errors being reported here wouldn't benefit from this as you're all not compiling (if at all) correctly in the first place!
#25
07/31/2006 (10:17 am)
As above , i have tried to compile both the modified (as per above instructions) and the unmodified (direct from the pack) tankshape.cc directly in visual studio, but both give errors (listed above) am i correct in assuming the unmodified should compile correctly, i know it wont work in 1.4 but just as a test of my environment
#26
07/31/2006 (11:22 am)
I added the files to the project using the method above i.e. the "add existing file" option. I am using visual C++ 2005 express edition, then I went and built the project and the log states that it built 2 and 6 were up to date. Then I tested to see if it worked and it didn't, so then instead of just building the 2 new files, I went and rebuilt the engine. None of the build failed, so it appears the tankShape.cc compiled properly and so did the simplePoly.cc file.
Is building the project different than compiling?
I was always told that building was just a mass compile of an entire project. But I could be wrong. Is it necessary that I compile the 2 new files individually and then build the project?

I agree that it looks like the tankShape.cc isn't compiling as the script does not recognize "TankShape" as a class in the engine.

@Michael Kenny:
I ran into the same errors when compiling the modified tankShape.cc and I think I can point you in the right direction. The first time I modified the file I deleted the code wherever Tim said to remove the code. This then caused all the line numbers he gives to be incorrect and I made a few mistakes when putting the new content into the file. I actually got errors when I put:

IMPLEMENT_CO_DATABLOCK_V1(TankFxData);

IMPLEMENT_GETDATATYPE(TankFxData)
IMPLEMENT_SETDATATYPE(TankFxData)
IMPLEMENT_CONSOLETYPE(TankFxData)


Instead of the correct:
IMPLEMENT_CO_DATABLOCK_V1(TankFxData);
IMPLEMENT_CONSOLETYPE(TankFxData)
IMPLEMENT_GETDATATYPE(TankFxData)
IMPLEMENT_SETDATATYPE(TankFxData)

So my suggestion is to go through and redo the modifications but instead of deleting the "remove code" parts just comment them out. That way the line numbers stay the same, and the compiler won't compile the commented out stuff.
I hope this helps
#27
07/31/2006 (4:39 pm)
O.K maybe someone can explain this to me. Am I supposed to do all my game development using the Torque demo debug.exe..... because the tank pack works in the debug version.
Is this right?
#28
08/01/2006 (1:49 am)
Thanks mark, will try again today - this is so frustrating - have sent email to bravetree - no response yet !!
#29
08/01/2006 (6:37 am)
Have tried it again - using visual studio 6 (was using 7) , seem to be closer. getting a error c2065 undeclared identifier TypeTankcameradataPtr, this is declared in the bravetree consoletypes.h as far as i can see but as per above we should use the 1.4 one

any help appreciated, thanks in advance
#30
08/01/2006 (8:04 am)
Double check your edits. If the IMPLEMENT_* macros are out of order then you'll get errors like that when compiling. See what Mark did 4 posts up.
#31
08/01/2006 (9:18 am)
Have redone the changes as above down to six errors

tankShape.cc
\Torque\SDK\engine\game\tankShape.cc(201) : error C2065: 'TypeTankCameraDataPtr' : undeclared identifier
\Torque\SDK\engine\game\tankShape.cc(202) : error C2065: 'TypeTankFxDataPtr' : undeclared identifier
\Torque\SDK\engine\game\tankShape.cc(203) : error C2065: 'TypeTankMiscDataPtr' : undeclared identifier
\Torque\SDK\engine\game\tankShape.cc(741) : error C2371: 'TypeTankCameraDataPtr' : redefinition; different basic types
\Torque\SDK\engine\game\tankShape.cc(741) : error C3861: 'TypeTankCameraDataPtr': identifier not found, even with argument-dependent lookup
\Torque\SDK\engine\game\tankShape.cc(832) : error C2371: 'TypeTankFxDataPtr' : redefinition; different basic types
\Torque\SDK\engine\game\tankShape.cc(832) : error C3861: 'TypeTankFxDataPtr': identifier not found, even with argument-dependent lookup
\Torque\SDK\engine\game\tankShape.cc(1127) : error C2371: 'TypeTankMiscDataPtr' : redefinition; different basic types
\Torque\SDK\engine\game\tankShape.cc(1127) : error C3861: 'TypeTankMiscDataPtr': identifier not found, even with argument-dependent lookup


seem to relate to 3 identifiers so maybe near solution now, i hope
#32
08/02/2006 (6:14 am)
Great news, clean compile. went back to the start and this time cut and pasted the code changes above into tankshape and compiled clean. must have been missing a space or miss spelling
now will try to drive the beast

thanks for all help
#33
08/04/2006 (7:08 am)
I have made all the changes to the code and I think I'm having the same problem of copying and pasting my files in, but not compiling. I see the gui with the keyboard controls for the tank when my game loads, but i cant drop the tank down with ctrl c or v. I also cannot add the tank as a vehicle, only a static shape.

I haven't had to compile anything yet in my project to get it to work. So when it says above that i have to compile my tank.cc and tank.h instead of just copying them into C:\Torque\SDK\engine\game\, thats a little confusing for me. I have been creating my project by continually modifying the fps starter kit,and using the fps starter kit executable to load my project. I haven't had to compile to get any of my changes to work or to get the hummer and soldier in. I also haven't had to compile to get my new or edited script files to work either.

How do I get all my files in a programming environment, like visual studios, so i can compile? Is there a certain project file i can open up, in visual studio or context, that links to the other files? I am working in windows and I purchased the indie engine a little over a month ago. Any help or point in the right direction would be greatly appreciated.
#34
08/04/2006 (9:07 am)
In visual studio i just opened a solution (in the file menu - 5th item down), then browsed to vc7 folder in the sdk, click on this on and u should see TorqueSdk, select and click open. this should load the engine source into visual studio
from the build menu on top line select build solution, should recompile then

hope this helps
#35
08/05/2006 (11:48 am)
When I try compiling the tank pack with TLK 1.4 I get this error,

tankShape.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall TankShape::renderShadow(float,float)" (?renderShadow@TankShape@@UAEXMM@Z)
../example/torqueDemo.exe : fatal error LNK1120: 1 unresolved externals
#36
08/28/2006 (3:40 pm)
I got this error also and I hate to admit this but all I did was comment out "void renderShadow(F32 dist, F32 fogAmount);" line in tankshape.h and it compiled and tanks work fine. I am no programmer so I'm not even sure what that line does but it atleast got my exe built and tanks in-game.
#37
08/28/2006 (11:35 pm)
That's not how you fix it :)

Find the
void renderShadow(F32 dist, F32 fogAmount);
in wheeledVehicle.h and notice there's an extra line in there.
bool prepRenderImage(SceneState* state, const U32 stateKey, const U32 startZone, const bool modifyBaseZoneState);
Add that line in to your tankShape.h file and you should be fine. Pending on which compiler you are using you may have to move those two lines higher up in the public class.
#38
08/29/2006 (9:05 am)
I know that wasn't the right way to fix it :), thats why I said I'm not a programmer.
I added that line and now I get:
tankShape.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall TankShape::renderShadow(float,float)" (?renderShadow@TankShape@@UAEXMM@Z)
tankShape.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall TankShape::prepRenderImage(class SceneState *,unsigned int,unsigned int,bool)" (?prepRenderImage@TankShape@@UAE_NPAVSceneState@@II_N@Z)
../example/EarthWars0001.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
I would like to thank you for posting help though.
#39
08/29/2006 (9:53 am)
Move these 2 lines under

void renderShadow(F32 dist, F32 fogAmount);
bool prepRenderImage(SceneState* state, const U32 stateKey, const U32 startZone, const bool modifyBaseZoneState);

this line which should be around line 368

void setControlData(const Point3F & p, const QuatF & r);
#40
08/29/2006 (9:54 am)
^^

Pending on which compiler you are using you may have to move those two lines higher up in the public class.