Cargo Def Fixer (Updated version 1.0.1 - bugfix)
EDIT: Link updated to a new version. There was a bug in the old version that was writing two periods into one of the filenames.
The odd thing was, it didn't seem to affect it, but I have removed the error anyway. If you want to confirm it, check the file in /def/cargo/[cargoname/ and you should see something like [trailername]..sii You may have to uninstall the old version before installing this version, it is probably better to do so.
There doesn't seem to be a place on the forums for *Tools*, so I've marked the thread title in the hope it makes more sense.
Please note, this tool only fixes log errors caused by trailer mods generated with ETS2 Studio, it does not fix all mod errors. Only use the tool on trailer mods that have been created with ETS2 Studio!
I am currently writing a trailer skinning tool, and while I was doing that, I got involved in a thread about trailer mods causing game log errors. These errors were due to the changes in the game cargo system in more recent versions of the game, which caused any trailer mods created with ETS2 Studio, to generate these log errors. The errors don't cause any problems, but some people don't like errors in their log files. We've all probably seen the "vehicles list is not empty!" error at some time.
As I was doing work on the cargo folders myself, I thought it would be useful to have something that would automatically fix those errors, so this tool was born. It's nothing fancy, it just has three buttons and it performs just one task. I'll go over the buttons and how the tool works.
You will get a box asking you if you trust the installer when you install this tool. That's a security measure from Microsoft that comes on all their "ClickOnce" installers. Click "Yes" if you want to continue.
Firstly, always remember to use any tools on copies of your mod files, just to be safe. I have tested this tool on a single trailer mod, and on one that had 80 trailers and 35 cargo types, and both worked fine after using the tool on them. But you cannot guarantee that things will be fine every time.
1) Extract your mod to a folder somewhere on your drive.
2) Run the CargoDefFixer programme and you will see three buttons.
* Select DEF Folder
* Select Output Folder
* Fix It!
3) Click on "Select DEF Folder" and find the def folder in your extracted mod.
4) Click on "Select Output Folder" and choose where you want the fixed def folder to be written to, ideally an empty folder.
5) Click "Fix It!"
It will display a "Done" message when it has finished and some information about the mod will be displayed in the programme.
Go to your extracted mod def folder, and delete the cargo and company folder, plus any cargo files files in the def folder.
Note: You must delete these first, as the new files will have different names, so they will not overwrite the old ones. Do not delete the [b]vehicle folder though, nothing changes in this folder.
If you now go to the output folder you chose, you will see inside a cargo and a company folder and some sii files, just like you had in your mod def folder.
Copy all of these files into your mod def folder and rebuild your mod using the zip tool of your choice. If you're not sure how to do that, this thread might help.
Copy your mod into your ETS2 mod folder, and you should see no more log errors from this mod.
I appreciate that English is not the native language of many of the forum users, so if any of my instructions are confusing, please ask questions.