Turret & AITurret classes, Version 1.20
by Brian Howard · 03/14/2004 (9:33 am) · 131 comments
Download Code File
Included in this archive are the original files and the files modified to work with 1.20 version. Most files did not have to be modified. Files that were modified were saved as a new file in an originalname_1_20.ext format. For example, trigger.cc had to be modified and the 1.20 code was saved as trigger_1_20.cc
I've maintained the same commenting format Paul used.
I've included the original turret_readme.txt file and an updated turret_readme_1_20.txt in the archive. The new readme file contains references for other fixes I found along the way. Please let me know if I missed a reference.
***I have not tested this on moving vehicles!
Hope the changes are helpful. I'll check back in, and do what I can to help out. This is my first posting, so let me know if there is a better way to communicate code updates.
Included in this archive are the original files and the files modified to work with 1.20 version. Most files did not have to be modified. Files that were modified were saved as a new file in an originalname_1_20.ext format. For example, trigger.cc had to be modified and the 1.20 code was saved as trigger_1_20.cc
I've maintained the same commenting format Paul used.
I've included the original turret_readme.txt file and an updated turret_readme_1_20.txt in the archive. The new readme file contains references for other fixes I found along the way. Please let me know if I missed a reference.
***I have not tested this on moving vehicles!
Hope the changes are helpful. I'll check back in, and do what I can to help out. This is my first posting, so let me know if there is a better way to communicate code updates.
#122
In genericTurret.cs if you haven't included rifle.cs (in game.cs) this code will not produce a projectile...
Replace RifleProjectile with CrossbowProjectile and it works fine.
I will make a PDF out of all this as a final upload.
03/08/2009 (4:23 pm)
Fixed the second problem.In genericTurret.cs if you haven't included rifle.cs (in game.cs) this code will not produce a projectile...
datablock ShapeBaseImageData(SmallTurretGun)
{
// Basic Item properties
shapeFile = "~/data/shapes/turrets/smallTurretGun.dts";
mass = 15;
//category = "Turrets"; // you dont want to place these
mountPoint = 0;
offset = "0 0 0";
projectile = RifleProjectile; // <--- doesn't exist!!!
projectileType = Projectile;
correctMuzzleVector = false; // not sure how this is used
...Replace RifleProjectile with CrossbowProjectile and it works fine.
I will make a PDF out of all this as a final upload.
#123
and just replace "void cTriggerSetOwner" function with
this:
TGEA dont use consoleInit() anymore.
03/08/2009 (5:44 pm)
in trigger.ccp dont need to add "void Trigger::consoleInit()"and just replace "void cTriggerSetOwner" function with
this:
ConsoleMethod( Trigger, setOwner, void, 3, 3, "Set owner.")
{
GameBase* owner = NULL;
if (Sim::findObject(argv[2], owner) == false)
return;
object->setOwner(owner);
}TGEA dont use consoleInit() anymore.
#124
03/08/2009 (6:02 pm)
I don't know why I'm receiving emails about this thread
#125
on 07/15/2004 (11:16 am)
@ Taras - thanks for that - I will update my notes.
03/08/2009 (6:15 pm)
@ Helk - Because you added a comment and probably ticked the box to recieved posts...on 07/15/2004 (11:16 am)
@ Taras - thanks for that - I will update my notes.
#126
we need to include resourceManager in turret.cpp
03/09/2009 (3:25 am)
one more thing:we need to include resourceManager in turret.cpp
#include "core/resourceManager.h"
#127
05/19/2009 (2:55 pm)
Andy, do you still intend to submit this as a resource? If not and if you don't mind then I'll submit your suggested changes since I got it working with a clean copy of the 1.8.1 Stronghold example. Let me know, thanks
#128
05/19/2009 (8:46 pm)
I don't mind if you submit yours - please do. I don't have the time just at the moment to do this, and it would benefit the community if you do. Thanks in advance.
#129
08/07/2009 (8:46 pm)
¿someone know how to fix the choppy movement? tips?
#130
01/27/2011 (3:32 am)
(ancient, I know) If you're talking about the choppiness that occurs when you're mounted to a Turret which is then mounted to a Vehicle... there is a solution, but it's been so long that I can't recall it. Somewhere on this site is a thread (I remember that I posted in it if that helps) with the solution... it involves the processAfter system.
#131
see this thread for the vehicles:
http://www.garagegames.com/community/forums/viewthread/123011
"I read through the second link a little more, and tried out Micheal's suggestion (Post #27/#28) and I'm not entirely sure or not (I'll have some of my friends see if they notice any difference), but from what I see, that looks to have fixed it."
referring to this:
http://www.garagegames.com/community/forums/viewthread/21812/2#comments
02/22/2011 (7:05 pm)
I have it working in TGEA 1.8.1 using Andy's changes. I'm currently working out the port to TGEA 1.8.2, but I don't think it should involve too much work to get it working.see this thread for the vehicles:
http://www.garagegames.com/community/forums/viewthread/123011
"I read through the second link a little more, and tried out Micheal's suggestion (Post #27/#28) and I'm not entirely sure or not (I'll have some of my friends see if they notice any difference), but from what I see, that looks to have fixed it."
referring to this:
http://www.garagegames.com/community/forums/viewthread/21812/2#comments

Associate Andy Hawkins
DrewFX
www.garagegames.com/community/resources/view/5345/6#comment-113981