[1.0] RWMS -- RimWorld ModSorter .. RimWorld mod sorter (Windows, Linux, OSX)

Started by shakeyourbunny, April 07, 2019, 07:05:28 AM

Previous topic - Next topic

shakeyourbunny

RWMS - RimWorld Mod Sorter
Version 0.95.1.4, > 3620 known mods.

Links
Homepage: https://bitbucket.org/shakeyourbunny/rwms
Download: https://bitbucket.org/shakeyourbunny/rwms/downloads/
Issues: https://bitbucket.org/shakeyourbunny/rwms/issues
Database contribution: https://bitbucket.org/shakeyourbunny/rwmsdb/issues <-- unknown mods here

Windows TLDR:
- unzip the latest rwms_sort-x.xx.xx-win.zip in a directory.
- run rwms_sort-x.xx.x.exe --dump-configuration to see if it's OK everywhere.
- if not you may have to edit the rwms_config.ini

Description and Features
This Python script sorts your ModConfigs.xml (RimWorld mod configuration) for better loading time putting the
dependencies of your mod order in the right spot. This is also the only function of the script, it will do this
one thing and nothing else.

You know the drill: "put this mod at the first spot, after mods X or at last". Now you don't have to remember this,
just use this sorting script.

Features:
- sorts your active mods; Core, Hugslib, libraries, frameworks first, then normal mods and at the bottom patches,
  textures and other pesky mods who want to be loaded last.
- (semi)automatic detection of the mod and game paths; you can override it with a configuration file
- displays detected paths if you wish
- automatically saves unknown mods in a JSON for submission.
- optional autosubmitting unknown mods (see documentation)
- script works on Windows, Linux and OSX; drm free build and steam build.
- if there are some unknown mods, the script asks if it should really write the modified ModsConfig.xml
  (unknown mods are removed from the load order).

Installation and Usage
Full Installation instructions see https://bitbucket.org/shakeyourbunny/rwms

Quick Command Line Overview:
Quote
** RWMS 0.95.1 by shakeyourbunny ***********************************************

bugs: https://bitbucket.org/shakeyourbunny/rwms/issues
database updates: visit https://bitbucket.org/shakeyourbunny/rwmsdb/issues

usage: rwms_sort.py [-h] [--disable-steam] [--dont-remove-unknown-mods]
                    [--openbrowser] [--disable-tweaks] [--contributors]
                    [--dump-configuration] [--dump-configuration-nowait]
                    [--reset-to-core] [--wait-error] [--wait]
                    [--enable-delays] [--steamdir STEAMDIR]
                    [--drmfreedir DRMFREEDIR] [--configdir CONFIGDIR]
                    [--workshopdir WORKSHOPDIR] [--localmodsdir LOCALMODSDIR]

optional arguments:
  -h, --help            show this help message and exit
  --disable-steam       (override) disable steam detection
  --dont-remove-unknown-mods
                        (override) do not remove unknown mods
  --openbrowser         (override) opens browser if new version available,
                        implies force updatecheck
  --disable-tweaks      (override) disable user tweaks
  --contributors        display contributors for RWMS(DB)
  --dump-configuration  displays the current configuration RWMS is thinking of
  --dump-configuration-nowait
                        displays the current configuration RWMS is thinking
                        of, forces no waiting (for scripts)
  --reset-to-core       reset mod list to Core only
  --wait-error          (override) wait on errors
  --wait                (override) wait on exit
  --enable-delays       (override) enable some delays
  --steamdir STEAMDIR   (override) Steam installation directory
  --drmfreedir DRMFREEDIR
                        (override) DRM free directory of RimWorld
  --configdir CONFIGDIR
                        (override) location of game configuration / save
                        directory
  --workshopdir WORKSHOPDIR
                        (override) location of Steam Workshop mod directory
  --localmodsdir LOCALMODSDIR
                        (override) location of local mod directory

Feedback
I'd appreciate any feedback and unknown mod submissions (just paste the contents of the rwms_unknown_xxxxxxx.json here or a new gitlab issue on https://bitbucket.org/shakeyourbunny/rwms/issues). Please include what platform you are playing RimWorld on and what build (DRMfree/Steam).

The categorization database was built from scratch from the most popular mods from Steam Workshop, some personal preferences and wholesale inclusion of mods of the more well-known mod authors.

shakeyourbunny


shakeyourbunny


shakeyourbunny

configuration file now overrides all automatic detection, path sanity logic moved to main script.

Canute

Hi,
some feedback.
Win10 Rimworld DRM user, no steam installation.
Python installed.
1.question: is there no option for you to made executable files for you for each OS out of the scripts ?

python command from the .bat file not recognized (maybe i need to restart the PC) but direct start the rwms_sort.py works.
But the scripts end's so fast that i can't read any. Using Idle from python to run the script.

Starting script without .ini file.
** error, steam workshop directory 'C:\Program Files (x86)\Steam/steamapps/workshop/content/294100' could not be found. please check your installation and / or configuration file.

