Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: Darkhill on April 19, 2005, 05:57:07 pm

Title: Multi part turret question
Post by: Darkhill on April 19, 2005, 05:57:07 pm
Maybe I have a misconception on how these are supposed to work, but I seem to be having a problem.  The barrels seem to rotate off the base.  I guess the best to describe is just to show a picture.  Notice how the barrels are in mid air, this happens for any rotation direction I give it.  Any ideas?

http://sco.minos.net/test/turret.jpg
Title: Multi part turret question
Post by: Col. Fishguts on April 19, 2005, 06:06:21 pm
If converting with PCS, make sure you set the axis in TrueSpace where you want the pivot of the barrels to be.
Title: Multi part turret question
Post by: Darkhill on April 19, 2005, 10:02:48 pm
How might I do that?
Title: Multi part turret question
Post by: brugger on April 19, 2005, 10:50:45 pm
select the turret arms and then use the axes button to select the axes for that object then move it to the base of the turret arms
Title: Multi part turret question
Post by: Darkhill on April 20, 2005, 01:53:01 pm
There is an "Axes" button but I'm not quite sure what you are supposed to do with it.
Title: Multi part turret question
Post by: Col. Fishguts on April 20, 2005, 02:13:17 pm
Quote
Originally posted by darkchrono4
There is an "Axes" button but I'm not quite sure what you are supposed to do with it.


