SabaothMastema Posted May 2, 2016 Share Posted May 2, 2016 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 More sharing options...
Rolig Loon Posted May 2, 2016 Share Posted May 2, 2016 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 More sharing options...
Innula Zenovka Posted May 2, 2016 Share Posted May 2, 2016 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 More sharing options...
SabaothMastema Posted May 3, 2016 Author Share Posted May 3, 2016 Wow between the two posts this is the most enlightening thread I have made. Thanks for all of the information. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now