Oolite Bulletins

For information and discussion about Oolite.
It is currently Fri Jul 28, 2017 2:53 pm

All times are UTC




Post new topic  Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Wed Nov 16, 2016 7:16 am 
Offline
Average
Average

Joined: Thu Oct 27, 2016 7:38 pm
Posts: 15
Hi dev team,

From the information on the Wiki: if multiple world scripts of the same name are loaded one is arbitrary chosen and the rest are discarded. Also, this.version is copied from manifest.plist in 1.79+

This seems a bit silly to me. I have many "common" functions in my OXPs which I am keeping in a single script. If I make a "my-oxp-utilities" script which one OXP uses, then release another OXP with an extended (but backwards compatible) version of "my-oxp-utilities", I would have no choice but to give it a new name, since I can't be sure Oolite will use the more recent version instead of the older one.

Surely it makes more sense to merge the duplicate copies based upon a higher version number? The onus, of course, being on the author to ensure backwards compatibility with previous versions. To make life even easier, you could perhaps use a new property. Ie: this.internalVersion or this.revision, which must be a Number or else it is assigned Number.MIN_VALUE. It would at least give us some more compile-time code reuse :)

alaric.


Top
   
PostPosted: Thu Nov 17, 2016 8:51 pm 
Offline
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
User avatar

Joined: Fri Nov 11, 2011 6:19 pm
Posts: 4007
The "choose one and discard" is...
1) A warning, to all developers, to remember to namespace their scripts
2) A way to allow OXP developers to override core game world scripts

If you have a script to share between OXPs, then package that script up as an OXP in its own right, and make the other OXPs depend on it. Then you only need one copy of that script at all, and both OXPs (if installed) can use it, as can other OXP developers. You can even set versioned dependencies, if one OXP requires a specific version but the other is less picky.

(See OXPs such as Library, Cabal Common Library, Ship Storage Helper)

_________________
OXPs: [EliteWiki] New Cargoes, [EliteWiki] Skilled NPCs, [EliteWiki] Curse of the Black Sunspot, and more


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
Powered by phpBB® Forum Software © phpBB Limited