Modifying core Oolite v1.76.1 release Constrictor Mission...
Moderators: winston, another_commander, Getafix
- Eric Walch
- 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
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.
UPS-Courier & DeepSpacePirates & others at the box and some older versions
- JensAyton
- 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
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.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. :?
Edit: the “where duplicates exist” bit assumes you won’t see world scripts which have the same internal name but different file names.
E-mail: [email protected]
Re: Modifying core Oolite v1.76.1 release Constrictor Missio
It's not even obvious in testing that there are conflicts and overwrites by different OXPs! Example: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.
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.
A real example is Farsun OXP and Sensible Sun, which says in it:Commander McLane wrote:Another example would be Farsun OXP and (a hypothetical) Nearsun OXP (which would put the suns closer to the planet;
"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.
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.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.
Re: Modifying core Oolite v1.76.1 release Constrictor Missio
Fixing the ordering bug would provide a simple way to override a core script, so that makes sense.
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.
Using script.js is not a problem for this. Farsun will still have a uniqueSwiteck 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.
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.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.Switeck wrote:Perhaps Oolite could report during the load sequence if/when an OXP file replaces/overrides another OXP file or original file?
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.
- Wildeblood
- ---- E L I T E ----
- Posts: 2453
- Joined: Sat Jun 11, 2011 6:07 am
- Location: Western Australia
- Contact:
Re: Modifying core Oolite v1.76.1 release Constrictor Missio
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 wrote:Most of my "auto-jumping" OXPs conflict with BackGround Set OXP and Explorer Club which modifies how jumping works and looks.
Re: Modifying core Oolite v1.76.1 release Constrictor Missio
Yes, it's a narrow case when it happens for Explorers' Club. Part of the reason I wasn't the one that spotted it.Wildeblood wrote: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 wrote:Most of my "auto-jumping" OXPs conflict with BackGround Set OXP and Explorer Club which modifies how jumping works and looks.
My point being that it's not a directly obvious conflict in reading both scripts.
Re: Modifying core Oolite v1.76.1 release Constrictor Missio
Just another reason to take a look at the documentation - [wiki]BGS_Doc[/wiki].Switeck wrote:Most of my "auto-jumping" OXPs conflict with BackGround Set OXP and Explorer Club which modifies how jumping works and looks.