weapon_facings bug?

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

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
Zieman
---- E L I T E ----
---- E L I T E ----
Posts: 680
Joined: Tue Sep 01, 2009 11:55 pm
Location: in maZe

weapon_facings bug?

Post by Zieman »

Again, a quirk that I'm not sure if it is a bug or just me not getting it:
What weapon mounts are available on the ship. This is a bit-mask, so pick the mounts and add the numbers:

1 - Forward
2 - Aft
4 - Port
8 - Starboard
Value 1: works most of the time. Sometimes the ship will have Aft laser fitted anyway...
Value 3: works as intended (forward & aft laser mounts available)
Value 7: works as intended (forward, aft & port laser mounts available)
Value 15: works as intended (all 4 laser mounts available)
But if you add the numbers differently, results are weird IMHO:
Value 13 (1 + 4 + 8 ): you get forward, aft & port laser mounts available - logically should be forward, port & starboard
Value 12 (4 + 8 ): forward & aft laser mounts available instead of port & starboard
Value 9 (1 + 8 ): forward & aft laser mounts available instead of forward & starboard

Found this out when tried to make a ship that has forward and both side lasers available, but not aft laser.

Ah,
test 1.73.4
WinXP pro 32 bit
Last edited by Zieman on Sat Feb 27, 2010 9:39 pm, edited 1 time in total.
...and keep it under lightspeed!

Friendliest Meteor Police that side of Riedquat

[EliteWiki] Far Arm ships
[EliteWiki] Z-ships
[EliteWiki] Baakili Far Trader
[EliteWiki] Tin of SPAM
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Hmm. Looking into it, the way weapon facings are handled in the equipment purchase screen is nuts. There’s even a comment about it in the code:

Code: Select all

// FIXME: this is nuts
(PlayerEntity.m line 5742)

Basically, you can currently select from 0 to 4 items in the list (forward, aft, port, starboard), but you can’t skip over any items. The bit mask is a lie.
User avatar
Zieman
---- E L I T E ----
---- E L I T E ----
Posts: 680
Joined: Tue Sep 01, 2009 11:55 pm
Location: in maZe

Post by Zieman »

Ah, that explains it.

Fixed in 1.74 ?
...and keep it under lightspeed!

Friendliest Meteor Police that side of Riedquat

[EliteWiki] Far Arm ships
[EliteWiki] Z-ships
[EliteWiki] Baakili Far Trader
[EliteWiki] Tin of SPAM
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Nope.
User avatar
Poro
Deadly
Deadly
Posts: 249
Joined: Sun Jan 03, 2010 1:51 am
Location: Don't look in your aft view...
Contact:

Post by Poro »

I was about to create a post on this topic, glad I searched first. The sip I am making has had the port laser infrastructure ripped out and replaced with the ability to mount two extra missile pylons. (Hence weapon_facings = 11)

However, when I go into the equipment section of a station I find that I can still buy a port side laser :evil:

I'll just have to trust potential players to stick to the description :wink:
User avatar
Cmdr James
Commodore
Commodore
Posts: 1357
Joined: Tue Jun 05, 2007 10:43 pm
Location: Berlin

Post by Cmdr James »

I think Ive fixed this in whatever the next version will be.
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 »

Yep, James did fix that in trunk, so you can test it yourself with a nightly build. It would be a bit of a big job to port that fix to maintenance too, so I doubt it'll make it to 1.74.2...

You can also use weapon_facings to tell oolite not to upgrade specific main weapons! If you put

Code: Select all

weapon_facings = 0;
inside a cobra3 shipdata definition, trunk doesn't remove your front laser, it just makes it impossible to buy other lasers to put in its place... :)
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
Post Reply