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 ?
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 ?
#2
12/05/2005 (2:03 pm)
This is great! I haven't added the tank pack to 1.4 yet, but this will definitely help me out! Thanks!
#3
12/05/2005 (2:08 pm)
Whao ! 2 minutes after posting, somebody already thanks me. It's so cool to help ;)
#4
12/05/2005 (2:13 pm)
Thank you again from another person! I tried to do this with 1.4rc2 when it was released and got stuck on the same part you managed to figure out. Thank you! I'm bookmarking this for after I get home from work.
#5
12/05/2005 (3:15 pm)
And we thank you as well!
#6
12/06/2005 (1:38 pm)
Okay I finally got around to throwing this in, and it works without a hitch. Thanks!
#7
12/15/2005 (5:44 am)
Add Another happy camper to the list, i hope the tankpack download is updated with this info.
#8
12/31/2005 (10:27 am)
Works great here too -- thanks!
#9
Great Work !!!
02/13/2006 (4:35 am)
Works here too Pat. Thanks for the knowledge, it really helped us out. I was struggling with it, but things are 'on track' again now after being directed to your post. Great Work !!!
#10
03/04/2006 (10:45 pm)
I just needed this, forums are awesome, thanks a lot pat!
#11
Kiddies make sure you always add ALL the necessary files into your project before you compile :P
Thanks Tim, your sarcastic wit made me realize my problem was in the compilation and not scripting. ;)
05/13/2006 (10:56 am)
Edit: Removed my entire problem since it was caused by my boneheaded self and would not help anyone :)Kiddies make sure you always add ALL the necessary files into your project before you compile :P
Thanks Tim, your sarcastic wit made me realize my problem was in the compilation and not scripting. ;)
#12
As far as your errors, clearly you haven't got it to compile successfully - your console is filled with "Unable to instantiate non-conobject ". I would suggest starting over, following instructions carefully.
05/13/2006 (11:14 am)
Quote:It's there in black & white, I swear people don't read ;)
On a fresh TGE 1.4 directory apply BraveTree instruction completed by text below :
/torque/engine/console/consoleTypes.h : use the 1.4 version, not the TankPack one
/torque/engine/ts/tsCollision.cc : use the 1.4 version, not the TankPack one
Quote:No, don't merge the information bravetree specifies. Use the 1.4 originals and don't modify them in any way. The only files from the tank pack source code that you should be altering is tankshape.cc and the header.
Do I need to merge the information Bravetree sepcifies for custom version into the current 1.4 files (consoleTypes.h and tsCollision.cc)?
As far as your errors, clearly you haven't got it to compile successfully - your console is filled with "Unable to instantiate non-conobject ". I would suggest starting over, following instructions carefully.
#13
05/18/2006 (9:15 am)
I can't get my tank working :( im sure the engine is compiling with the code, cause the help thing in the top-right hand corner is appearing, and i know from experience that this is definitely not a compilation problem. Basically, ive done what it says in the bravetree readme and compiled the engine using the code changes above (im using 1.4) and added all the scripts, shapes to the starter.fps folder and still no result, i don't spawn as a tank, and my tank doesn't appear in the mission editor in shapes, i had this exact same problem with tim heldna's helicopter resource and it's really annoying me now....
#14
Clearly you are not compiling the head code correctly (in both cases, tank & heli).
Sorry if I'm mistaken, but it sounds to me you're having trouble understanding the difference between script and source code.
Please outline the steps you took to 'compile' the tank 'source' code. You have to 'add' the related tank 'cc' and 'header' files to your 'project'. Just copying and pasting the files into the Torque folder directory and recompiling the engine will achieve nothing.
Remember, the 'script' files you added rely on the tank 'source' code to work. Naturally, some things like the gui stuff will still work, but anything related to the tank vehicle itself will not work (without source code).
From my discussions with you about the heli resource and what you wrote above, I firmly believe you are not compiling correctly. I would suggest learning you development environment and starting out with basic scripting before tackling head code changes.
P.S. Don't forget to outline your steps for adding files to your project and compiling.
05/18/2006 (6:51 pm)
Hi Charles,Clearly you are not compiling the head code correctly (in both cases, tank & heli).
Quote:That has nothing to do with compiling. The gui help screen is done in script and will appear regardless of whether you compiled the tank source code or not.
im sure the engine is compiling with the code, cause the help thing in the top-right hand corner is appearing
Sorry if I'm mistaken, but it sounds to me you're having trouble understanding the difference between script and source code.
Please outline the steps you took to 'compile' the tank 'source' code. You have to 'add' the related tank 'cc' and 'header' files to your 'project'. Just copying and pasting the files into the Torque folder directory and recompiling the engine will achieve nothing.
Remember, the 'script' files you added rely on the tank 'source' code to work. Naturally, some things like the gui stuff will still work, but anything related to the tank vehicle itself will not work (without source code).
From my discussions with you about the heli resource and what you wrote above, I firmly believe you are not compiling correctly. I would suggest learning you development environment and starting out with basic scripting before tackling head code changes.
P.S. Don't forget to outline your steps for adding files to your project and compiling.
#15
basically i edited the source code as shown above to make it into 1.4 and then added them to the project, i had no idea you have to edit another file to execute the new source code, which one do i need to edit? is it like game.cc or something like that, im a C++ n00b so please help me
or if im still wrong how do i add the files and make sure torque compiles with them?
thank you so much for all your help!
05/18/2006 (11:10 pm)
Thanks, i think i know what i am doing wrong, it is a problem with compiling the engine, because when i added the more realistic FPS resource it worked, cos i was only making changes to the player.cc and not adding any new scriptsbasically i edited the source code as shown above to make it into 1.4 and then added them to the project, i had no idea you have to edit another file to execute the new source code, which one do i need to edit? is it like game.cc or something like that, im a C++ n00b so please help me
or if im still wrong how do i add the files and make sure torque compiles with them?
thank you so much for all your help!
#16
This doesn't make sense to me???
Yes, you need to add the files to your project. No you don't have to edit any existing code to execute the new code. It's all compiler dependent, you're using a Mac and I have no knowledge on Mac whatsoever.
This is the best I can do for now:
- Add the head code to the appropriate folder within your Torque installation directory. E.g. you would want to put helivehicle.cc & helivehicle.h in the C:\Torque\SDK\engine\game\vehicles directory. Follow the tank pack instructions for tank details.
- Basically, when you view your Torque project in your compiler, there should be a view which shows all the Torque projects (folders), there's 17 or so.

