I have a working prototype of a proposed modification for X-Plane 10.40: dataref-driven library regions.
The idea is simple: you can define a region in a library pack, and X-Plane will only load those art assets when datarefs written into the library.txt file evaluate to true.
One of the main usages for this is to implement seasonal or winter scenery add-ons that don't require rebooting the sim to take effect. Right now if you want to change the look of the scenery you either:
- Write a script to replace files inside X-Plane. This makes updating X-Plane tricky, but it lets you mod anything. Of course, some of those mods may not work in future versions.
- Create a custom library pack that replaces library paths for the default art. This requires reboot to take effect but doesn't affect updates and is stable.
With this extension, method 2 can be done without a reboot. The custom library art assets are put in a region and the region is set to only be available when certain datarefs are set to certain values.
Changes to the datarefs require a scenery re-load to take effect; that's the cost of being able to fully change the art asset in the library. This does allow for a lot of flexibility, however - whole objects can be added or removed based on the date, for example. For seasonal use, if the user can decide on a season before flying, the reload should not be a facotr.
Textures vs Library Paths
The original proposal was to allow textures to be swapped by dataref. I changed to library paths because a number of the existing seasonal/winter add-ons for X-Plane change properties of art assets other than the textures; for example, they change specularity values or add normal maps that were not otherwise present. Only changing the library art asset allows for complete customization.
The new syntax is a single library.txt line:
REGION_DREF <dataref> <comparison> <value>
REGION_DREF myplugin/use_snow == 1.0
Datarefs can come from the sim or a plugin; all six conditionals (< <= == != > >=) are available. If more than one REGION_DREF line is present, all must evaluate to true to use the region.
Request For Comments
Please use the comments section to comment on this particular proposal. I'm going to be a bit fascist and nuke all off-topic comments. This is about a specific proposed feature, not a general news update.
I have working code for this; if you'd like to try a developer build, please email me.