When you press it, you get a little coordinate-system-thingy
(http://underworld.fortunecity.com/pacman/106/fs2mods/shipcreationguide/group18.gif) <- this one
which you can move around. PCS uses the position of that thing as pivot data for multipart turrets.
Each object has its own axes: The axes of the turret base define around which point the whole turret rotates, the axes of the barrels/arms (obviously) are the pivot (=center of rotation) of the barrels.
Title: Multi part turret question
Post by: Darkhill on April 20, 2005, 02:51:53 pm
Not that I'm really sure what I'm supposed to be doing with the axes thing.  But whenever I try and load a model into PCS it gives me a stack overflow error.
Title: Multi part turret question
Post by: Darkhill on April 20, 2005, 07:06:16 pm
Sometimes when I press the axes button I get a multicolored thing I can move around.  But moving it around seems to move the whole thing around.  Then sometimes it looks like there is a little white x,y,z in the middle of the object but moving it around seems to do nothing.  Looking at Karajorma's tutorial on it and its about not helpful on this topic.
Title: Multi part turret question
Post by: StratComm on April 20, 2005, 07:19:48 pm
Moving the little x/y/z thing around is what you want to do.  That is the pivot of the object (so you should notice after moving it that rotations are now about that point) and it must be moved to the base of a turret for it to even think about rotating correctly.  What's confusing is that both the geometry and the group have independent axes, and I can't remember which one actually gets used (I think it's the group) so you have to set it multiple times for each subobject.
Title: Multi part turret question
Post by: karajorma on April 20, 2005, 07:24:42 pm
That's why I never put anything about axes in the tutorial. I never could remember which one was used :D
Title: Multi part turret question
Post by: StratComm on April 20, 2005, 07:27:31 pm
I think it's the group pivot, because even if the geometry is set to the right pivot before you glue on a light and then the light (and the resulting group pivot) are out of place, the turret still rotates wrong.  Best advice until anyone can prove it one way or the other is to tell people to set both.
Title: Multi part turret question
Post by: brugger on April 20, 2005, 08:10:53 pm
i never mess with the axis for the group only the individual subobjects turret arm and turret base, but almost never the base
Title: Multi part turret question
Post by: StratComm on April 20, 2005, 11:29:48 pm
If you place the lights correctly when you are gluing, you should never have to mess with the subobject.  But I'm pretty sure that the turret base itself would never have its center of geometry set somewhere other than at the center of the model.
Title: Multi part turret question
Post by: brugger on April 21, 2005, 12:16:09 am
I had an idea for turret and i wanted it to rotate around a peice that potruded foward rahter than the center. it didn't look like I hoped, but that was the one time i moved the axis on the turret base
Title: Multi part turret question
Post by: Darkhill on April 21, 2005, 12:16:20 am
Maybe I'm not setting up the subobjects in the proper way then.  First off, I use Trueview for everything, so I don't glue I just drag and drop.  But I drop a light on the arm object then on the object itself I click on the 'center axis' button.  I copy the x,y,z values of the object to the light then I 'center axis' for the whole group.

The little white x,y,z thing I can't actually move around all I can do is rotate it.
Title: Multi part turret question
Post by: StratComm on April 21, 2005, 12:23:52 am
Ok, so you do know about the center axis button.  That's a start.  Doing it that way there's virtually no way you're getting the axis location wrong EXCEPT: you're centering the turrets above a point inside the turret.  The axis on turret barrels should be at the bottom of the barrels themselves, not half-way up.  Though I'm having a hard time making out the picture you posted, what will happen if you just use center axis for everything is this:
Code: [Select]


------

  --
 /  \
/    \


when you want this
Code: [Select]


  --
 /  \-----
/    \


Sorry for the crappy ASCII art.  You should be able to move the axis when you have move object selected and the axis itself is white.

Oh, and you cannot put multiparts on any portion of the ship other than top-facing surfaces or bottom facing surfaces.  Is the turret in question on the side of the ship, by chance?
Title: Multi part turret question
Post by: brugger on April 21, 2005, 12:27:58 am
the way that i get it to work is to treat the axes for the base and arms independently. assuming that you want the base to rotate around the center leave its axis alone. to get the arms to rotate around the base you have to move the axis for just the arms down to the bottom of the arms. try manually entering the location for the white thing instead of moving it with the mouse, then you have to make sure that in pcs the base is the parent object of the arms and the subobjects are rotating around the right x,y,z axis
Title: Multi part turret question
Post by: StratComm on April 21, 2005, 12:46:56 am
Quote
Originally posted by brugger
then you have to make sure that in pcs the base is the parent object of the arms and the subobjects are rotating around the right x,y,z axis


No you don't, no you don't, no you don't.  I've seen this myth propogated so many places it's scary.  For multipart turrets (or any other subobject without the $rotates=n flag) you don't need to define rotational axes.  The game figures those out on its own.

So for future reference, I'm going to set the record straight every time I see this incorrect statement until the community as a whole stops propogating it.




darkchrono4, this may be the source of your problem.  Multipart turrets will ALWAYS rotate around the vertical axis (y-axis in PCS, z(?) in modelview) and the barrels will always rotate forward and back.  No exceptions.  Though with the animation code, you can specify a different default angle if you always want them to start out facing sideways.  After closer observation of the screenshot you posted, I can say that you DEFINITELY have something wrong with your turret placement, as I see barrels sticking out at at least two different directions.  There's no way that's going to work.
Title: Multi part turret question
Post by: brugger on April 21, 2005, 01:19:04 am
Quote
Originally posted by StratComm


No you don't, no you don't, no you don't.  I've seen this myth propogated so many places it's scary.  For multipart turrets (or any other subobject without the $rotates=n flag) you don't need to define rotational axes.  The game figures those out on its own.




I had heard this but when i didn't set the rotation axis the turrets didn't rotate properly in modelview, never tried seeing if it worked right in game though
Title: Multi part turret question
Post by: StratComm on April 21, 2005, 01:32:43 am
Modelview plays things fast and loose there, and more importantly never looks at tables or the FS code itself.  In my experience, they don't rotate correctly in modelview even if you set the rotation.
Title: Multi part turret question
Post by: Col. Fishguts on April 21, 2005, 02:10:06 am
Quote
Originally posted by StratComm
I think it's the group pivot, because even if the geometry is set to the right pivot before you glue on a light and then the light (and the resulting group pivot) are out of place, the turret still rotates wrong.  Best advice until anyone can prove it one way or the other is to tell people to set both.


Ah yes...I forgot to mention. It's indeed the group axes that get used, the object axes are ignored.
Thus. Select the group of the barrel in TrueView -> press axes button -> move the white x/y/z thing to where you want the pivot of your barrel to be -> save before TS makes something stupid ;)

Or ask IPAndrews how it works (that's what I usually do :D )
Title: Multi part turret question
Post by: karajorma on April 21, 2005, 02:43:58 am
Quote
Originally posted by StratComm
No you don't, no you don't, no you don't.  I've seen this myth propogated so many places it's scary.  For multipart turrets (or any other subobject without the $rotates=n flag) you don't need to define rotational axes.  The game figures those out on its own.


That will probably be my fault. I tell them to do that in the turretting tutorial so things work in modelview. IIRC I did that because PCS does seem to assign a rotational axis and it picks the wrong one as far as modelview is concerned. If you're telling me that the game completely ignores the data regardless of what it is then I'll play around with one of my models and then update the tutorial accordingly. (I'll sort out this thing with the axis while I'm there).
Title: Multi part turret question
Post by: Darkhill on April 21, 2005, 11:35:42 am
I do realize now that my problem with the barrels is the axis is at the center.  Moving it to the bottom is starting to be a real problem.  This is what I'm doing, tell me what I'm doing wrong.  Click on the object itself, click on the axes button, little white thing appears but when I move it it moves the object around, I can't physically move it anywhere.  Then I had the idea of moving the light to the base of the barrel and using the center axis button.  Made it better but it still has a problem, look at the picture to see.

http://sco.minos.net/test/turret1.jpg

In Modelview what direction are the pieces supposed to be going?  FS2 models both pieces go in z.  But when PCS converts it the base is like x and the arms are z.  When I change them both to z I get the problem like above.  

I know turrets have to be on the top or bottom, but does it have to be a perfectly flat surface?  The front turrets on the modified corvette are at a bit of an angle.
Title: Multi part turret question
Post by: karajorma on April 21, 2005, 11:57:11 am
What I always did was press rightmouse on the little pointer button so that the object info box was open. Once I clicked on the axis button the axis was sellected and then I could move it about by simply typing in the place where I wanted it.

Much more accurate than moving it about by eye.
Title: Multi part turret question
Post by: Darkhill on April 21, 2005, 01:06:57 pm
I missed the fact that you can move it around with the object box.  I kind of half way got it to rotate right now.  The white x,y,z does it have to be pointing perfectly down or just in that general area?  And I thought in FS2 the bases moved around and the barrels moved with them then the barrels moved up and down?
Title: Multi part turret question
Post by: Roanoke on April 22, 2005, 03:25:01 pm
Quote
Originally posted by Col. Fishguts


Ah yes...I forgot to mention. It's indeed the group axes that get used, the object axes are ignored.
Thus. Select the group of the barrel in TrueView -> press axes button -> move the white x/y/z thing to where you want the pivot of your barrel to be -> save before TS makes something stupid ;)

Or ask IPAndrews how it works (that's what I usually do :D )


I've found, when messing with V models, setting object axes does the trick but setting group axes too messes it all up.
Title: Multi part turret question
Post by: StratComm on April 22, 2005, 03:29:25 pm
Ok, the cob format isn't really that convoluted and hasn't changed in what, 7 years?  I seriously doubt that there is a difference and yet we've got probably six differing (and conflicting) instructions on what to set.  When using PCS for conversion, unless something has changed since I got the Max plugin working, then group axis is important.  And I've never seen it cause any problem to set both, even were one is not being used.

You aren't using cob2fs2 for conversion or something, are you?