Starting script with modified .ini file
** error, could not find ModsConfig.xml; detected: '"C:\Users\Canute\AppData\LocalLow\Ludeon Studios\RimWorld by Ludeon Studios"/ModsConfig.xml'
You wanted
Quote; configuration directory for RimWorld, where game saves etc reside
configdir = "C:\Users\Canute\AppData\LocalLow\Ludeon Studios\RimWorld by Ludeon Studios"
and that is the path, sure the ModsConfig.xml is inside Config folder, trying to add this at the .ini.
Just to carify, the saves arn't inside the Config folder, so you description is wrong.

Loading mod data.
** error, steam workshop directory 'C:\Program Files (x86)\Steam/steamapps/workshop/content/294100' could not be found. please check your installation and / or configuration file.

So does the script don't work without steam ?

My suggestion, don't let the people edit the .ini file.
Add file requeste windows for the file path's you need and safe these into the .ini


shakeyourbunny

Announcement: if you download 0.92, don't forget to install the python module "BeautifulSoup" (command line: pip install bs4).

Quote from: Canute on April 10, 2019, 04:04:25 AM
Hi,
some feedback.
Win10 Rimworld DRM user, no steam installation.
Python installed.
1.question: is there no option for you to made executable files for you for each OS out of the scripts ?
I'm looking into it producing a standalone executable for Windows users.

Quote
python command from the .bat file not recognized (maybe i need to restart the PC) but direct start the rwms_sort.py works.
But the scripts end's so fast that i can't read any. Using Idle from python to run the script.
Will look into it. This script is mainly meant for the CLI (for now) but will add some slowdowns.

Quote
Starting script without .ini file.
** error, steam workshop directory 'C:\Program Files (x86)\Steam/steamapps/workshop/content/294100' could not be found. please check your installation and / or configuration file.

Starting script with modified .ini file
Quote; configuration directory for RimWorld, where game saves etc reside
configdir = "C:\Users\Canute\AppData\LocalLow\Ludeon Studios\RimWorld by Ludeon Studios"
and that is the path, sure the ModsConfig.xml is inside Config folder, trying to add this at the .ini.
Just to carify, the saves arn't inside the Config folder, so you description is wrong.
Will clarify description.

Quote
Loading mod data.
** error, steam workshop directory 'C:\Program Files (x86)\Steam/steamapps/workshop/content/294100' could not be found. please check your installation and / or configuration file.

So does the script don't work without steam ?
It seems that you have Steam installed, so the autodetection assumes that you have the Steam build of the game and until 0.90, the config file was ignored if something was found automatically.