- Then you would want to navigate the to the Torque Demo project which will be highlighted in bold and navigate to the appropriate directory.

- Once you have found your required directory, right click it and 'add the files' to your project. So in our case we would right click the 'vehicles' folder and add helivehicle.cc & helivehicle.h

The wording of 'add files to project' will vary from compiler to compiler. You should be able to work it out. Once the file(s) have been added to your project they will appear in the project list. From here you can right click the .cc file to compile the newly added files, then rebuild your exe (or whatever the Mac equivalent is). If this is too tricky for you, just recompile the whole project.


This is really all I can do for you, like I said I think you're starting too big too early. Visit C++ sites for help with compiler setup and usage, there's plenty of tutorials available online. Good luck, let me know how you go.
- Tim
05/18/2006 (11:42 pm)
Ok, at least now you recognize the difference between editing and adding source code.Quote:
basically i edited the source code as shown above to make it into 1.4 and then added them to the project, i had no idea you have to edit another file to execute the new source code, which one do i need to edit? is it like game.cc or something like that
This doesn't make sense to me???
Yes, you need to add the files to your project. No you don't have to edit any existing code to execute the new code. It's all compiler dependent, you're using a Mac and I have no knowledge on Mac whatsoever.
This is the best I can do for now:
- Add the head code to the appropriate folder within your Torque installation directory. E.g. you would want to put helivehicle.cc & helivehicle.h in the C:\Torque\SDK\engine\game\vehicles directory. Follow the tank pack instructions for tank details.
- Basically, when you view your Torque project in your compiler, there should be a view which shows all the Torque projects (folders), there's 17 or so.

- Then you would want to navigate the to the Torque Demo project which will be highlighted in bold and navigate to the appropriate directory.

- Once you have found your required directory, right click it and 'add the files' to your project. So in our case we would right click the 'vehicles' folder and add helivehicle.cc & helivehicle.h

The wording of 'add files to project' will vary from compiler to compiler. You should be able to work it out. Once the file(s) have been added to your project they will appear in the project list. From here you can right click the .cc file to compile the newly added files, then rebuild your exe (or whatever the Mac equivalent is). If this is too tricky for you, just recompile the whole project.


