Author Topic: Making a turret (like the tank turret)  (Read 910 times)

Ok so I am trying to get into this content creation thing for blockland, and so far blb doors and projectiles work great. I really want to move further and make myself a turret for an upcoming TDM though, but I got stuck. I know a turret like the tank turret is a playertype, but I can't help but think it only moves in 2 ways, rotating and barrel up/down. Now I can imagine rotating isn't an animation, but it needs a point to rotate about. How do I add this point to rotate the turret on?

Also, the barrel needs to move up and down, how do I tell the game about which point the barrel needs to rotate? Is this an animation I need to make, and if so, how?

Finally, how do I tell the game from which point to fire the projectile?

I'm getting pretty good at torkscript so the code shouldn't be a problem, I'm using most of the default tank turret code anyways.
Oh and how do I rell the game which part is the 'base' of the turret, and which part is the barrel? Like, so the entire turret doesn't tilt when you aim up.

Found some resources on how to make playertypes but those were so old all download links to examples were dead. It would help me a ton if someone that has made a turret in the past could give me the .ms3d or .blend file for it. Most importantly being that it has the above mentioned points already on it.
Thanks in advance.

the look up/down animation is the playertype's look animation. Rotation has no animation; the player just rotates to look in the direction the player riding the turret directs, just like how players rotate with no animation. What parts move is defined in the animation; just link the moving nodes to only the parts of the model you want to move

The way the tank turret handles the projectile firing is by putting mount0 at the end of the tank turret barrel, iirc (and using getMuzzlePoint(0) or something), and makes sure the eye node (as defined in the playertype model and its animations) is always facing the direction the turret is pointing so the game can use getEyeVector() to determine the projectile's normal vector of movement.

I'm working on a playertype making guide, as you may have noticed. You can probably get an example of a turret and its animations in 2.49b .blend file from Armyunit, if you ask nicely. You'll need a copy of the dts exporter .96 (not .97 beta 3) if you want to correctly export playertypes though.
« Last Edit: July 13, 2016, 07:30:35 PM by Conan »

2.49b .blend file from Armyunit
But then Lego Lad will never get off my ass.

Conan is helping me privately, I'll report back here when the turret's done. Locking for now.