1. VALUE-scope
-- Applied to individual values
-- Units specified either before or after each individual value
2. PROPERTY-scope
-- Applied to all values of a given value-domain for a single property. (which may extend over 1 or more lines)
-- Units specified either before or after the Property Name
3. FILE-scope
-- Applied to all values of a given value-domain in a file.
-- Would require named-pairs comprising value-domain and unit specification at beginning of the file
4. CELESTIA-scope
-- Applied to alll values of a given value-domain in all files.
-- Would require named-pairs comprising value-domain and unit specification in celestia.cfg
Now who's making the parser's life difficult!?!
Now serious, that property scope isn't going to help.
Please don't add such a PROPERTY-scope thing.
If it, and it will someday, mess up stuff. Debugging will be very difficult, hard due to how addons are made.
When addon-writers are writing, they are writing files.
Don't forget their workflow.
In this respect, what if there are two conflicting PROPERTY-scope in different files?
Doing file-specific scope is going to be much more robust.
It may be more difficult to do, but it's going to be worth it.
The idea of either (pre/post)style was too much for the parser, I admit that.
But trying to do the PROPERTY-scope way is going to have major debugging issues for addon writers.
Please don't do 2 but 1, 3 and 4.
The file-scope thing would be excellent.
Remember, the parser is
parsing files, not addons.
About values, with or without units.
There are actually two kind of stuff you can find in a file: values with units and values without.
This is something that should be taking into consideration.
Difference for all scopes. Celestia's default would be to not overwrite only fill in values without units.
As a default, already specified units shouldn't be overwritten.
But in some situations it would be desirable. (e.g. Artistic addons come to my mind, such as the solar system with the really big planets
, collision danger
.)
Something to say: overwrite everything, also units that are already specified, would be handy to have.
With something extra that's easy recognisable of what it does:
Code: Select all
Planet{
Color [ 0.85<r overwrite> 0.85<g overwrite> 1.0<b overwrite> ]
...
}
Or
Code: Select all
Planet{
Color [ 0.85<r> <overwrite> 0.85<g> <overwrite> 1.0<b> <overwrite> ]
...
}
Thus for all Planets declarated in that file.
Better flexible in the beginning than patchy all way through.
Why not let addon-makers specify addon parameters?
Something like this:
new addon unit parameter = m
phys quantity = length
calculateTokm = 0.001
I very much like the idea of unit-inheritance and it could be a big time saver for addon developers.
And please don't do the thing quoted under this:
The tricky part with this scheme is determining which sub-properties inherit which units of the parent. ie. Imagine the implications of the following:
Code: Select all
Atmosphere <rgb> <km> {
...
}
This may be a show-stopper for the idea of unit-inheritance, because it will require prior knowledge of the valid value-domains of each of the sub-properties. ie. Some are distances (km, m, etc), others are colors (rgb or ratio), yet others relate to degree of absorption/reflectance.
If the file scope isn't enough.
e.g. an addon maker wants to have one unit file for his whole addon with the specifications in.
Why not allow directories to play a role.
Starting with some definitions in a directory and some stuff in a sub-directory.
Then with some special keyword, the definitions could cover the things in the subdirectory' s.
e.g.: a subdirectory parameter: <subdirectory>
If two are conflicting, use Celestia's default units.
This allows also for hierarchical addons.
Since the parameters don't go up in the tree, but only overwrite down.
Reasonably easy for a parser to follow because it is actually parsing files, addon after addon.