Trunk: weapon position forward on subentites not working

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
Griff
Oolite 2 Art Director
Oolite 2 Art Director
Posts: 2483
Joined: Fri Jul 14, 2006 12:29 pm
Location: Probably hugging his Air Fryer

Trunk: weapon position forward on subentites not working

Post by Griff »

Oolite Trunk version 2717
I think there's a problem with the weapon_position_forward key on subentities, it's being ignored. Subentities if given a forward laser seem to fire from their parents origin position.
You can quickly test this using the griff_normalmapped_anaconda ( http://www.box.net/shared/rpkms25cc9 ).

The NPC versions have no laser of their own, instead they have a small subentity positioned on their nose, this subentity has a pulse laser weapon type and a forward weapon position key in its shipdata.plist definitions yet when it fires the laser seems to come from the middle of the main hull not the position specified.

It's not all bad news though, laser positioning works properly on ships that don't use subentities for their guns
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: Trunk: weapon position forward on subentites not working

Post by Eric Walch »

Griff wrote:
Oolite Trunk version 2717
I think there's a problem with the weapon_position_forward key on subentities, it's being ignored. Subentities if given a forward laser seem to fire from their parents origin position.
You can quickly test this using the griff_normalmapped_anaconda ( http://www.box.net/shared/rpkms25cc9 ).
I had just a battle with some Imperial couriers and trunk 2717. I did not notice anything weird with their lasers on subs. Also the griff kraits gave me two beams. So probably there is something else?
User avatar
Frame
---- E L I T E ----
---- E L I T E ----
Posts: 1477
Joined: Fri Mar 30, 2007 8:32 am
Location: Witchspace

Re: Trunk: weapon position forward on subentites not working

Post by Frame »

Griff wrote:
Oolite Trunk version 2717
I think there's a problem with the weapon_position_forward key on subentities, it's being ignored. Subentities if given a forward laser seem to fire from their parents origin position.
You can quickly test this using the griff_normalmapped_anaconda ( http://www.box.net/shared/rpkms25cc9 ).

The NPC versions have no laser of their own, instead they have a small subentity positioned on their nose, this subentity has a pulse laser weapon type and a forward weapon position key in its shipdata.plist definitions yet when it fires the laser seems to come from the middle of the main hull not the position specified.

It's not all bad news though, laser positioning works properly on ships that don't use subentities for their guns
Seconded...

@Eric I think both your test scenarios are not using

Code: Select all

weapon_position_forward ="x y z";
as an entry in the sub entity ship key in the shipdata.plist file...

My Polaris class destroyer is using 21 military lasers as a forward super laser...

So I tried adding the entry

Code: Select all

weapon_position_forward ="1000 1000 1000";
like this...

Code: Select all

"Frame_Military_gun" =	
	{	
		ai_type = "nullAI.plist";
		energy_recharge_rate = 0;
		max_energy = 1;
		forward_weapon_type = "WEAPON_MILITARY_LASER";
		model = "missile.dat"; //looks nice will be changed ;.)
		name = "Military Laser";
		weapon_position_forward ="1000 1000 1000";
		roles = "FrameSubEntMilitaryLaser";		
	};
You would now expect the laser to originate somewhat odd, but no, it originates at the sub entitys position. I tested this on the polaris class of which I have posted a video taht clearly shows where its lasers are supposed to fire from...

So Griff you would need to split the engine from the gun section.. if you can
Bounty Scanner
Number 935
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

Laser positioning is 'a bit' delicate, so I wouldn't want to change that code in haste.

However, subentities lasers should fire from the centre (0,0,0) of the subentity itself, not of the ship they're attached to.

If you move the subentity about, so that its origin in wings3d (or equivalent) is - say - a few metres to the left of it, you should be able to see the laser fired from that off-centre position.

Hope this helps,

Kaks.
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
Griff
Oolite 2 Art Director
Oolite 2 Art Director
Posts: 2483
Joined: Fri Jul 14, 2006 12:29 pm
Location: Probably hugging his Air Fryer

Post by Griff »

ah, i just remembered, the tiny gun at the front of the anaconda and the 3 engines way over at the back of the ship are the same subentity, so that's why it looked like it was firing from the centerpoint of the main ship - i'll follow frame's advice and split the engines & the gun into 2 subentities things will be OK!

edit: ah, i see what you mean Kaks, shift the gun model in wings so the point i want the laser to fire from is at 0,0,0 and then shift the model back into the correct place in the subentites section of the main ship, fiendishly clever stuff!
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

Griff wrote:
shift the gun model in wings so the point i want the laser to fire from is at 0,0,0 and then shift the model back into the correct place in the subentites section of the main ship, fiendishly clever stuff!
Yes, that's what I meant! :)

Frame's solution is just as good though, and it's got the bonus of being less fiendishly 'clever' too! ;)
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
Frame
---- E L I T E ----
---- E L I T E ----
Posts: 1477
Joined: Fri Mar 30, 2007 8:32 am
Location: Witchspace

Post by Frame »

I saw they where connected(gun and engine) in my model viewer... But I know... You are on Mac.. :-)
Bounty Scanner
Number 935
User avatar
Griff
Oolite 2 Art Director
Oolite 2 Art Director
Posts: 2483
Joined: Fri Jul 14, 2006 12:29 pm
Location: Probably hugging his Air Fryer

Post by Griff »

thanks for the help everyone, I've split the gun into its own subentity and the laser beam is working great now
Post Reply