Modifying core Oolite v1.76.1 release Constrictor Mission...

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

Moderators: winston, another_commander, Getafix

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: Modifying core Oolite v1.76.1 release Constrictor Missio

Post by Eric Walch »

The best thing for duplicate scripts would be to look at the version number and use the highest. But, that would mean that all the scripts have to be loaded AND compiled first. This probably complicates things. :?
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: Modifying core Oolite v1.76.1 release Constrictor Missio

Post by JensAyton »

Eric Walch wrote:
The best thing for duplicate scripts would be to look at the version number and use the highest. But, that would mean that all the scripts have to be loaded AND compiled first. This probably complicates things. :?
They’d have to be run first, and could have effects. Resetting the world after running them all would work. For consistency you’d also have to load every ship script, as well as world scripts, and ship scripts can expect to be attached to the right sort of ship. On the other hand, you only need to do this for cases where duplicate scripts exist. Obviously you’d then cache the paths for the selected script, so it would only need to be done for a cold cache.

Edit: the “where duplicates exist” bit assumes you won’t see world scripts which have the same internal name but different file names.
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2411
Joined: Mon May 31, 2010 11:11 pm

Re: Modifying core Oolite v1.76.1 release Constrictor Missio

Post by Switeck »

Commander McLane wrote:
Different OXPs trying to mangle with Oolite's defaults and with each other will always be a problem. Basically it's a systemic problem, and there is nothing that can be done about it, except giving incompatibility warnings where possible, and trusting that the player won't install incompatible OXPs.
It's not even obvious in testing that there are conflicts and overwrites by different OXPs! Example:
https://bb.oolite.space/viewtopic.php?f=3&t=8380
Earlier versions of Free Trade Zone OXP was causing the main station to launch escorts which turned pirate because they had a small bounty on them.

Most of my "auto-jumping" OXPs conflict with BackGround Set OXP and Explorer Club which modifies how jumping works and looks.
Commander McLane wrote:
Another example would be Farsun OXP and (a hypothetical) Nearsun OXP (which would put the suns closer to the planet;
A real example is Farsun OXP and Sensible Sun, which says in it:
"Using Farsun and Sensible Sun together will result in stars being 8.75 times further from planets than Oolite's default setting."

If Farsun OXP has a unique script name, (sadly it uses script.js) Sensible Sun could look for it and NOT move the sun further if detected. But programming OXPs to be aware of each other and not step all over each other gets unwieldy beyond 2 potentially conflicting OXPs.
Eric Walch wrote:
The best thing for duplicate scripts would be to look at the version number and use the highest. But, that would mean that all the scripts have to be loaded AND compiled first. This probably complicates things. :?
Perhaps Oolite could report during the load sequence if/when an OXP file replaces/overrides another OXP file or original file? This certainly wouldn't catch everything, but it's still better than the current situation where testing requires knowing a lot about many OXPs to avoid conflicts.
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: Modifying core Oolite v1.76.1 release Constrictor Missio

Post by cim »

Fixing the ordering bug would provide a simple way to override a core script, so that makes sense.
Switeck wrote:
If Farsun OXP has a unique script name, (sadly it uses script.js) Sensible Sun could look for it and NOT move the sun further if detected.
Using script.js is not a problem for this. Farsun will still have a unique this.name, and it's that which matters. However, because Sensible Sun uses plists to set sun distance, rather than script, SS would actually have to add a script the sole purpose of which was to detect FS's script and overwrite its handlers. The notice on the download page is almost as effective and considerably easier.
Switeck wrote:
Perhaps Oolite could report during the load sequence if/when an OXP file replaces/overrides another OXP file or original file?
Most OXP conflicts in practice are about scripts trying to do similar things at the same time, rather than outright clashes over a filename (which usually just means neither OXP was properly namespaced) - there's a three-way potential conflict between HyperCargo, Illegal Goods Tweak and New Cargoes, for instance, which is not an actual clash because all three OXPs have been modified to avoid it.

Actual clashes with two OXPs trying to modify the same named resource tends to happen in plist land, where replace/override is the usual method for OXPs anyway, so warnings would be less helpful.
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2407
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia

Re: Modifying core Oolite v1.76.1 release Constrictor Missio

Post by Wildeblood »

Switeck wrote:
Most of my "auto-jumping" OXPs conflict with BackGround Set OXP and Explorer Club which modifies how jumping works and looks.
Explorers' Club doesn't modify jumping. It should only cause problems for auto-jumping scripts if (a) you have the photo-record feature on, and (b) you've chosen to record a visit as soon as you enter a system, rather than when you dock.
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2411
Joined: Mon May 31, 2010 11:11 pm

Re: Modifying core Oolite v1.76.1 release Constrictor Missio

Post by Switeck »

Wildeblood wrote:
Switeck wrote:
Most of my "auto-jumping" OXPs conflict with BackGround Set OXP and Explorer Club which modifies how jumping works and looks.
Explorers' Club doesn't modify jumping. It should only cause problems for auto-jumping scripts if (a) you have the photo-record feature on, and (b) you've chosen to record a visit as soon as you enter a system, rather than when you dock.
Yes, it's a narrow case when it happens for Explorers' Club. Part of the reason I wasn't the one that spotted it. :P

My point being that it's not a directly obvious conflict in reading both scripts.
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: Modifying core Oolite v1.76.1 release Constrictor Missio

Post by Svengali »

Switeck wrote:
Most of my "auto-jumping" OXPs conflict with BackGround Set OXP and Explorer Club which modifies how jumping works and looks.
Just another reason to take a look at the documentation - [wiki]BGS_Doc[/wiki].
Post Reply