Ball Turrets

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: another_commander, winston

User avatar
mandoman
---- E L I T E ----
---- E L I T E ----
Posts: 1375
Joined: Thu Apr 28, 2011 3:17 pm

Ball Turrets

Post by mandoman »

I have been working on a ship on which I am trying to mount ball turrets. I have done this type of thing before with no problem, but this is acting way different. I have adjusted the Y numbers into the one-hundredths, but the ball will not center. It's wild, I'll lower it by a one one-hundredth of a decimal point, and it nearly drops off of the ship. If I boost it back up to where I just changed it, the ball ends up in a higher position than it was before. It will not center. Has anyone else run into this? I have the Z number pretty much exact, it's just the X numbers that are not cooperating. Any insights would be most welcome. :)
Mandotech Industries Wiki Page.

http://wiki.alioth.net/index.php/User:Mandoman
User avatar
SandJ
---- E L I T E ----
---- E L I T E ----
Posts: 1048
Joined: Fri Nov 26, 2010 9:08 pm
Location: Help! I'm stranded down here on Earth!

Re: Ball Turrets

Post by SandJ »

I had a similar thing when converting the ball turret definitions from the 'old-style' subentity definition format to the 'new-style' subentity definition format. It was fixed by adding type = ball_turret; to the definition:

Code: Select all

subentities = (
    {type = ball_turret; subentity_key = "SiR-Turret-M"; position = (0.0, 21.0, -16.0); orientation = (1, 0, 0, 0); fire_rate = 0.25;},
    {type = ball_turret; subentity_key = "SiR-Turret-M"; position = (0.0, 21.0, -16.0); orientation = (0, 0, 1, 0); fire_rate = 2.50;},
    ....
Without the type = ball_turret; they moved to weird positions around the ship.

Is that the problem?
Flying a Cobra Mk I Cobbie 3 with nothing but Explorers Club.OXP and a beam laser 4 proper lasers for company :D
Dropbox referral link 2GB of free space online + 500 Mb for the referral: good for securing work-in-progress.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5525
Joined: Thu Jun 12, 2008 6:55 pm

Re: Ball Turrets

Post by Thargoid »

Also don't forget that a ball turret will rotate to try and track its targets. So if your model isn't properly centred when you create the obj file, then it could easily swing around all over the place.
User avatar
mandoman
---- E L I T E ----
---- E L I T E ----
Posts: 1375
Joined: Thu Apr 28, 2011 3:17 pm

Re: Ball Turrets

Post by mandoman »

I learned how to list ball turrets using the "new" style from the beginning, so it can't be that. As for being centered, I checked the ship position in Blender several times, and it's as centered as well as I know how to make it. I'll check again, though. Thanks.
Mandotech Industries Wiki Page.

http://wiki.alioth.net/index.php/User:Mandoman
Storm
Dangerous
Dangerous
Posts: 91
Joined: Mon Jan 30, 2012 10:27 pm
Location: UK

Re: Ball Turrets

Post by Storm »

If you've got a ball turret model, then that will need to be centred as well I presume?
User avatar
mandoman
---- E L I T E ----
---- E L I T E ----
Posts: 1375
Joined: Thu Apr 28, 2011 3:17 pm

Re: Ball Turrets

Post by mandoman »

Yeah, it has it's own ball turret model. I removed it from shipdata.plist. Too much hassle.
Mandotech Industries Wiki Page.

http://wiki.alioth.net/index.php/User:Mandoman
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5525
Joined: Thu Jun 12, 2008 6:55 pm

Re: Ball Turrets

Post by Thargoid »

It was the ball turret model I was referring to - that's the one that rotates about its centre to point toward its target. Hence if it's off-centre, then it'll still rotate about the origin of its model, hence it'll rotate in an arc.
User avatar
mandoman
---- E L I T E ----
---- E L I T E ----
Posts: 1375
Joined: Thu Apr 28, 2011 3:17 pm

Re: Ball Turrets

Post by mandoman »

Thargoid wrote:
It was the ball turret model I was referring to - that's the one that rotates about its centre to point toward its target. Hence if it's off-centre, then it'll still rotate about the origin of its model, hence it'll rotate in an arc.
Hmmm, I did mess with the front face on the ball turret a little. Suppose I screwed it up. I'll take a look at that. Thanks, Thargoid.
Mandotech Industries Wiki Page.

http://wiki.alioth.net/index.php/User:Mandoman
User avatar
mandoman
---- E L I T E ----
---- E L I T E ----
Posts: 1375
Joined: Thu Apr 28, 2011 3:17 pm

Re: Ball Turrets

Post by mandoman »

What can I say. Thargoid, you nailed it again. I had the ball turret centered forward, and back, side to side, but I didn't check where it was up and down. The Y factor was clear out of whack, and when I got it centered all the way around, and made a new .dat from it, the ball turrets sat it place perfectly. I miss the stupidest things. It's a bit agravating. Thanks for your help. :)
Mandotech Industries Wiki Page.

