loot / libloot-python

A Python module that wraps libloot.
GNU General Public License v3.0
6 stars 1 forks source link

Update libloot-python to expose ESL qualifications #13

Open Sharlikran opened 4 years ago

Sharlikran commented 4 years ago

I don't know exactly what to put for the AI. The main thing I was requesting was to add the ability to check ESL qualifications and whether or not the ESL flag is valid.

loot_api.check_esl_qualifications(parameter: filename) : returns True if the file meets Bethesda standards for a file to have the ESL flag. Should allow 0x800 to 0xFFF for Fallout 4 and once implemented for Skyrim SE also. : returns True or False loot_api.check_eslexpanded_qualifications(parameter: filename) : alternative check if implemented to check range 0x000 to 0xFFF and a different command for 0x000 to 0xFFF : returns True or False loot_api.is_eslflag_valid(parameter: filename) : Checks to see if the ESL flag is valid, returning true or false loot_api.ismod_creationclub_esl(parameter: filename) : checks if the file extension is .esl and if both the ESM and ESL falg is set. This it mostly for mod sorting reasons as they are force loaded. : returns True or False

I don't know if loot or libloot has other things it checks that might be useful.

Ortham commented 4 years ago

What's the difference between check_esl_qualifications and is_eslflag_valid? I.e. what does 'valid' mean?

Also, shouldn't ismod_creationclub_esl only return true if the given plugin is in the game's *.ccc file?

Sharlikran commented 4 years ago

What's the difference between check_esl_qualifications and is_eslflag_valid? I.e. what does 'valid' mean?

Also, shouldn't ismod_creationclub_esl only return true if the given plugin is in the game's *.ccc file?

I see your point. I can appreciate eliminating redundancy. However, these are for different sections of Wrye Bash.

Referencing the xedit docs

So that's my thinking as I am requesting these things. Most of it can be handled by Wrye Bash but what Wrye bash cannot do currently is parse the plugin like xEdit and really see if the file qualifies to have an ESL flag. Vortex uses libloot and some type of wrapper so I want to take advantage of that as well. Simply because getting wrye bash to check for esl qualifications would take a rewrite of a lot of code.

My implementation is a hack of the old method of checking for new records when Wrye Bash checks to see if a file can be merged into the bash patch. Because of that it is dependent on having the plugin fully decoded. Fallout 4 does not have every record implemented because I'm way behind on that. So Fallout 4 can't check at all. Skyrim has a few records that are not decoded so any plugin that has records that remain undefined in Wrye Bash return a warning.

The changes will help get past some of the restrictions I am facing.

Ortham commented 4 years ago

libloot doesn't have access to most of that detail, so I can only expose:

libloot doesn't know if a light master has its flag set or not, so if that matters for you, you'll have to get that info some other way. It also doesn't know anything about which plugins are Creation Club plugins, but at least Wrye Bash could trivially parse the .ccc file to get them.

Ortham commented 4 years ago

OK, I've exposed the relevant methods in 7ccfe6d7f4e10705993eeca1cb3348a8d23603a5, you can test it out using this snapshot build.