This is really all I can do for you, like I said I think you're starting too big too early. Visit C++ sites for help with compiler setup and usage, there's plenty of tutorials available online. Good luck, let me know how you go.
- Tim
#17
Add the files themselves as directed into the folders (ie. /torque/engine/game/tankShape.h) then make sure you "add" them into your project in the compiler like Tim has shown above.
-or- as I did just drag and drop the file into the appropriate folder in the project tree under torque demo then use the "add-existing items-(select the file you just dropped)", either way is fine.
05/20/2006 (11:44 am)
Charles sounds like you are making the same mistake I did of not adding the files to the project so they compile. Add the files themselves as directed into the folders (ie. /torque/engine/game/tankShape.h) then make sure you "add" them into your project in the compiler like Tim has shown above.
-or- as I did just drag and drop the file into the appropriate folder in the project tree under torque demo then use the "add-existing items-(select the file you just dropped)", either way is fine.
#18
05/23/2006 (9:48 am)
Yessss at last it works, it was exactly that problem, i was adding the files but not to the project, playes around with xcode a bit, compiled it and it worked :), thanks so much for your help guys you're really great! thanks again, yes im really happy now i got it working, and now i can get tim's helicopter working too :) thanks again
#19
I need more practice with C++ code for sure.
Thanks so much for posting this fix!
07/30/2006 (3:30 pm)
I spent a few hours trying to get the bugs out of tankShape.cc. But I couldent figure it out.I need more practice with C++ code for sure.
Thanks so much for posting this fix!
#20
Here is the console output that contains the error:
Mission lighting done
Mapping string: MissionStartPhase3Ack to index: 2
starter.fps/server/scripts/game.cs (308): Unable to instantiate non-conobject class TankShape.
Set::add: Object "0" doesn't exist
starter.fps/server/scripts/game.cs (313): Unable to find object: '0' attempting to call function 'setTransform'
starter.fps/server/scripts/game.cs (314): Unable to find object: '0' attempting to call function 'setShapeName'
starter.fps/server/scripts/game.cs (322): Unable to find object: '0' attempting to call function 'getEyeTransform'
Mapping string: MissionStart to index: 11
Mapping string: SyncClock to index: 12
keyboard0 input device created.
mouse0 input device created.
keyboard0 input device created.
mouse0 input device created.
*** ENDING MISSION
any advice on what I did wrong?
Thanks
07/30/2006 (4:25 pm)
Ok so I got the source to compile fine, I'm running a fresh TGE 1.4 install. I coppied all the scripts from the tank pack and tried to run the fps starter kit, and when I load the mission it loads all of the datablocks and the mission objects fine, then it lights the mission, and stops working! Here is the console output that contains the error:
Mission lighting done
Mapping string: MissionStartPhase3Ack to index: 2
starter.fps/server/scripts/game.cs (308): Unable to instantiate non-conobject class TankShape.
Set::add: Object "0" doesn't exist
starter.fps/server/scripts/game.cs (313): Unable to find object: '0' attempting to call function 'setTransform'
starter.fps/server/scripts/game.cs (314): Unable to find object: '0' attempting to call function 'setShapeName'
starter.fps/server/scripts/game.cs (322): Unable to find object: '0' attempting to call function 'getEyeTransform'
Mapping string: MissionStart to index: 11
Mapping string: SyncClock to index: 12
keyboard0 input device created.
mouse0 input device created.
keyboard0 input device created.
mouse0 input device created.
*** ENDING MISSION
any advice on what I did wrong?
Thanks
Torque 3D Owner Pat AfterMoon
Instructions for upgrade BraveTree TankPack to TGE 1.4
On a fresh TGE 1.4 directory apply BraveTree instruction completed by text below :
/torque/engine/console/consoleTypes.h : use the 1.4 version, not the TankPack one
/torque/engine/ts/tsCollision.cc : use the 1.4 version, not the TankPack one
/torque/engine/collision/simplePolyList.cc : copy tankpack version without changing
/torque/engine/collision/simplePolyList.h : copy tankpack version without changing
/torque/engine/game/tankShape.h
Add at the end of the file, just before "#endif"
/torque/engine/game/tankShape.cc
on line 741, after
add :
on line 780, after
addField("camNear", TypeF32, Offset(camNear,TankCameraData));remove :Con::registerType("TankCameraDataPtr", TypeTankCameraDataPtr, sizeof(TankCameraData*), REF_GETDATATYPE(TankCameraData), REF_SETDATATYPE(TankCameraData));on line 832, after
add :
On line 917, after
addField("engineVolB1", TypeF32, Offset(engineVolB1,TankFxData));removeCon::registerType("TankFxDataPtr", TypeTankFxDataPtr, sizeof(TankFxData*), REF_GETDATATYPE(TankFxData), REF_SETDATATYPE(TankFxData));On line 1127, after
add :
On line 1158, after
addField("unstuckBoost", TypeF32, Offset(unstuckBoost,TankMiscData));removeCon::registerType("TankMiscDataPtr", TypeTankMiscDataPtr, sizeof(TankMiscData*), REF_GETDATATYPE(TankMiscData), REF_SETDATATYPE(TankMiscData));Search for "GameConnection::getServerConnection()" and
replace it by "GameConnection::getConnectionToServer()"
There are 3 occurences near line 1529
Copy script and data like described by BraveTree, there are no change between 1.3 and 1.4 for this part.
Compile the engine, run the game, and that's all !