Jump to content

[tool] Python script that checks what files that mods overwrite


Recommended Posts

Posted

I just created it because I wanted to know how my load order interacts, kinda like how the mod organizer for Skyrim does it. Might or might not be useful for others, so uploading it here. Unknown if it works for machines other than mine, but will only work on Windows.

 

Feel free to rewrite or adapt or create a real mod manager from it. I might have made the wrong assumptions, so it can be totally wrong.

ck3_mod_overwrite_finder.py

Posted

Incredibly useful! I am having an issue with it however, and I assume it's due to having CK3 on a different drive than my main one given that IDLE is kicking back a filepath error. Works fine on desktop however!

Posted

The scripts assumes that your My Documents folder is in the default spot, could probably be improved by checking the registry for it or something. For now you can just fix that path manually.

Posted

Excuse me if I am being dumb, but when I try to run it it spouts out
Traceback (most recent call last):
 

  File "C:\Users\user\ck3_mod_overwrite_finder.py", line 110, in <module>
    print_overwrites(include_base_game=False)
  File "C:\Users\user\ck3_mod_overwrite_finder.py", line 94, in print_overwrites
    mods = get_current_playset()
  File "C:\Users\user\ck3_mod_overwrite_finder.py", line 44, in get_current_playset
    ck3_docpath = os.path.join(os.path.expanduser,("~"), 'OneDrive', 'Documents', 'Paradox Interactive', 'Crusader Kings III')
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\ntpath.py", line 104, in join
    path = os.fspath(path)
TypeError: expected str, bytes or os.PathLike object, not function

and refuses to work
How can I directly link the path to the code? Sorry, I've never been all that great with code, and also have never used Python.

Posted
On 9/22/2022 at 3:23 PM, prto204 said:

Excuse me if I am being dumb, but when I try to run it it spouts out
Traceback (most recent call last):
 

  File "C:\Users\user\ck3_mod_overwrite_finder.py", line 110, in <module>
    print_overwrites(include_base_game=False)
  File "C:\Users\user\ck3_mod_overwrite_finder.py", line 94, in print_overwrites
    mods = get_current_playset()
  File "C:\Users\user\ck3_mod_overwrite_finder.py", line 44, in get_current_playset
    ck3_docpath = os.path.join(os.path.expanduser,("~"), 'OneDrive', 'Documents', 'Paradox Interactive', 'Crusader Kings III')
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\ntpath.py", line 104, in join
    path = os.fspath(path)
TypeError: expected str, bytes or os.PathLike object, not function

and refuses to work
How can I directly link the path to the code? Sorry, I've never been all that great with code, and also have never used Python.


 

os.path.join(os.path.expanduser,("~")

You have inserted a comma here, maybe it will work if you remove it. My My Documents folder is in the default location, so I cannot test it, but perhaps I can look into a more generic fix anyway.

Posted (edited)

So I just tested it and at first I got an error

Traceback (most recent call last):
  File "C:\Users\redacted\Downloads\ck3_mod_overwrite_finder(1).py", line 125, in <module>
    print_overwrites(include_base_game=False)
  File "C:\Users\redacted\Downloads\ck3_mod_overwrite_finder(1).py", line 115, in print_overwrites
    os.chdir(path)
FileNotFoundError: [WinError 3] Das System kann den angegebenen Pfad nicht finden: 'mod/Carnalitas'         #it means 'system cannot find the specified path' in german.

 

BUT after I changed the current playset to another one. It worked!

and after changing back, well this also worked.

 

edit: also be careful if there are characters from languages that cause issues (chinese for example) just rename them in the folder or disable them

 

Sooo thank u very much. for this tool

Edited by nYidentity

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...