Page 1 of 2
Ball Turrets
Posted: Wed Mar 07, 2012 4:39 am
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.
Re: Ball Turrets
Posted: Wed Mar 07, 2012 8:31 am
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?
Re: Ball Turrets
Posted: Wed Mar 07, 2012 1:29 pm
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.
Re: Ball Turrets
Posted: Wed Mar 07, 2012 1:56 pm
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.
Re: Ball Turrets
Posted: Wed Mar 07, 2012 2:13 pm
by Storm
If you've got a ball turret model, then that will need to be centred as well I presume?
Re: Ball Turrets
Posted: Wed Mar 07, 2012 3:10 pm
by mandoman
Yeah, it has it's own ball turret model. I removed it from shipdata.plist. Too much hassle.
Re: Ball Turrets
Posted: Wed Mar 07, 2012 5:32 pm
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.
Re: Ball Turrets
Posted: Wed Mar 07, 2012 5:59 pm
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.
Re: Ball Turrets
Posted: Thu Mar 08, 2012 2:05 am
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.
Re: Ball Turrets
Posted: Sat Mar 10, 2012 1:48 pm
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.
Re: Ball Turrets
Posted: Sat Mar 10, 2012 4:13 pm
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?
Re: Ball Turrets
Posted: Sun Mar 11, 2012 6:55 am
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.
Re: Ball Turrets
Posted: Sun Mar 11, 2012 3:27 pm
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.
Re: Ball Turrets
Posted: Sun Mar 11, 2012 4:02 pm
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.
Re: Ball Turrets
Posted: Sun Mar 11, 2012 5:05 pm
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