Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metadata for SimplyKnock.esp uses improper condition #3005

Open
ALParsons opened this issue Jan 29, 2025 · 2 comments
Open

Metadata for SimplyKnock.esp uses improper condition #3005

ALParsons opened this issue Jan 29, 2025 · 2 comments

Comments

@ALParsons
Copy link

The condition operator for SimplyKnock.esp's PapyrusUtil dependency is a checksum rather than a version check. This throws errors on later versions of the PapyrusUtil .dll file, contradictory to the error message given. Unfortunately, the .dll file does not contain version information, so we can't do a version check.

I read through the condition types list in the LOOT docs and none of the available conditions are suitable for this particular file.

One option I would use if supported would be a pseudo check that the date modified property on the file is greater than the date value specified in the condition (i.e. the date for the oldest supported version of a given file). This would require creating a condition for 'filemodified' or 'datemodified' which does not currently exist (more work).

Another option may be to convert the error into a warning (if the file exists), with a message to say to ensure it is at least the supported version - in this case v3.9 or greater. Only throw an error if the file does not exist (less work).

Current YAML for the SimplyKnock.esp:

- name: 'SimplyKnock.esp'
    url:
      - link: 'https://www.nexusmods.com/skyrimspecialedition/mods/14098/'
        name: 'Simply Knock'
    req: [ *SKSE ]
    msg:
      - <<: *alsoUseX
        subs: [ '[Simply Knock - Tower Stone Fix](https://www.nexusmods.com/skyrimspecialedition/mods/41590/)' ]
        condition: 'not active("Simply Knock - Tower Stone Fix.esp") and not active("Simply DAK Knock Peek.esp")'
      - <<: *patchUpdateAvailable
        type: error
        subs: [ '[Simply Knock SKSE64 DLL](https://www.nexusmods.com/skyrimspecialedition/mods/24297/) **OR** [Simply Knock DLL for AE](https://www.nexusmods.com/skyrimspecialedition/mods/77283/)' ]
        condition: 'version("../skse64_loader.exe", "0.2.0.7", >) and checksum("SKSE/Plugins/SimplyKnock.dll", A442045A)'
      - <<: *requiresMCM
        type: error
      - <<: *requiresX
        type: error
        subs: [ '[PapyrusUtil v3.9+](https://www.nexusmods.com/skyrimspecialedition/mods/13048/)' ]
        condition: 'checksum("SKSE/Plugins/PapyrusUtil.dll", 9BACEE98)'
    clean:
      - crc: 0x95029A30
        util: 'SSEEdit v4.0.4c'

Proposed YAML for option 2 (untested):

- name: 'SimplyKnock.esp'
    url:
      - link: 'https://www.nexusmods.com/skyrimspecialedition/mods/14098/'
        name: 'Simply Knock'
    req: [ *SKSE ]
    msg:
      - <<: *alsoUseX
        subs: [ '[Simply Knock - Tower Stone Fix](https://www.nexusmods.com/skyrimspecialedition/mods/41590/)' ]
        condition: 'not active("Simply Knock - Tower Stone Fix.esp") and not active("Simply DAK Knock Peek.esp")'
      - <<: *patchUpdateAvailable
        type: error
        subs: [ '[Simply Knock SKSE64 DLL](https://www.nexusmods.com/skyrimspecialedition/mods/24297/) **OR** [Simply Knock DLL for AE](https://www.nexusmods.com/skyrimspecialedition/mods/77283/)' ]
        condition: 'version("../skse64_loader.exe", "0.2.0.7", >) and checksum("SKSE/Plugins/SimplyKnock.dll", A442045A)'
      - <<: *requiresMCM
        type: error
      - <<: *requiresX
        type: error
        subs: [ '[PapyrusUtil v3.9+](https://www.nexusmods.com/skyrimspecialedition/mods/13048/)' ]
        condition: 'not file("SKSE/Plugins/PapyrusUtil.dll")'
      - <<: *requiresX
        type: Warning
        subs: [ '[PapyrusUtil v3.9+](https://www.nexusmods.com/skyrimspecialedition/mods/13048/). Ensure the PapyrusUtil mod is version 3.9 or greater.' ]
        condition: 'not checksum("SKSE/Plugins/PapyrusUtil.dll", 9BACEE98) and file("SKSE/Plugins/PapyrusUtil.dll")'
    clean:
      - crc: 0x95029A30
        util: 'SSEEdit v4.0.4c'

Thanks for consideration.

@pStyl3
Copy link
Member

pStyl3 commented Jan 31, 2025

The original PR that added the relevant data was this one. sibir's reasoning back then was Outdated version of PapyrusUtil included with mod., so by checking for the old checksum, the requiresX message (Requires: {0}) would lead the user to the PapyrusUtil page, if the checksum would indeed turn out to be old.

Therefore, doing something like not checksum(veryoldchecksum) would almost always turn out to be true nowadays, which would make this part a bit superfluous. Also, the type of requiresX, as can be seen in our prelude, is already warn (there's say, warn and error) so there's no need to once again declare it as a message of type warn within the masterlist (declaring it as a type error however would make sense).

All that being said, we can change the condition to simply say not file("SKSE/Plugins/PapyrusUtil.dll"), as you have suggested. I think that should suffice.

@ALParsons
Copy link
Author

Thank you for the detail and more info about the prelude so I better understand the tooling. Sounds good to me :)

My proposition then (given any instance of PapyrusUtil will almost certainly be a newer version) would be:

  • not file = error
  • file = say

Result:

- name: 'SimplyKnock.esp'
    url:
      - link: 'https://www.nexusmods.com/skyrimspecialedition/mods/14098/'
        name: 'Simply Knock'
    req: [ *SKSE ]
    msg:
      - <<: *alsoUseX
        subs: [ '[Simply Knock - Tower Stone Fix](https://www.nexusmods.com/skyrimspecialedition/mods/41590/)' ]
        condition: 'not active("Simply Knock - Tower Stone Fix.esp") and not active("Simply DAK Knock Peek.esp")'
      - <<: *patchUpdateAvailable
        type: error
        subs: [ '[Simply Knock SKSE64 DLL](https://www.nexusmods.com/skyrimspecialedition/mods/24297/) **OR** [Simply Knock DLL for AE](https://www.nexusmods.com/skyrimspecialedition/mods/77283/)' ]
        condition: 'version("../skse64_loader.exe", "0.2.0.7", >) and checksum("SKSE/Plugins/SimplyKnock.dll", A442045A)'
      - <<: *requiresMCM
        type: error
      - <<: *requiresX
        type: error
        subs: [ '[PapyrusUtil v3.9+](https://www.nexusmods.com/skyrimspecialedition/mods/13048/). Ensure PapyrusUtil version 3.9 or greater is installed.' ]
        condition: 'not file("SKSE/Plugins/PapyrusUtil.dll")'
      - <<: *requiresX
        type: say
        subs: [ '[PapyrusUtil v3.9+](https://www.nexusmods.com/skyrimspecialedition/mods/13048/). Ensure installed PapyrusUtil is version 3.9 or greater.' ]
        condition: 'file("SKSE/Plugins/PapyrusUtil.dll")'
    clean:
      - crc: 0x95029A30
        util: 'SSEEdit v4.0.4c'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants