[FIX] Struggling to use overrides/default replacements on a Mac.
The Issue:
I've found that when trying to use overrides and/or default replacements (including things like translations), oftentimes my Mac doesn't load them in the "correct" order for them to work. Most of the time these files need to load BEFORE all other files.
On Windows, adding a ! to the beginning of the file name is sufficient to get the file to load before all other files. For some reason, that logic doesn't always work on a Mac. Usually, I have to test several different file configurations to get the file to load correctly. For example, in trying to get a piece of default clothing to work, I tried probably five different configurations before I got one to work. The one that ended up working was putting the specific replacement files in the folder with the mod I wanted to override and then adding a ! to the file names of the replacements (within the folder).
Resource File:
However, I recently learned of a much easier way to do this by modifying the resource file.
The default resource file configuration is as follows, which follows the general rule of thumb that package files can go up to 5 subfolders deep:
Priority 500
PackedFile *.package
PackedFile */*.package
PackedFile */*/*.package
PackedFile */*/*/*.package
PackedFile */*/*/*/*.package
PackedFile */*/*/*/*/*.package
Here's what the lines generally are saying:
- File directly in the mods folder--no subfolders: PackedFile *.package
- File in 1 subfolder: PackedFile */*.package
- File in 2 subfolders: PackedFile */*/*.package
- File in 3 subfolders: PackedFile */*/*/*.package
- File in 4 subfolders: PackedFile */*/*/*/*.package
- File in 5 subfolders: PackedFile */*/*/*/*/*.package
To ensure that the override/default files are read before anything else, you can add to your resource file.
For example, here is what my current resource file looks like:
Priority 500
PackedFile *.package
PackedFile */*.package
PackedFile */*/*.package
PackedFile */*/*/*.package
PackedFile */*/*/*/*.package
PackedFile */*/*/*/*/*.package
Priority 501
PackedFile Overrides/*.package
PackedFile Overrides/*/*.package
Here's what my resource file is generally saying:
- The first section is the same as the normal/default resource file.
- The second section is how I get my defaults to work:
- Priority 501 means that it will load BEFORE priority 500.
- The actual number you choose can be any number higher than 500. So if you wanted to keep whole round numbers, you could do 600 and since that's still higher than 500 it loads before.
- Just note that if you want to add another level (like if you want to add a second folder that is read before the overrides folder & before everything else, that number would have to be higher than 500 & whatever number you chose. So for me, it would have to be higher than 500 & 501.
- PackedFile Overrides/*.package & PackedFile Overrides/*/*.package
- This is telling the game to look for a folder inside my mods folder called "Overrides" and load anything that is directly in that folder or a subfolder (in that Overrides folder) before any other file(s).
- Priority 501 means that it will load BEFORE priority 500.
How to achieve this:
To edit the resource file:
- Two-finger click (right-click) on your resource file. Found inside your mods folder.
- Choose open with
- Choose a text editing program. I use the default TextEdit.
- Modify your resource file to fit your need.
- Remember, your folder names need to match.
- If your folder is named Translations, your code needs to say that.
- PackedFile Translations/*.package
- If your folder is named Translations, your code needs to say that.
- You also cannot have spaces in the folder name.
- For example, if you wanted to name the folder Default Clothing, it would not work. It would need to be named DefaultClothing.
- Remember, your folder names need to match.
- Save & close the resource file.
Make sure your folders are set up correctly. For example, here is what my set up looks like.
Then delete localthumbcache.package & avatarchache.package from inside "The Sims 4" and test your game to make sure your new resource file is being read correctly!
💡 Credit to @sudsyllama 💡