buying ships with subentities (1.75.2)

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

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

buying ships with subentities (1.75.2)

Post by Commander McLane »

During testing of the subentity problem discussed here I came across something which seems to be an Oolite bug.

If I buy a ship with subentities in the shipyard, not all subentities are actually present on the ship. Only after buying a maintenance overhaul (which is offered immetiately) they actually appear.

So far I have tested with the ship mentioned in the linked-to thread, a Fer-de-Lance 3G with turrets. In a shipyard with three of these ships for sale, for all of them only a maintenance overhaul got me the turrets.

I also tested with a DW-Cobra, which has lots and lots of subentities. Buying the ship and launching, most of the subentities were there, but it has so many that I'm not actually sure whether I had all of them. Anyway, also in this case a maintenance overhaul showed up immediately after buying, and I think that after taking it there were some more subentities on the ship.

Could it be that buying a new ship doesn't set the subEntities-property (or the underlying code property) to its correct maximum content?
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: buying ships with subentities (1.75.2)

Post by Commander McLane »

Some confirmation:

I bought another Fer-de-Lance 3G:

Code: Select all

> PS.subEntityCapacity
2
> PS.subEntities
[]
Then I bought another DW-Cobra:

Code: Select all

> PS.subEntityCapacity
21
> PS.subEntities.length
19
> PS.subEntities
[[Ship "booster guard" position: (0, 0, 0) (subentity)], [Ship "right vent" position: (0, 0, 0) (subentity)], [Ship "left vent" position: (0, 0, 0) (subentity)], [Ship "sensor" position: (-8, 0, 0) (subentity)], [Ship "sensor" position: (8, 0, 0) (subentity)], [Ship "sensor" position: (-10, 0, 0) (subentity)], [Ship "sensor" position: (10, 0, 0) (subentity)], [Ship "left landing gear" position: (0, 0, 0) (subentity)], [Ship "right landing gear" position: (0, 0, 0) (subentity)], [Ship "front landing gear" position: (0, 0, 0) (subentity)], [Ship "landing flat" position: (0, 0, 0) (subentity)], [Ship "landing flat" position: (0, 0, 0) (subentity)], [Ship "landing flap" position: (0, 0, 0) (subentity)], [Ship "antenna" position: (-50, 0, 0) (subentity)], [Ship "antenna" position: (50, 0, 0) (subentity)], [Ship "antenna" position: (0, 0, 0) (subentity)], [Ship "cockpit" position: (0, 0, 0) (subentity)], [Ship "small booster" position: (-38.6, 0, 0) (subentity)], [Ship "small booster" position: (38.6, 0, 0) (subentity)]]
I then took the maintenance overhaul:

Code: Select all

> PS.subEntities
[[Ship "booster" position: (15, 0, 0) (subentity)], [Ship "booster" position: (-15, 0, 0) (subentity)], [Ship "booster guard" position: (0, 0, 0) (subentity)], [Ship "right vent" position: (0, 0, 0) (subentity)], [Ship "left vent" position: (0, 0, 0) (subentity)], [Ship "sensor" position: (-8, 0, 0) (subentity)], [Ship "sensor" position: (8, 0, 0) (subentity)], [Ship "sensor" position: (-10, 0, 0) (subentity)], [Ship "sensor" position: (10, 0, 0) (subentity)], [Ship "left landing gear" position: (0, 0, 0) (subentity)], [Ship "right landing gear" position: (0, 0, 0) (subentity)], [Ship "front landing gear" position: (0, 0, 0) (subentity)], [Ship "landing flat" position: (0, 0, 0) (subentity)], [Ship "landing flat" position: (0, 0, 0) (subentity)], [Ship "landing flap" position: (0, 0, 0) (subentity)], [Ship "antenna" position: (-50, 0, 0) (subentity)], [Ship "antenna" position: (50, 0, 0) (subentity)], [Ship "antenna" position: (0, 0, 0) (subentity)], [Ship "cockpit" position: (0, 0, 0) (subentity)], [Ship "small booster" position: (-38.6, 0, 0) (subentity)], [Ship "small booster" position: (38.6, 0, 0) (subentity)]]
The first two subentities were missing before the overhaul.

I see two possible bug scenarios:

1) the first two subentities of a newly-bought ship are ignored no matter what; or

2) the ship I had before the transaction happened to have 2 subentities in all of these transactions. The first subentities of the new ship, up to subEntityCapacity of the previous ship, are ignored.
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: buying ships with subentities (1.75.2)

Post by Commander McLane »

Commander McLane wrote:
I see two possible bug scenarios:

1) the first two subentities of a newly-bought ship are ignored no matter what; or

2) the ship I had before the transaction happened to have 2 subentities in all of these transactions. The first subentities of the new ship, up to subEntityCapacity of the previous ship, are ignored.
It's the latter. Buying another DW Cobra from the above scenario results in

Code: Select all

> PS.subEntities.length
0
So it seems that the subEntityCapacity of your previous ship messes with the setup of subentities of your new ship.

More confirmation: I bought a ship without subentities, and then another Fer-de-Lance 3G: the turret subentities were there without a maintenance overhaul.

Then I bought another ship with no subentities, and then another DW-Cobra. All 21 subentities were there.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6626
Joined: Wed Feb 28, 2007 7:54 am

Re: buying ships with subentities (1.75.2)

Post by another_commander »

This should be fixed now in r4555.
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: buying ships with subentities (1.75.2)

Post by Commander McLane »

Thanks! :D
Post Reply