EQ_MILITARY_SCANNER_FILTER - Oolite bug

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

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
Lestradae
---- E L I T E ----
---- E L I T E ----
Posts: 3095
Joined: Tue Apr 17, 2007 10:30 pm
Location: Vienna, Austria

EQ_MILITARY_SCANNER_FILTER - Oolite bug

Post by Lestradae »

@Devs:

It's just cosmetics, but there is a little equipment screen bug with the EQ_MILITARY_SCANNER_FILTER aka Military Scanner Filtering.

While the item completely works as intended ingame for both players and NPCs, it is shown twice on the F5 equipment screen.

It can be sold and then also both entries disappear.

I assume it is easy to change this and hope it can be done before Oolite V1.73 is officially released.

Thanks in advance

L

PS: Please don't suggest I repost this at Berlios, as I don't have access to my passwords, emails etc. yet due to the untimely demise of my laptop ...
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: EQ_MILITARY_SCANNER_FILTER - Oolite bug

Post by Eric Walch »

Lestradae wrote:
@Devs:

It's just cosmetics, but there is a little equipment screen bug with the EQ_MILITARY_SCANNER_FILTER aka Military Scanner Filtering.

While the item completely works as intended ingame for both players and NPCs, it is shown twice on the F5 equipment screen.
I think it is an oxp bug and will disappear when you start up a clean oolite. But I don't think this is new in 1.73 as equipment handling has never changed. Equipment has always been defined as array, not a directory, and duplicate defined equipment in arrays don't overwrite each other but will be there both.
User avatar
Lestradae
---- E L I T E ----
---- E L I T E ----
Posts: 3095
Joined: Tue Apr 17, 2007 10:30 pm
Location: Vienna, Austria

..

Post by Lestradae »

Hi Eric,

it's not an oxp bug. Have a look at the little test oxp that I wrote:

http://www.box.net/shared/static/lz6cxx7bv8.zip

It sets the TL and price of the MSF so low that you can buy it as a Jameson at Lave and contains only one EQ_ entry for it.

Try it out under the "1.73" trunk and as the only oxp in the AddOns folder - you'll see that you are getting two for the price of one.

Cheers

L
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: ..

Post by Eric Walch »

Lestradae wrote:
Hi Eric,

it's not an oxp bug. Have a look at the little test oxp that I wrote:
It is, as you reuse the name of the equipment. As I said: oolite is not designed to overwrite equipment. Only stuff that is defined as a directory with a KEY name, overwrites other stuff with the same name. You now defined just a second equipment with an existing name.
Even when you would write code to remove items with duplicate names, you never will know which version you will remove, the old or new one as the system keeps no track of this.

I am sure you have always had two of them but only one of them was listed as the original inside oolite was defined with a level so you never saw it. I assume you now you have redefined both to be visible.
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, what Eric said. The equipment plist is handled differently to say shipdata.plist, and changing the way it works could very likely break compatibility with 1.65...

I'm not by the oolite computer, but looking at the wiki it looks to me that
if you want to change the tech level of the unsupported MSF to tech level 3, all you need to do in javascript (either from the console, or from inside inside the main js script)

Code: Select all

missionVariables.TL_FOR_EQ_MILITARY_SCANNER_FILTER=2;
or using legacy script:

Code: Select all

set: mission_TL_FOR_EQ_MILITARY_SCANNER_FILTER 2
doing that won't create any duplicate!
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
Lestradae
---- E L I T E ----
---- E L I T E ----
Posts: 3095
Joined: Tue Apr 17, 2007 10:30 pm
Location: Vienna, Austria

..

Post by Lestradae »

If it is as you say, why then is the same thing (making core game equipment available with changed TL, price & description) working flawlessly with the MAS'C, the NEU and the CD, to name just a few?

I do exactly the same thing with these, and they show up only once on the equipment screen!

Furthermore, if the Military Scanner Filtering is renamed, one of the two equipment screen entries shows the changed name and one the original name. This doesn't happen if you for example rename the NEU.

:?

L
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: ..

Post by Eric Walch »

Lestradae wrote:
I do exactly the same thing with these, and they show up only once on the equipment screen!
Because with those the unmodified version is hidden by default so you don't see there are always two present. When I load your example file above, I only get one version to see in trunk. When you have two in your equipment screen, you either made the internal one also visible or even added a third copy somewhere.
User avatar
Lestradae
---- E L I T E ----
---- E L I T E ----
Posts: 3095
Joined: Tue Apr 17, 2007 10:30 pm
Location: Vienna, Austria

..

Post by Lestradae »

Eric, if you use my little test oxp up there under trunk, do you have only one singular Military Scanner Filtering on your equipment screen or two?
When you have two in your equipment screen, you either made the internal one also visible or even added a third copy somewhere.
How? I ask because I now tested this exact same file under trunk as the single oxp in the AddOns folder (so no other oxp can create a problem), even svn'ed up to RVN 2270 to be absolutely sure and the Military Scanner Filtering still appears twice on my equipment screen.

Still :?

L
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6631
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

It appears twice on my system with just Lestradae's test OXP on. In my opinion, this is an Oolite bug. The equipment plist is handled in a very special way, so that it merges entries with equal EQ_* keys in a way similar to dictionaries and this was initially done in order to avoid repetitions of standard equipment appearing in localized equipment lists.

The problem here occurs because the Military Scanner Filter is the last item in the original equipment.plist. Lestradae, if you add one more dummy entry in the standard equipment.plist, you will see that the problem goes away. However, fixing this properly requires accessing and modifying a very complicated piece of code and I don't think I want to dive in it, at least until 1.73 comes out.

While we are at it, I just wanted to say that making assumptions about the simplicity of fixes on code you know nothing about results in kittens dying, so please don't do it.
User avatar
Lestradae
---- E L I T E ----
---- E L I T E ----
Posts: 3095
Joined: Tue Apr 17, 2007 10:30 pm
Location: Vienna, Austria

..

Post by Lestradae »

Hi A_C!
The problem here occurs because the Military Scanner Filter is the last item in the original equipment.plist. Lestradae, if you add one more dummy entry in the standard equipment.plist, you will see that the problem goes away.
I see. Well, I don't want to "patch" the core game but perhaps you could simply insert a standard dummy EQ_ item that can never be bought after the previously last item in the core's equipment.plist for the next revision?

That solves the problem! (I can entirely live with it if it doesn't get solved at all. But the above solution, could it be that it might be easier than digging through code?)
making assumptions about the simplicity of fixes on code you know nothing about results in kittens dying
:shock:
so please don't do it
OK :wink:

What do you think of my above solution of putting a dummy item last into standard core Oolite's equipment.plist? That should fix the problem without kittens having to reincarnate, shouldn't it?

8)

L
Post Reply