Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: Asteroth on February 26, 2011, 11:42:09 pm

Title: Turrets not showing up
Post by: Asteroth on February 26, 2011, 11:42:09 pm
I've modded in a new ship, set up all the turrets in PCS2, and tabled in everything just like retail did things, but whenever I bring up FRED they don't show up under "weapons" and obviously don't work in-game either. I've looked over everything in PCS2 and the table a hundred times, but I can't find anything wrong. Is there something I'm overlooking?
Title: Re: Turrets not showing up
Post by: Droid803 on February 27, 2011, 12:36:22 am
Can you target the subsystem?

Does the turret subobject have the word "turret" somewhere in its name?
It doesn't matter where, it can be turret01, 01turret, or tureturreturet, but not turrent01.
Title: Re: Turrets not showing up
Post by: Asteroth on February 27, 2011, 12:53:46 am
I named them turretXX, and I can target its subsystems, but not any turrets. The spelling is also consistent with the table.
Title: Re: Turrets not showing up
Post by: Droid803 on February 27, 2011, 01:06:02 am
Did you set up the subsystem data in the POF?
you know, like

$special=subsystem
$name=turret
$fov=180


If you did...uh...I think I'd need to see the pof.
Title: Re: Turrets not showing up
Post by: Asteroth on February 27, 2011, 01:12:35 am
The what? I don't see where I would put this (no, I don't have this).
Title: Re: Turrets not showing up
Post by: ssmit132 on February 27, 2011, 02:24:12 am
You have to select the submodel in PCS2, and there should be a box at the side labelled "Properties".

(http://img28.imageshack.us/img28/9291/turretn.png)

The $fov= entry determines the angle the turret can fire to. I don't remember if the number is actually half of the actual field of view or not (e.g. $fov=180 means it can fire in any direction), however I doubt it.
Title: Re: Turrets not showing up
Post by: Asteroth on February 27, 2011, 03:04:56 am
Ah, I never looked much under subobjects, thought it was just a list. Well, it's working now ... better then it was before anyway, at least they are shooting, I'll need to fiddle around with rotation axes to get them to turn right. Thanks!
Title: Re: Turrets not showing up
Post by: Droid803 on February 27, 2011, 12:53:59 pm
I'll need to fiddle around with rotation axes to get them to turn right. Thanks!

NO. WRONG.

Turrets don't use rotation axes.

Don't do that.

use $fvec and $uvec if you have sidemounted multiparts.
fvec is the "forward" vector (meaning where the front of it is.
uvec is its "up" vector, which is where its...up direction.
Title: Re: Turrets not showing up
Post by: Asteroth on February 27, 2011, 01:51:47 pm
I'll need to fiddle around with rotation axes to get them to turn right. Thanks!

NO. WRONG.

Turrets don't use rotation axes.

Don't do that.

use $fvec and $uvec if you have sidemounted multiparts.
fvec is the "forward" vector (meaning where the front of it is.
uvec is its "up" vector, which is where its...up direction.
Ah! Sorry! I assume I just put in "y", "z", or "x" in there? And I also assume that the arms must be pointed directly up like I notice all other multiparts are?
Title: Re: Turrets not showing up
Post by: Droid803 on February 27, 2011, 02:26:12 pm
I've always put my arms pointing "up" relative to the base of the turret, but I've seen it also work with the arms pointing up globally.
I find it easier when its up relative to the base of the turret cause then your UVEC is just your normal for the turret.

For sidemounted turrets, that is.

For top-mounted multiparts you don't need to set anything short of the turret base and arm in the turrets section as long as they're facing forward.
For bottom-mounted, also no fvec/uvec as long as they're facing backwards.
Title: Re: Turrets not showing up
Post by: Asteroth on February 27, 2011, 06:11:04 pm
Alright, getting slowly better. Thank you for your help. When I put this:

$special=subsystem
$name=turret
$fov=180
$fvec=0,0,1
$uvec=1,0,0

Under the turrets properties, postive Z being forward and positive X being to the right of the ship, and the turret's "up" (I put nothing under the arm suboject's properties, dunno if anything is supposed to go there of not), I get what is in the attached picture. The one on the left is its normal position, the right is what I get in game with a target being directly ahead.

[attachment deleted by ninja]
Title: Re: Turrets not showing up
Post by: Droid803 on February 27, 2011, 06:46:23 pm
Hmm...maybe I've been doing it wrong all along...with respect to FVec/Uvec...they don't quite target like how I want them to...but uh...well, my turrets certainly don't fly off the hull like that...

EDIT:
Ok, for some god forsaken reason, uvecs should have their first value flipped (ie. -1:0:0 instead of 1:0:0), at least that's how it is on the Phoenix Rising. God knows why.

That still doesn't explain why its flying off though.
Title: Re: Turrets not showing up
Post by: Asteroth on February 27, 2011, 07:21:27 pm
Changing it like you said didn't have any effect, in fact changing it in any way still has no effect. Could I have somehow messed up the axes in Blender, or something like that?
Title: Re: Turrets not showing up
Post by: Droid803 on February 27, 2011, 07:30:42 pm
Did you reset their x-form prior to export?
On export everything should have no rotation applied to it.
Title: Re: Turrets not showing up
Post by: Asteroth on February 27, 2011, 09:19:28 pm
I saw that the turret and their arms did have rotations on them, in fact the rotations would be entirely consistent with their orientation in game. After fixing all those issues, though, it also had no effect. I've attached the .blend and .pof

[attachment deleted by ninja]
Title: Re: Turrets not showing up
Post by: Droid803 on February 27, 2011, 11:53:54 pm
Don't use blender so the blend file's no use to me.
The pof looks fine to me, at least at first glance.