Snoopy911 Posted December 19, 2018 Posted December 19, 2018 Cleanup your mod folder View File ModFolderTools 1.0.3 What's this? After downloading stuff and a lot of more stuff, i didn't like the way my sims 4 mods folder looked like. I should mention, i didn't think at all when moving stuff to the mods folder. Unzip a dozen mods in one step, each to a indiviual folder, copy all to the mods folder and done. Sometime i felt the need for a little bit order and created some folders to move the new stuff, but overall keeping any order failed quite spectacularly . When i noticed a lot of duplicates especially due to downloading sims with cc, i started looking for a suitable tool to sort this out and was not happy with the result of my search. I found some tools which would help sorting out the mods, but nothing simple enough for my taste. Conflict Detector is quite good i think, but checking every single file would require me to be much less lazy. I decided to implement a tool of my own and you might have seen the thread about it in the general sims section. Getting rid of duplicate files in the mod folder worked quite well but i was still not happy. The mods were split over hundreds of folders and i thought of a way to sort this out. Checking the package content for categories would probably the best way to sort the mods, but reading a little bit about the package structure i decided to try an easier way using only the file names and checking for patterns. For Sims 4 many mod authors use meaningful naming conventions and i think it's working quite well this way. The tool has two features removing duplicates try to auto sort the files by author You might like the tool if your mod folds lacks any meaningful structure. You won't need it, if you think about it before you add new mods. How to get started Copy the Sims4ModTools.exe to your sims 4 mods folder and read the description below before you start it and click anything ⛔. Make a backup copy of you mod folder at least before you use it the first time and store the backup somewhere outside the mods folder. Don't run it while Sims 4 is running. Removing duplicate mods If you choose the first option, to move duplicates, a new folder DuplicateBackup will be created in your Sims 4 main folder. Duplicates will be moved to the DuplicateBackup folder with their complete sub folder structure, meaning if you don't like the result you can copy the files back to their original location. The tool is only checking for filenames, thus if you have two files with the same name dress.package with different content in different folder one of them will be moved out and you will have to copy it back manually. I didn't notice any such files in my collection, but it might happen for you. When finding duplicates, the tool will keep the file with the shorter file name (a length check on the complete path, rather than counting subfolders) And what about the checkbox? I added the checkbox when i noticed all the readme's, pictures and whatever other non sims stuff i managed to copy to my mods folder. Activate it to keep only the files required to run the mods, scripts, package and the cfg file. Any other stuff will be moved to the backup folder. Had to make an exception for exe too, otherwise the tool would try to move itself, which probably wouldn't work very well ?. It will also move log files created by some mods, but since those will be recreated i never had any problem up to now with those files getting moved. If you have special folders for example for body mods which you don't want to get changed by the tool, add those folders comma seperated to the 'Exclude Folders' text box. Files in those folders will be used to check for duplicates but they will get priorty ignoring other sorting rules if there are duplicates in other folders. Click on the button and since the tool is only moving files it should be done quite quickly. Restructure the mod folder A warning before you use it. If you have a lot of files with the same name 1.package, feet.package in different folders don't use this feature since it will keep only one file with the same name. Be sure you have a backup. I tested quite a lot but i also found a lot of problems which i solved, but i guess didn't find any possible problem. Also before you run it the first time, check that there is no folder named "unsorted" in you mods folder. No "The Sims 4\Mods\unsorted", no "The Sims 4\Mods\Unsorted", no "The Sims 4\Mods\UnSoRtEd", you get the idea? If you have a folder with this name rename it to something different. The reason to avoid a folder with this name is the tool checking for it and switching to a different working mode, you won't want for the first run. You may also have noticed the textbox 'Exclude Folder'. There might be some folders were you don't want any changes. It took me some time to get body meshes and skins i like and i want those together in a place where i can find them again easily. You can exclude several folders using comma like 'body,skins'. This folders will be only copied completely whitout trying to sort the files. If the tool doesn't find a folder named unsorted, it will create a proposal for a new folder structure but it won't change anything in the mods folder. It will instead create a new folder ModFolderRestructure in your Sims 4 main folder and copy the content of your mods folder to this new folder. It will only sort files from subfolders and copy the files placed directly in the mods folder to the new main folder, since i have the feeling animation packs and script don't work in subfolders all the time. To create a new sub folder and place matching files it has to find at least 3 files matching a pattern. Anything else is placed to a folder named unsorted (yeah the one mentioned above). In my case with about 2600 files in about 800 folders, i get about 70 folders with files mostly matching the author's name with 200 files left in the unsorted folder. Once you start the process it will take some time depending on the folder size. For my 10GB folder it takes about 5 minutes. Once it's finished, check the new folder structure in Sims 4\ModFolderRestructure and if you like the result you can replace the content of your mod folder with this new structure. You might also want to check number of files in the old and new folder. If you used the remove duplicate feature before it should be the same. Otherwise, let's assume you have wild guy's stuff in 10 differrent folders from different downloads. It will move all those files to a single folder and there can only be one file with the same name in one folder. All done? no, while i would love to stop writing now, there is still the mistery 'folder' unsorted to deal with. The tool will have probably created this folder when running for the first time, unless your mods all fit some pattern to sort them away in sub folders. Let's assume you decide to use the new structure, what to do, when you add new mods? Everything is sorted quite nicely now, and sure you could take more care when adding new mods, but do you really want to? Thinking about this problem i was quite sure, no i don't plan to change my ways. One more warning before you continue, if you use this mode, be aware files will be moved not copied. If a file with the same name exits in a target folder, it will get replaced. This is probably fine since you have rather a newer than a older version, but nevertheless, think about it, before you use this feature. Adding new mods and using the new folder structure - or the update mode Let's assume you decided to use the new folder structure. It seems overkill to process all the files again, if you add new cc. The idea is to only check files which were not moved to a suitable folder yet and that's the use of the folder named 'unsorted'. If you don't have the unsorted folder in your mods directory, create a folder with this name. Copy any new stuff you want to add to the unsorted folder and run the tool and it will move the content to suitable sub folders. If you copy several files in different subfolder to unsorted, that's fine, it the tools job to sort it out. Some files will probably stay inside the unsorted folder. You will have an idea what's sorted to subfoldes and what's staying in unsorted after the first run. I copied some of those files where i see no hope of finding a matching pattern to a different folder. No need to check them every time and this would happen if you keep them in the unsorted folder. If an Author uses names like Dress_created_by_xxx with a pattern at the end of the file, remove them since this will never work since most mod authors put something unique at the beginning of a file and that's where the tool is checking.. Hmm before i forget, you also might want to remove the ModFolderRestructure after running the tool for the first time. If you use the update mode via unsorted folder you won't need it and if you want to create a proposal a second time the old files won't do any good either. Some final words I hope i didn't forget anything important, especially since i don't really enjoy writing documentation and might have been sipping a bottle of whisky to get this done ?. I didn't sip whisky when i implemented the tool, thus i have quite some hope everything is working as intended. I was using the Duplicate Removal feature for some weeks now, and there were no problems at all. Tidying up the folders is much more complicated. While i tested a quite a lot i might have missed something, really be sure to have a backup, before you try it. Submitter Snoopy911 Submitted 12/19/2018 Category Other Requires .Net Framework 4.5 which should be installed on your machine anyway 17
Snoopy911 Posted December 19, 2018 Author Posted December 19, 2018 My kind of luck to post this exactly when a ea update breaks WW. If you have problems with whicked whims check this thread. My tool may break something but for this case it isn't the tool :). Just tested it and i have no problems after the update. Having the WW mods in the main mod folder might solve the problem or those guys might have some different kind of issue.
Afro68 Posted December 19, 2018 Posted December 19, 2018 I generally do a pretty good job on my mods folder (hard lessons from Sims 3) but I got my eye on this.....? 1
HowlerMonkee Posted December 21, 2018 Posted December 21, 2018 Thank you for this. Now that there are a lot of mods out there that come with all the CC included, I get duplicates all day long. I also use the TS4 Mod Manager, so I threw the .exe in that folder as well and it worked perfectly.
Snoopy911 Posted December 26, 2018 Author Posted December 26, 2018 I was trying to find a better way for the update mode via unsorted folder to deal with multiple duplicates in your update package. Think of several sims with the same cc you put in the unsorted folder the same time. While i got a new version working, i had several cases where this cc packages included old versions of files and thus it seems a rather bad idea to risk replacing possibly new versions with the stuff from the unsorted folder. The best way seems to run the Remove Duplicates before doing trying to auto sort stuff from the unsorted folder. In cases where you want to update mods, best do it manually.
NobuCollide Posted February 15, 2019 Posted February 15, 2019 Just a head's up for anyone downloading, I personally didn't get it to work. I followed the instructions to the letter, but to no avail. It made the reorganized folder - only without any of the organization. It was a simple, direct clone of the mods folder from which it originated. I have no duplicates, but plenty of files that are unsorted. Over 5,000, in fact. Sadly, this didn't help me. I realize it's an older file, so maybe that's the cause, but regardless of the reasons, I'm afraid it doesn't seem to function as stated. I'll check back here eventually. See if it gets updated. Great idea, and maybe I'm just one in a million. Thanks, anyway. :)
Snoopy911 Posted February 16, 2019 Author Posted February 16, 2019 I don't have any plans to update since it's working fine i think. If there is a problem than it's rather my little manual. Let see if we get it to work for you. Let's try it with the update mode. It won't make a proposal this way but work directly with the mods folder. 1) make a copy of your mods folder to be able to roll back if you don't like the result. 2) create an folder 'unsorted' and move all your mods or folders you want sorted in the unsorted folder. If you have some special folders you don't want to have them sorted leave them outside the unsorted folder. You main mod folder where you probably have your animation files is also save this way. Leave them there because i think most animations or scripts work best in the main folder. 3 ) run the tool (and it has to be placed directly in the mods folder or it won't find the subfolders there.) Can think of one reason why it didn't work. It won't sort any mods right in the mods folder it only checks subfolders. Copy them to unsorted and it will work. And keep your animation files and the scripts in the main folder. Most should work if they get sorted to a subfolder, but i felt some didn't and thus excluded the main folder. 1
SpexSIMS Posted February 17, 2019 Posted February 17, 2019 I prefer my own sorting method over listing items by designer. I did like how quickly it found duplicates in my mod structure though. Thanks and WELL DONE!
Snoopy911 Posted February 18, 2019 Author Posted February 18, 2019 Yeah i would prefer your structure too, but since keeping order is not one of my talents i had to find a different way . Started similar but don't ask how it looked after about one week after getting the game. One example, during my download orgies i managed to copy several rpgmaker games in my mod folder and when i added the option to remove non mod files when searching for duplicates i was quite surprised when about 12k files got moved on the first run.
Pravus Posted March 22, 2019 Posted March 22, 2019 Very helpful tool! Would be possible to keep newest duplicate instead of shortest name?
Snoopy911 Posted March 24, 2019 Author Posted March 24, 2019 Yes should work with some changes. Don't know when i will have some spare time to work on it. No need to check back here, i'll send you a message if there is a new version available. 1
SirKicley Posted March 29, 2019 Posted March 29, 2019 Downloaded, and my AVG immediately warned me and quarantined it.
SirKicley Posted March 29, 2019 Posted March 29, 2019 Side question: If I move mods (either manually or via auto-sorting that this can provide) do the items that the mod added to game wind up being removed from the sim (such as like a "file path name no long valid" type of thing?)
Snoopy911 Posted March 31, 2019 Author Posted March 31, 2019 On 3/30/2019 at 12:25 AM, SirKicley said: Side question: If I move mods (either manually or via auto-sorting that this can provide) do the items that the mod added to game wind up being removed from the sim (such as like a "file path name no long valid" type of thing?) Never noticed any problem with items getting removed. As long as the game still finds the objects it seems ok. About your AVG error, what was the exact message? I compiled it on a machine i also use for surfing to dubious sites (like this one ), thus i can't be a 100% sure my machine is squeaky clean but I decompiled the exe to check it before uploading and everything looked the way it should. Maybe they are checking for file access operations and don't like when the parent folder is manipulated, which i do for creating a backup. Thus it would be interesting to know the reason for the error.
SirKicley Posted April 8, 2019 Posted April 8, 2019 All it said was "this file was quarantined as a threat" and thus I could not access/use it at all.
Zufie Usagi Posted May 27, 2019 Posted May 27, 2019 Very interesting idea you have here. Any chance of an option that does just animations? I've downloaded a few "All in one" packs in the past and it seems at the moment i have a huge number of duplicate animations at least according to WW.
Snoopy911 Posted May 28, 2019 Author Posted May 28, 2019 On 5/27/2019 at 7:25 AM, Zufie Usagi said: Very interesting idea you have here. Any chance of an option that does just animations? I've downloaded a few "All in one" packs in the past and it seems at the moment i have a huge number of duplicate animations at least according to WW. Since animation files have the same file types as other type of cc, i don't see a good way to identify animations. It would probably work if i check the file content, but read a little bit about it and it seems quite a lot of work. Nevertheless since the tool doesn't differentiate between animations and other cc it would work quite well already if you use the option to remove duplicates (only duplicate removal no need to rework the folders, the second option). This option would also move other duplicates, but unless you prefer to have your favorite pair of shoues 10 times in your mod folder instead of once, you should be fine. The tool will move the duplicates to a backup folder in your sims main folder thus you can move them back if you don't like the result and if you want to be a 100% save make a copy of your mod folder before running the tool. If you want to know more details about duplicates and identify the files before doing anything i can recommend the conflict detector (google, sims4 mod conflict detector). It allows for much more control, but also requires you to deal with single files and that was the reason i created my own tool. Wanted something which only required one click. If i think about your question again, conflict detector seems a good choice. You can check the duplicates and decide which version to keep. In case you see thousands of conflicts you can still think about trying my tool.
Zufie Usagi Posted May 30, 2019 Posted May 30, 2019 On 5/28/2019 at 10:36 AM, Snoopy911 said: Since animation files have the same file types as other type of cc, i don't see a good way to identify animations. It would probably work if i check the file content, but read a little bit about it and it seems quite a lot of work. Nevertheless since the tool doesn't differentiate between animations and other cc it would work quite well already if you use the option to remove duplicates (only duplicate removal no need to rework the folders, the second option). This option would also move other duplicates, but unless you prefer to have your favorite pair of shoues 10 times in your mod folder instead of once, you should be fine. The tool will move the duplicates to a backup folder in your sims main folder thus you can move them back if you don't like the result and if you want to be a 100% save make a copy of your mod folder before running the tool. If you want to know more details about duplicates and identify the files before doing anything i can recommend the conflict detector (google, sims4 mod conflict detector). It allows for much more control, but also requires you to deal with single files and that was the reason i created my own tool. Wanted something which only required one click. If i think about your question again, conflict detector seems a good choice. You can check the duplicates and decide which version to keep. In case you see thousands of conflicts you can still think about trying my tool. Seems this ended up being useless to me. It does one of two things, tell me 0 duplicates were moved to duplicatesbackup or it gives me an error. In the case of the duplicatesbackup folder it doesn't exist, i mean i understand why but if i have no duplicates it should say just that instead of mentioning a folder that doesn't exist.
Snoopy911 Posted May 31, 2019 Author Posted May 31, 2019 Sounds like you don't have a single duplicate file at least none with identical filenames. You still might check it with the conflict detector.
BlackheartEros Posted June 6, 2019 Posted June 6, 2019 I just want to say thank you so much for this. I was just wondering how I was going to start sorting through my hundreds and hundreds of downloads, since some stuff has been updated. This worked like a charm!
Yifftrickster Posted September 24, 2019 Posted September 24, 2019 I got this when i tried using this mod recently. how come?
Snoopy911 Posted September 24, 2019 Author Posted September 24, 2019 13 hours ago, hentaihamster said: I got this when i tried using this mod recently. how come? A filepath longer than 260 characters is no problem in windows itself, but it's more than the .Net Framework can deal with. A possible solution on my side would be the use of libraries which can deal with longer path expressions. I did a quick check of some of this libraries but i don't feel comfortable uploading something for other people without beeing really sure this libraries are safe to use. There might be a quick fix for your problem. Start a command shell, navigate to your mods folder and run the following command. dir /s /b | sort /r /+261 > out.txt It will generate a text file out.txt in the mods folder with file names longer than 260 characters on top of the list. It will list all files in the subfolders, but check the top for the real long ones. Move those to some other folders to shorten the name and the tool will work. If you are not used to work with the command shell i can add some screenshots and instructions. Just thought if sims itself might have a problem with such long file path and found a hint about cc not showing up. Guess it's no bad idea to deal with such long file names anyway. 2
snarfies Posted October 19, 2019 Posted October 19, 2019 I'm not sure how this tool determine what is a "dupe," but I wish I could control it a little better. For example: I have a "Default replacement" folder for body-altering mods (like Better Bodies). I have some duplicate BB files that got sucked in while importing Sims - fine. But this tool decides my Default replacement folder has GOT to go, and moves all of its files out as duplicates, which is the exact opposite of what I'd like it to do. One possible solution might be to have the program ask which file to move when it detects dupes.
Snoopy911 Posted October 19, 2019 Author Posted October 19, 2019 4 hours ago, snarfies said: I'm not sure how this tool determine what is a "dupe," but I wish I could control it a little better. For example: I have a "Default replacement" folder for body-altering mods (like Better Bodies). I have some duplicate BB files that got sucked in while importing Sims - fine. But this tool decides my Default replacement folder has GOT to go, and moves all of its files out as duplicates, which is the exact opposite of what I'd like it to do. One possible solution might be to have the program ask which file to move when it detects dupes. I never had that problem because i use a short name for my 'default' folder and since the tool sorts by file path length it always worked. Nevertheless i think i have a solution. Uploaded a new version which let's you define some folders you want to keep intact. Added a text box 'Exclude folders' which doens't really exclude, but rather assign priority to files in those folders. Did a little bit of testing and i think this works quite nicely. You are also correct that it would be a solution to ask which files to move, but.... ModConflictDetector working this way was the reason to create this little tool, because i thought i only want to click once.
snarfies Posted October 21, 2019 Posted October 21, 2019 On 10/19/2019 at 6:59 AM, Snoopy911 said: Added a text box 'Exclude folders' which doens't really exclude, but rather assign priority to files in those folders. Did a little bit of testing and i think this works quite nicely. Yes, that seems to have worked well, thank you!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now