Game Development Community

dev|Pro Game Development Curriculum

Turret & AITurret classes, Version 1.20 for TGEA 1.8.1

by kcpdad · 06/02/2009 (8:05 pm) · 25 comments

Credits - To those that did the heavy lifting
This was tested with the TGEA Stronghold game example.

Click to Download

Instructions

**** MOST IMPORTANT **** -> Make a backup of your existing TGEA 1.8.1 installation!!!
Merge changes from the zip file into your TGEA 1.8.1 installation.
Add a new filter/folder called turrets to your project under T3D.
Add the two .cpp files(turret.cpp and aiTurret.cpp) as existing items to the filter/folder you just added.
Rebuild the engine.
Read the original Readme.txt for instructions on adding turrets to a mission.

Gotchas

If you add a turret to a mission, use the mission editor to set the value of the dynamic field "locked" to either true or false.
Otherwise the engine will crash if you execute a dump() method on the turret object in the console.

About the author

Hobbyist working on a tank game when time allows. Play the prototype at => http://www.sytrept.com/60tons/

Page «Previous 1 2
#1
06/03/2009 (2:11 am)
Thank you.
#2
06/03/2009 (2:40 am)
just some minor changes(5X "ShapeBase*" to "SceneObject*" in turret.cpp, and remove the "void unmount();" from turret.h ) and it works in T3D.
#3
06/03/2009 (8:30 am)
Very nice, I appreciate the update, also thank you to the orginal developers too!
#4
06/04/2009 (4:40 am)
Nice, thx.
#5
06/16/2009 (10:50 am)
hmmm... I get an error when compiling the aiTurret class..
"no matching function for call to 'AITurret::getAnglesFromAimLocation(Point3F&, Point3F, F2&, F32&)"
Any ideas?
#6
08/06/2009 (9:27 pm)
this is not an error in objectypes.h, two BIT(27) ?:

// phdana turrets ->
   TurretObjectType =            BIT(27),
   // <- phdana turrets
   /// @}

   /// @name Other
   /// The following are allowed types that can be set on datablocks for static shapes
   /// @{

   ///
   DamagableItemObjectType =     BIT(27),
   /// @}

   ShadowCasterObjectType =	BIT(28)
};
#7
08/07/2009 (8:48 pm)
¿tips for fixing the choppy movement?
#8
08/11/2009 (5:06 pm)
I have another issue that I want to see if any of you have had so I can tell if it is my own modifications causing this or this code.

If you have an AITurret on a map and try to throw an object (It doesn't matter what) it will just float and gradually raise into the sky.

Take out the AITurret and even use a regular turret and no problem.

I would really like to know if anyone else sees this.
#9
08/22/2009 (8:48 pm)
At this moment i have another issue, i have the teams implementation, and only 1 aiturrent works with several aiturrets, i tried many things without lucky..., i am thinking make my own aiturrent from aiplayer...
#10
08/23/2009 (3:59 am)
I did find the source of my issue and it is stock to TGEA 1.81. I have submitted my findings and a temporary solution here:

www.garagegames.com/community/forums/viewthread/100221
#11
08/29/2009 (3:15 am)
hello everybody, i'm trying to implement this resource in T3D and on my game.cs i put the code:
%obj.mountImage( smallTurretGun, 0);
to mount the barrel on the turret, and it doesn't do it and shows an error
"unable to instanciate non-conobject class turret data"

thanks in advance.
#12
09/03/2009 (1:17 am)
deepscratch, you make it work in T3D????? and what changes do you make, because i'm having some problems if you can help me???Thanks
#13
09/07/2009 (12:09 am)
everything is fine now i got it working outstanding resource thanks for the help.
#14
03/04/2010 (7:56 am)
anyone got this working in T3D1.1a ?
I am getting errors trying to compile.
Tried the updates listed in response #2.

Error 22 error C2660: 'SceneObject::getRenderMountTransform' : function does not take 2 arguments c:\Torque\T3D1.1a GMK1.2.7 AiTurret\Engine\source\T3D\turrets\turret.cpp 568
Error 27 error C2660: 'SceneObject::getRenderMountTransform' : function does not take 2 arguments c:\Torque\T3D1.1a GMK1.2.7 AiTurret\Engine\source\T3D\turrets\turret.cpp 901
Error 28 error C2660: 'ShapeBase::buildPolyList' : function does not take 3 arguments c:\Torque\T3D1.1a GMK1.2.7 AiTurret\Engine\source\T3D\turrets\turret.cpp 931


#15
03/18/2010 (10:43 am)
@Donald - I just got it to compile in T3D1.1b1. I've got some problems in game but I think they're all script related now.

To get rid of the above errors:

To solve the getRenderMountTransform error, use:
mMount.object->getRenderMountTransform(0.0f, mMount.node, mMount.xfm, &nmat);

To solve the getMountTransform error (I had this problem but you don't mention it so maybe you're fine here), use:
mMount.object->getMountTransform(mMount.node, mMount.xfm, &nmat);

And finally, to solve the buildPolyList error, use:
return Parent::buildPolyList(PLC_Export, polyList, box, sphere);

That should give you a successful compile.
#16
07/18/2010 (6:45 pm)
Can anyone repost the Zip, its down.
#17
08/06/2010 (3:47 pm)
Ditto, the zip is showing up as corrupted when downloaded. Anyone have this, or can kcpdad repost the zip?

Or email it to me, even: ted@takethisouttaheredigitalflux.com

Many thanks!
#18
08/06/2010 (4:31 pm)
Hey guys,

I had this file luckily, uploaded it to our server:

turrets1_8_1.zip
#19
08/06/2010 (4:36 pm)
@Konrad: Absolutely awesome. Thank you!
#20
08/07/2010 (12:42 pm)
So sorry about disappearing the past two years, I had given up on my game development when lore and behold I rediscovered the drive about 2 months ago. Not the hard drive but the desire to write a game. In that time I lost my website so the download vanished.
So thank you Konrad Kiss for backing me up and covering for me during my absence. I put the file in a new location and changed the link in the resource.
On a side note I have went back to TGE because of problems I had porting my game to TGEA(unrelated to turrets). I plan to hold off any further porting until I see if I can get a working game in TGE then the decision will be to port to torque 3d not tgea.
Page «Previous 1 2