Comments (3)
This seems like a good idea. People face a similar problem when merging plugins, and I think the two problems can be solved with a more general form of aliasing. Here's what I think that could look like:
Add an alias
key to the plugin metadata structure that takes a list of plugin names that are alias targets, e.g.
- name: Y.esp
group: Y
req: [A.esp]
- name: Z.esp
group: Z
req: [B.esp]
- name: X.esp
group: X
alias: [Y.esp, Z.esp]
req: [C.esp]
# Other metadata for X.esp
This means that when getting the metadata for X.esp, LOOT will see that it is an alias of Y.esp and Z.esp. It will first look up the metadata for Y.esp, then for Z.esp, and merge Z.esp's metadata on top of Y.esp's metadata, so the metadata is
- name: Z.esp
group: Z
req: [A.esp, B.esp]
it then merges the metadata for X.esp on top of this, so the metadata becomes
- name: X.esp
group: X
req: [A.esp, B.esp, C.esp]
LOOT uses the normal process for getting metadata for aliases, so it will match regex entries. I.e. don't use a regex plugin metadata entry's name string as an alias, use a plugin name that matches that regex entry.
The alias targets don't need to match any metadata entries. If an alias target doesn't have any metadata, merging has no effect.
The order of alias targets matters, it is the order in which metadata are merged.
It's an error to target an aliased plugin, e.g.
- name: X.esp
alias: [Y.esp]
- name: Y.esp
alias: [Z.esp]
This is because allowing nested aliasing introduces the potential for cycles, and dealing with that adds complexity. Errors due to cycles can also occur unexpectedly due to the potential distance in the alias chain between the plugin the user is editing metadata for and the plugin that already targets it. I don't think the flexibility of nested aliasing is worth the costs.
To guard against nested aliasing, when setting metadata for a plugin that includes an alias, LOOT will need to check that the alias targets are not aliased, and also check that the current plugin is not an alias target of any other metadata.
from libloot.
The current proposal only works in one direction. SkyUI_SE.esl
will treat itself as identical to SkyUI_SE.esp
, but other masterlist entries that reference SkyUI_SE.esp
won't be aware of SkyUI_SE.esl
. In this particular example &reqSkyUI
will still be displayed.
type: warn
content: 'SkyUI_SE.esp is not active in your load order. [SkyUI SE](https://www.nexusmods.com/skyrimspecialedition/mods/12604) is required for this mod to be fully functional.'
condition: 'not active("SkyUI_SE.esp")'
has to be changed to
type: warn
content: 'SkyUI_SE.esp is not active in your load order. [SkyUI SE](https://www.nexusmods.com/skyrimspecialedition/mods/12604) is required for this mod to be fully functional.'
condition: 'not active("SkyUI_SE.esp") and not active("SkyUI_SE.esl")'
which is not as simple as just merging some metadata. Actually for full compliance the content should be updated too, i.e. something like "SkyUI_SE.esp (that is an alias target for SkyUI_SE.esl) is not active in your load order. [...]".
after
, req
and inc
entries have the same problem. For example A must be loaded after B and B is merged into merge M. M can inherit metadata from B, but A isn't aware of M. It's now possible that A can load before M even though it musn't.
from libloot.
I think that's out of scope for this feature, two-way aliasing is way more complicated, and as you've pointed out, solves different problems.
from libloot.
Related Issues (20)
- libloot fails to find master on Linux because of case-sensitivity HOT 6
- Replace std::set usage in public API with std::vector HOT 1
- Consider introducing a new API type to represent case-insensitive filenames HOT 1
- Plugin::LoadsArchive() logic doesn't account for more recent games HOT 1
- File::GetDisplayName() falls back to file name HOT 2
- Error message for incorrect use of % HOT 1
- Cyclic interaction detected between ccbgssse002-exoticarrows.esl and ccbgssse002-exoticarrows.esl HOT 7
- Allow matching locale codes against just language code HOT 3
- Update location.rst
- Update localised_content.rst
- Add support for a "detail" property on File objects HOT 1
- Add API function to serialise a given plugin's metadata HOT 1
- Cache plugin name regex objects HOT 2
- Document support for not-expressions HOT 1
- libloot release archive naming HOT 2
- Migrate from using boost::format to std::format (via fmt) HOT 1
- Rework how group edges are added HOT 5
- Add GameInterface::GetType() and GameInterface::GetDatabase() const methods HOT 1
- Use plugins' masters to inform sorting HOT 2
- Allow creation of game handles with local paths that do not exist HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libloot.