Sub-ent Gun Prob

General discussion for players of Oolite.

Moderators: winston, another_commander

Post Reply
User avatar
Killer Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 2278
Joined: Tue Jan 02, 2007 12:38 pm

Sub-ent Gun Prob

Post by Killer Wolf »

This goddamn OXP is fighting me every step of the way >:-(

i'm trying to give a ship dual lasers, as i did w/ my Vampires. copied the stuff into the shipdata list, mapped the positions of the gun muzzles, and it's not working. i've got;

Code: Select all

"test_rgun" = 
	{
	ai_type = "nullAI.plist";
	model = "rgun.dat"; 
	name = "test";	 
	roles = "subent"; 
	forward_weapon_type = "WEAPON_BEAM_LASER";
	weapon_position_forward = "11.0 -5.8 67.8";
	laser_color = "redColor";
	};	
and an equivalent "lgun" for the other side using -11.0 for the 'x' value.

it's not working; both lasers are off to the right side but further out than 11, yet - if i paste those coordinates into a flasher, they appear exactly at the gun muzzles where i want them. you cas see here, including the two yellow flashers where the guns are supposed to be
Image

what's throwing off the laser position, anyone got a clue??


TIA
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4830
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Sub-ent Gun Prob

Post by phkb »

What happens if you take out the weapon_position_forward value?
User avatar
Cholmondely
Archivist
Archivist
Posts: 5364
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: Sub-ent Gun Prob

Post by Cholmondely »

Oh! And now that Phkb has said something intelligent, I hope that you both had an utterly spiffing Xmas!
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
User avatar
Killer Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 2278
Joined: Tue Jan 02, 2007 12:38 pm

Re: Sub-ent Gun Prob

Post by Killer Wolf »

phkb wrote: Thu Dec 28, 2023 8:50 pm
What happens if you take out the weapon_position_forward value?
?
i haven't tried. what benefit would that do, it then wouldn't have any co-ordinates at all to work w/?
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4830
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Sub-ent Gun Prob

Post by phkb »

The position values you put into a subentity are relative to *that* subentity. And when that subentity is added to a parent object (ie your primary ship) all the position values are adjusted based on the position given to the subentity.

However, you seem to have put the position of the laser relative to the primary ship, *not* the subentity. Does that make sense? What I've saying is, the weapon_position_forward value, as defined in the subentity, should be relative to the subentity.
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4830
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Sub-ent Gun Prob

Post by phkb »

By removing the weapon_position_forward value (which would then default to 0, 0, 0) you might find the lasers are positioned better.
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4830
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Sub-ent Gun Prob

Post by phkb »

Cholmondely wrote: Thu Dec 28, 2023 8:59 pm
And now that Phkb has said something intelligent
I guess it had to happen sometime! I'll blame Christmas for all the unintelligent responses! :lol:
User avatar
cbr
---- E L I T E ----
---- E L I T E ----
Posts: 1422
Joined: Thu Aug 27, 2015 4:24 pm

Re: Sub-ent Gun Prob

Post by cbr »

phkb wrote: Thu Dec 28, 2023 9:49 pm
However, you seem to have put the position of the laser relative to the primary ship, *not* the subentity. Does that make sense? What I've saying is, the weapon_position_forward value, as defined in the subentity, should be relative to the subentity.
And the flasher is a point source and not a model like the gun.dat with a size?
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4830
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Sub-ent Gun Prob

Post by phkb »

cbr wrote: Thu Dec 28, 2023 9:54 pm
And the flasher is a point source and not a model like the gun.dat with a size?
I suspect KW put the flasher on the primary ship, not on the subentity. The values we has are correct when entered on the primary object (the "parent", I guess you'd say), but not in the subentity.
User avatar
Killer Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 2278
Joined: Tue Jan 02, 2007 12:38 pm

Re: Sub-ent Gun Prob

Post by Killer Wolf »

huh. that hasn't been how it always was though, has it? My lasers on the Dominatrix etc worked fine, as far as i recall?
i've always modelled the ships, split the guns into separate models and used the co-ordinates for positioning as i do the Flashers, based on where they are in 3D space around the model. all the vertex positions for the guns are the same as they are for the total model, ie relative to the origin of 3D space which is central to the ship for handling characteristics etc. where does the origin get shifted to on the sub-ents, central to a bounding box or such? if so it makes accurate placing a lot more fiddly.

EDIT - got it. errant vertex was off one side, not sure why that would throw off vertext coordinates but i've zapped it and the guns look okay.

ah, the joys of ship building.
Post Reply