Jump to content

Making a non mouse look turret


SabaothMastema
 Share

You are about to reply to a thread that has been inactive for 2347 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Basically I want to make a turret that uses WASD or directional buttons to rotate and elevate/depress the barrels. "Ingredients" I think I will need are a force camera script, and rotation for the turret body. The turret will be part of a linkset in a style similar to a triple mount WW2 ship gun.
What would be an efficient method of doing this? Where would I start? Are there any premade?
Link to comment
Share on other sites

You can certainly use WASD or the arrow keys (plus PgUp and PgDown) to do your rotations.  That's what a control event is for.  Every setup has its own pecularities, so I wouldn't trust anyone's "pre-made" script, but it's not much of a challenge to write your own.  For camera control, you'll want to use llSetCameraParams.  There are good examples in the wiki.

Link to comment
Share on other sites

You will find the challenge of scripting a turret becomes far more manageable if you pay attention to some important details when making your turret and barrels (or if you make sure whoever is making the meshes for you pays attention to these details).   

First, you need to make sure that the objects' centres coincide with the points around which you want to rotate them.     This probably won't be much of an issue with the turret, but will probably involve some planning when you make the barrels.   There's a very helpful video tutorial by Ashasekayi Ra that explains how to do it, and will show you what I'm talking about (if I've not been clear about what I mean).

The second thing to keep in mind is that, if possible, the objects' local axes need to correspond to the way you want them to point -- that is, their front ends should be on their positive x axes, and their tops should be on their positive z axes.   In other words, after you've uploaded them to SL, look at them in the object editor with the ruler mode set to Local, and ensure the coloured arrows are pointing the right way.

What you're doing requires a reasonably sound grasp of how to rotate child prims by script, and there's no need to complicate your life unnecessarily by having to correct for axes and rotation points not being aligned the way you want them!   A bit of planning now will save you a lot of work later on (I speak from experience here!).

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2347 days.

Please take a moment to consider if this thread is worth bumping.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...