Depreciated equipment not supported in trunk

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

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
Stormrider
Deadly
Deadly
Posts: 211
Joined: Sat Jan 25, 2014 2:35 am
Location: Skiing the Rice Ridge burn

Depreciated equipment not supported in trunk

Post by Stormrider » Wed Sep 17, 2014 3:59 pm

Is anyone else seeing equipment that shouldn't be showing up in the ship outfitting F3 screen? I have equipment appearing that is dependent on the depreciated 'conditions' command in the equipment.plist to bar it. If I use the 'conditions_script' command with a simple script it works fine.

edit: at least I can stop Eq from showing up, the script below does not seem to allow the equipment even on the station it refers to.

This actually makes it easy for oxp authors to see what Eq may need updated to script, but would not be so cool for the few who play the trunk version. If you don't have this issue I wouldn't be surprised because around the same time I updated trunk to the latest version I tried to edit ./GNUDefaults file and I very well may have had oolite running at the time without realizing it. :oops:

I know I did something wrong because for a while in 1.80 I was seeing 1.81 effects and issues with the station GUIs. I also had the log report that there was no dictionary in the GNUDefaults. I have since uninstalled and reinstalled both 1.80 and 1.81. I have no more issues with 1.80 but I am still seeing the depreciated equipment in 1.81. I have the enforce-oxp-standards key set to 0. If I set it to 3 I don't think oolite-trunk will even start with all my oxps.

I must say that I am very happy with the new market system I have already created a few custom goods and everything seems to working well with that. Thanks! :D

I have updated my equipment with a conditions script like this:

Code: Select all

"use strict"

this.name = "Xarth-Eq-conditions";

this.XarthEq = ["EQ_XARTH_BOT", "EQ_XARTH_BEACON", "EQ_XARTH_DOCK_KEY", "EQ_XARTH_MYSTEQ_I", "EQ_XARTH_PROBE", "EQ_XARTH_ROSE_KEY", "EQ_XARTH_SCHEM_I", "EQ_XARTH_TEST"];

this.allowAwardEquipment = function(equipment, ship, context) {

	if (equipment == this.XarthEq)
	{
		// Xarth Eq only available from a site
		if (context == "purchase" && player.ship.dockedStation.name != "Xarth Qui'sut Na Site Lvl I")
		{
			return false;
		} else {

			return true;
		}
	}
}}
Buggy ship outfit GUI 1.80:

Image
Realize collective conscious creation

User avatar
Norby
---- E L I T E ----
---- E L I T E ----
Posts: 2543
Joined: Mon May 20, 2013 9:53 pm
Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
Contact:

Re: Depreciated equipment not supported in trunk

Post by Norby » Wed Sep 17, 2014 6:44 pm

Stormrider wrote:

Code: Select all

	if (equipment == this.XarthEq)
A better (working) way:

Code: Select all

	if ( this.XarthEq.indexOf(equipment) > -1 )

User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4018
Joined: Fri Nov 11, 2011 6:19 pm

Re: Depreciated equipment not supported in trunk

Post by cim » Wed Sep 17, 2014 7:19 pm

Stormrider wrote: I have equipment appearing that is dependent on the depreciated 'conditions' command in the equipment.plist to bar it.
Thanks - should be fixed in tonight's build.

User avatar
Stormrider
Deadly
Deadly
Posts: 211
Joined: Sat Jan 25, 2014 2:35 am
Location: Skiing the Rice Ridge burn

Re: Depreciated equipment not supported in trunk

Post by Stormrider » Wed Sep 17, 2014 7:35 pm

cim wrote:Thanks - should be fixed in tonight's build.
Awesome! Thank you. :)
Norby wrote:A better (working) way:

Code: Select all

 if ( this.XarthEq.indexOf(equipment) > -1 )
Thanks Norby its certainly better but still no go...can't get it to show up at my oxp station even with a simple:

Code: Select all

if (equipment == "EQ_XARTH_TEST")
any ideas?
Realize collective conscious creation

User avatar
Norby
---- E L I T E ----
---- E L I T E ----
Posts: 2543
Joined: Mon May 20, 2013 9:53 pm
Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
Contact:

Re: Depreciated equipment not supported in trunk

Post by Norby » Wed Sep 17, 2014 7:52 pm

Too much } at the end.

User avatar
Stormrider
Deadly
Deadly
Posts: 211
Joined: Sat Jan 25, 2014 2:35 am
Location: Skiing the Rice Ridge burn

Re: Depreciated equipment not supported in trunk

Post by Stormrider » Wed Sep 17, 2014 7:58 pm

Norby wrote:Too much } at the end.
Yep it works great now. Thank you very much :D
Realize collective conscious creation

User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4018
Joined: Fri Nov 11, 2011 6:19 pm

Re: Depreciated equipment not supported in trunk

Post by cim » Wed Sep 17, 2014 7:59 pm

Norby wrote:
Stormrider wrote:

Code: Select all

	if (equipment == this.XarthEq)
A better (working) way:

Code: Select all

	if ( this.XarthEq.indexOf(equipment) > -1 )
Thinking about this a bit more: a further simplification is to remove this test entirely - you're only going to put this condition script on those equipment items in the first place, so it doesn't need to test again at this stage if it's one of those equipment items.

User avatar
Stormrider
Deadly
Deadly
Posts: 211
Joined: Sat Jan 25, 2014 2:35 am
Location: Skiing the Rice Ridge burn

Re: Depreciated equipment not supported in trunk

Post by Stormrider » Wed Sep 17, 2014 8:40 pm

cim wrote:Thinking about this a bit more: a further simplification is to remove this test entirely - you're only going to put this condition script on those equipment items in the first place, so it doesn't need to test again at this stage if it's one of those equipment items.
You are right, of course. :D Thanks cim its only a few lines of code now:

Code: Select all

this.allowAwardEquipment = function(equipment, ship, context) {
	if (context == "purchase" && player.ship.dockedStation.name === "Xarth Qui'sut Na Site Lvl I")
	{
		return true;
	} else {
		return false;
	}
}
Realize collective conscious creation

Post Reply