http://wiki.alioth.net/index.php/User:Mandoman
User avatar
MiMoriarty
Competent
Competent
Posts: 39
Joined: Mon Nov 14, 2011 1:03 pm
Location: Madrid, España
Contact:

Re: Ball Turrets

Post by MiMoriarty »

I'm in the same problem here. I've reused the same turret model i have in the Yasen, it worked pretty well in that ship so i imported the .obj file for the Lira model. I've the turret centered but it rotates to a weird arc when it's activated. :?:
There is an art, it says, or rather, a knack to flying. The knack lies in learning how to throw yourself at the ground and miss. … Clearly, it is this second part, the missing, which presents the difficulties.
Blog http://mimoriarty.wordpress.com/
User avatar
mandoman
---- E L I T E ----
---- E L I T E ----
Posts: 1375
Joined: Thu Apr 28, 2011 3:17 pm

Re: Ball Turrets

Post by mandoman »

MiMoriarty wrote:
I'm in the same problem here. I've reused the same turret model i have in the Yasen, it worked pretty well in that ship so i imported the .obj file for the Lira model. I've the turret centered but it rotates to a weird arc when it's activated. :?:
I believe you are encountering quaternion problems with that. If you don't have the ball turret pointing in the correct direction using the quaternions, they may end up firing into your own ship, or not at all. At least, that's what I have discovered. How are you figuring your quaternion numbers?
Mandotech Industries Wiki Page.

http://wiki.alioth.net/index.php/User:Mandoman
User avatar
MiMoriarty
Competent
Competent
Posts: 39
Joined: Mon Nov 14, 2011 1:03 pm
Location: Madrid, España
Contact:

Re: Ball Turrets

Post by MiMoriarty »

I've my ballturret model placed in Blender in a general file with all the the subentities and main hull. Then I made single files from this one. So the first ballturret has a quaternation of (0 0 0 1 0 0 0). After that I didn't found too many problems placing a second one.
There is an art, it says, or rather, a knack to flying. The knack lies in learning how to throw yourself at the ground and miss. … Clearly, it is this second part, the missing, which presents the difficulties.
Blog http://mimoriarty.wordpress.com/
User avatar
mandoman
---- E L I T E ----
---- E L I T E ----
Posts: 1375
Joined: Thu Apr 28, 2011 3:17 pm

Re: Ball Turrets

Post by mandoman »

MiMoriarty wrote:
I've my ballturret model placed in Blender in a general file with all the the subentities and main hull. Then I made single files from this one. So the first ballturret has a quaternation of (0 0 0 1 0 0 0). After that I didn't found too many problems placing a second one.
You got me. I'm no expert, but that quaternion string you showed isn't anything like I've ever used, but I still struggle with them to some degree as well. I think there should only be four numbers in that string. The angle of the turret, and the numbers representing the X, Y, and Z of the turret. Most turrets pivot on the X, and Y axis', and sometimes on the Z. Some of the most common quaternions I have come up with are 0 0 01, 0 1 0 0, or even 0.5 0 0.5 0, or some such configuration. It's usually the angle the turret is pointing out from the ship that screws up my equations. :roll: :)
Mandotech Industries Wiki Page.

http://wiki.alioth.net/index.php/User:Mandoman
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5525
Joined: Thu Jun 12, 2008 6:55 pm

Re: Ball Turrets

Post by Thargoid »

I think what was posted is an old-style sub-entity definition string. If so, then it's X/Y/Z position ( 0,0,0 in the above) followed by the orientation quaternion (1 0 0 0 in the above, basically pointing along +z).

You are correct that a quaternion should be a 4-digit string.
User avatar
SandJ
---- E L I T E ----
---- E L I T E ----
Posts: 1048
Joined: Fri Nov 26, 2010 9:08 pm
Location: Help! I'm stranded down here on Earth!

Re: Ball Turrets

Post by SandJ »

Thargoid wrote:
I know what was posted was the old-style sub-entity definition string. If so, then its X/Y/Z position (0 0 0 ... in the above) followed by the orientation quaternion (... 1 0 0 0)
WHS
Flying a Cobra Mk I Cobbie 3 with nothing but Explorers Club.OXP and a beam laser 4 proper lasers for company :D
Dropbox referral link 2GB of free space online + 500 Mb for the referral: good for securing work-in-progress.
Post Reply