This was reverted in 0.91 (see https://gitlab.com/rwms/rwms/issues/1#note_159115775), so any entries there will override the automatic detection; path and file checking was moved into the main script.

Quote
My suggestion, don't let the people edit the .ini file.
Not really, because the configuration file is also meant for things the script does not yet cover or can cover in a reliable way (installation path of drm free build, for example..)

Quote
Add file requeste windows for the file path's you need and safe these into the .ini
Is a suggestion to look into.


Canute

Quote from: shakeyourbunny on April 10, 2019, 08:28:52 AM
Quote
Loading mod data.
** error, steam workshop directory 'C:\Program Files (x86)\Steam/steamapps/workshop/content/294100' could not be found. please check your installation and / or configuration file.

So does the script don't work without steam ?
It seems that you have Steam installed, so the autodetection assumes that you have the Steam build of the game and until 0.90, the config file was ignored if something was found automatically.
Maybe some remains at the registry, but steam isn't installed.
Uninstall never remove anything :-(



NordLord

I've pointed it to the directories it needs to go to in the config but the script crashes still trying to go to the "assumed" directory so I'm not sure why.
Config directories: https://gyazo.com/a09d65cf292f6547a62cac4bf2c1ac95
The crash message: https://gyazo.com/ce24c9a0d9f935828f2b16e9b41048ba
P.S, you should add a press to continue on completion or fail so people can diagnose issues better. The command prompt auto closes so people with issues won't be able to give you info on whats going on.

shakeyourbunny

Sorry for the confusion, I mostly do the bug tracking on gitlab, where I opened for you a ticket: https://gitlab.com/rwms/rwms/issues/4

In essence, I'll look into it, but I will do it after my day job.

shakeyourbunny

New Release 0.93

Changelog:
- configurable disabling steam check (fixes issue 4)
- update version check (issue #5)
- added some slowdowns (issue #6)
- windows executable ignores configuration file fixed (issue #7)
- added configurable keypress on error and exit
- project moved back to GitHub, it doesn't like JSON as extension...

Note:
There are some new options in rwms_config.ini (either add them manually or get the new configuration file from the distribution):

Quote
; disable update check
updatecheck = True
; opens a new browser windows with the download page,
; if there is an update available (not yet implemented)
openbrowser_on_update = False

; wait for a keypress, if an error occurs
waitforkeypress_on_error = True

; wait for keypress on program end.
waitforkeypress_on_exit = True

; disable check for steam
disablesteam = False

Canute

Windows excutable version.
With the disablesteam option it finaly worked.
But if someone don't enter a steamdir, you should check that too and use it disabledsteam.

And why do you allways want localmodsdir ?
Isn't that allways configdir + "/mods" ? You can change only the savedatafolder, but not not Mods.

Just test a run without .ini file.
Don't work, and you forget to add "Press ENTER to close the program." at this exit.

Thy python version don't work, does i got the wrong version, i installed the latest Python 3.7.3.
Or does i realy need the Python 3.6.0 Dec. 23, 2016  ?

shakeyourbunny

Quote from: Canute on April 13, 2019, 04:25:10 PM
Windows excutable version.
With the disablesteam option it finaly worked.
But if someone don't enter a steamdir, you should check that too and use it disabledsteam.
empty "steamdir" means that the automatic detection should kick in, if you want to disable checking for steam entirely, use the new switch "disablesteam".

Quote
And why do you allways want localmodsdir ?
Isn't that allways configdir + "/mods" ? You can change only the savedatafolder, but not not Mods.
The parameter "localmodsdir" is for overriding the automatic detection.

Quote
I run a Just test a run without .ini file.
Don't work, and you forget to add "Press ENTER to close the program." at this exit.
If you run the script without the configuration file, it is in fully automatic mode and has the following defaults:
- check for new version enabled.
- dont wait for keypresses (errors nor program exit) .. reason is easier integration in other scripts or UI which capture standard output.
- steam check is not disabled.
- path detection is automatic (look for steam version and then maybe drm free on standard paths / registry entries).

Not waiting for any keypresses is expected behaviour in this mode, main reason for this is easier integration in other tools or for a future GUI shell around it which captures the output. I am aware that such thing would be really nice, but doing a proper and sane (read: not Electron) cross-plattform UI is currently beyond my Python knowledge, but this may change.

Quote
Thy python version don't work, does i got the wrong version, i installed the latest Python 3.7.3.
Or does i realy need the Python 3.6.0 Dec. 23, 2016  ?
Please provide output of "what is not working".

Current output with my system (Windows, Steam version) is:
Quote
C:\Projects\Github\RWMS>python rwms_sort.py
*** RWMS 0.93 by shakeyourbunny
visit https://gitlab.com/rwms/rwms/issues for reporting problems,
visit https://gitlab.com/rwms/rwmsdb/issues for uploading potential unknown mods
.
   please use the generated .json file.

loading current RWMS database.

Database (structure v4, last update Mon Apr  8 19:00:05 2019) successfully loaded.
945 known mods, 5 contributors.
Top contributors: shakeyourbunny (662), ? Black Goat ? (129), nightliss (57), dreipixel (49), Preechr (48),

Loading and parsing ModsConfig.xml

Loading mod data.
could not find metadata for item 1552879967 (skipping, is probably a scenario)!   
could not find metadata for item 1568128102 (skipping, is probably a scenario)!
could not find metadata for item 1625392558 (skipping, is probably a scenario)!

sorting mods.

332 subscribed mods, 271 (271 known, 0 unknown) enabled mods
lucky, no unknown mods detected!
Writing new ModsConfig.xml.
Writing done.

C:\Projects\Github\RWMS>python --version
Python 3.7.2
Fiddling with path locations is only needed if you use the DRM-free version because they have no installer, just a zip file to download wherever you feel like it to download. This is not possible to autodetect (except the scripts does a bruteforce file system scan over your entire computer and I'm 100% sure that nobody wants this).

Steam on Linux and OSX is another story, I need some information where to the default locations for RimWorld are except for the configuration itself, this is documented in the RimWorld wiki (and already integrated).






Canute

I installed python 3.7.3, windows recognize the .py files als python files and exceute them with the python interpreter.
But the shell don't recognize the command python, i think missing path settings to the python for the shell enviroment.
So the batch datai don't work. But the shell recognize the .py file and start exceute the python interpreter.
D:\Games\RimWorld2150Win64\rwms-master>rwms_sort.py
Traceback (most recent call last):
  File "D:\Games\RimWorld2150Win64\rwms-master\rwms_sort.py", line 13, in <module>
    from bs4 import BeautifulSoup
ModuleNotFoundError: No module named 'bs4'

D:\Games\RimWorld2150Win64\rwms-master>

shakeyourbunny

Quote from: Canute on April 14, 2019, 04:31:30 AM
D:\Games\RimWorld2150Win64\rwms-master>rwms_sort.py
Traceback (most recent call last):
  File "D:\Games\RimWorld2150Win64\rwms-master\rwms_sort.py", line 13, in <module>
    from bs4 import BeautifulSoup
ModuleNotFoundError: No module named 'bs4'
D:\Games\RimWorld2150Win64\rwms-master>


please enter the following in the CLI:

pip install bs4

After that, it should run. Don't forget to download the most  recent release 0.93 on https://github.com/shakeyourbunny/RWMS/releases/tag/0.93 . There is also a recent windows binary included if you wish to use it.