flysouth Posted May 30, 2016 Share Posted May 30, 2016 HiI would like to mount a Turret to a vehicle. Does anyone know how I can do this? Note I dont want to just mount an image, I want a working Turret. I have created a working turret but am not sure how to mount a 'TurretShape' to a vehicle. Quote Link to comment Share on other sites More sharing options...
Jason Campbell Posted June 1, 2016 Share Posted June 1, 2016 Hey flysouth, when you say that you have a working turret, do you mean when you mount it, you can aim in 360 degrees and fire it. I made a Jeep with a mounted turret but it was just like the cheetah turret but a machine gun. The cheetah datablock has a mounted turretshape as an example. If your working turret is fully able to be aimed, I would love to see the code. Quote Link to comment Share on other sites More sharing options...
flysouth Posted June 2, 2016 Author Share Posted June 2, 2016 Hi JasonI have worked out how to mount it.. but I cannot get it to move.The cheetah turret is just mounting a static image using the ShapeBaseImageData datablock. I am using the TurretShapeData datablock.What I have is a separate barrel mesh and turret mount mesh. The datablocks are then defined like a deployed turret which mounts the barrel on the turret mount mesh. This mesh has a mount point and a pitch point and in theory should move using the setTurretEulerRotation function. I then mount this scripted turret as an object to the vehicle. But this is where thing dont seem to work. I have posted on this forum to see if anyone knows what the problem is. It also has another problem which I believe is a bug in the engine. The turret does not stay in perfect sync with the vehicle when the vehicle moves. I have seen a code fix for that problem in these forumsIf i set rotate to true then the turret mount and barrel turn perfectly together - just in the editorI will post evrything here once I get it working Quote Link to comment Share on other sites More sharing options...
Johxz Posted June 3, 2016 Share Posted June 3, 2016 @Dwarf King Little guide of how to do it: http://forums.torque3d.org/viewtopic.php?f=36&t=516&p=5531#p5531 Quote Link to comment Share on other sites More sharing options...
flysouth Posted June 3, 2016 Author Share Posted June 3, 2016 @ JohxzThanks - But that is the well documented 'easy' part and I figured that out. I now have a scripted turret with barrel mounted on my vehicle. The part where I have not seen a single document or tutorial or working example is how to control the turret and weapon. setTurretEulerRotation appears to be the command but does nothing even if typed in at the ~ console. Is there a bug in 3.8? Can somebody test it and tell me if it works for them. Quote Link to comment Share on other sites More sharing options...
Johxz Posted June 3, 2016 Share Posted June 3, 2016 bug? yes a few, related to that don't know... but why not download the last development version, have bugs fixed... if you don't want to compile, you can download the binary from here http://forums.torque3d.org/viewtopic.php?f=2&t=665 Quote Link to comment Share on other sites More sharing options...
flysouth Posted June 4, 2016 Author Share Posted June 4, 2016 I downloaded the binary and it is exactly the same. The setTurretEulerRotation function does not seem to work. But being a noob to T3D I might just be doing something wrong.Although if you look at http://forums.torque3d.org/viewtopic.php?f=12&t=666 it does seem like there is a problem Quote Link to comment Share on other sites More sharing options...
Johxz Posted June 4, 2016 Share Posted June 4, 2016 hey talking about turrets :roll: perhaps this interests youhttp://www.garagegames.com/community/resources/view/20792pdTurretsT3DScripts.zippdTurretsT3D.zip Quote Link to comment Share on other sites More sharing options...
flysouth Posted June 4, 2016 Author Share Posted June 4, 2016 Thanks I will take a look. I was hoping not to modify the source.This stuff is 5 years old. Why has it not been fixed in the current engine?Okay I tried to mod the source files but failed due to the fact that some of them have had such major changes that the bug fixes are no longer compatible and will reuire some serious investigation to patch - so back to the drawing board. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.