Rocketman wrote:Wildeblood wrote:Most of the rest of the configuration is hidden. That's just the way it is.
Is it result of development policy or simply does not implemented yet? Why not to make global object which provides read-only access to all game configs? I think it would give OXP makers way to improove compatibility of their projects. And would be useful tool in general.
As I said already:
Commander McLane wrote:Indeed, most of the properties defined in the various plists are exposed to the JS-scripting engine. There are a few exceptions, mainly because something hasn't been implemented yet. Unfortunately, commodities.plist is among these exceptions.
As you see, I disagree with Wildeblood here. While he claims that most of the configuration is hidden, I say that most of it is exposed, and mostly only those parts which haven't been implemented yet are not.
This has historical reasons, as well. The JS-scripting engine is a relatively recent addition to Oolite. The previous stable version (1.65) only relied on property lists for setting up the configuration, and for a (very limited!) amount of scripting. Over the course of the last few years and the last 10 versions of the game (starting with 1.67; 1.66 was omitted as a number by accident) the JS-scripting engine was introduced and has matured. During the process of converting from plist-scripting (also referred to as legacy-scripting) to JS-scripting more and more of the underlying configuration had to be made accessible for the JS-scripting engine. However, this must be understood as an ongoing process. The game is by no means at the end of its development.
As it happens, nobody took it on yet to convert the price-setting mechanism to JS, although among those who dived into the existing price-setting mechanism there is sort of a consensus that it is indeed rather clumsy. But a fundamental change to this part of the inner workings of Oolite hasn't been high up on the priority list of the developers yet (probably it hasn't been anywhere on this list), whose resources are of course limited.
Having said that, I personally think that Oolite's general approach to configuration is quite sensible: define those things that have to be said and done at the moment the game starts, and need to be fixed after this point, in property lists, because property lists are well suited for that purpose. And expose those properties that may need to be changed—or need to be known—by a script during gameplay to the JS-engine.
EDIT: our ex-lead developer has stepped in and given a short and concise explanation just above.