Forum Discussion

Re: 🛠️ Creating a symlink in macOS to store the Sims 4 folder on an external drive

@cjso794o1aaw

Ah I think I understand now 🙂

Commons - mods/CC that can be used in any save
Modern - modern CC for specific saves
Medieval - medieval CC for specific saves
SciFi - scifi CC for specific saves

You then have an internal symlink pointing the Mods folder towards a folder called Global Mods. In each of the 3 themed folders you have the relevant CC plus a symlink pointing to Commons so that Commons content is always loaded in addition to the themed CC.

Is that right?

I would have thought the resource.cfg file should be directly in Global Mods but you have it in the Modern folder. If the symlink is correct the game has no idea about the Global Mods folder because the OS is doing the workaround, it still thinks it's in Mods. Therefore the resource.cfg file should be Global Mods. If you remove the resource.cfg file now and load the game, a new one will be automatically created. Where is the game adding it? Wherever that is is the starting point for figuring out the next bit (I think?!) 🙂

5 Replies

  • cjso794o1aaw's avatar
    cjso794o1aaw
    2 years ago

    Yes pretty close!

    The Mods folder actually points to Modern directly (or SciFi, or Medieval -- only one at a time) ; and I only use "Global Mods" as the place where I can organize my hoard of CC.

    If that helps, here are a few screenshots :

    That's the "Modern" folder (the one that is currently linked in Mods) -- in which I have symlinks to Commons/ and Fantasy/

    (Please disregard the Bash scripts, I use them to remove special characters and white spaces from CC files names, eg. [creator]test_package.package to creatorTestPackage.package)

    And for example, the Medieval folder is basically the same :

    It's unused for now however, The Sims game has no idea it exists. But if I want to go back to my Medieval saves, I'd just have to switch the symlink in The Sims 4/Mods from Modern/ to Medieval/ 🙂

    So basically The Sims 4/Mods points toward Global Mods/Modern, and if I look further, The Sims 4/Mods/Commons will point toward Global Mods/Commons directly (which is great! That's what it's supposed to do! haha)

    Here's a comparison of the two folders : 

    Do you think it could be an issue with how the game loads files on Mac, should I open a ticket?

    Thank you!

  • Bluebellflora's avatar
    Bluebellflora
    Hero+
    2 years ago

    @cjso794o1aaw 

    Ah, gotcha, thanks.

    Do you have a resource.cgf file in the SciFI and Medieval folders?

    I don't see how it is an issue with how the game loads files on macOS. All the game is doing is looking in the Documents folder for an Electronic Arts folder, for a Sims 4 folder, and then the saves folder, Mods folder, game settings file and all the other files it needs. If it can't find them it will simply recreate the files, or folders, it can't find. It doesn't know macOS is using the symlinks. But, it's interesting that this exact same setup worked for you in Windows. So I would think it could be one of two things - 1) differences in Windows and macOS (I have no experience of the command line in Windows) or 2) the symlinks not being correctly set up but from your screenshots it all looks ok.

    To answer your initial question "Do you know if the Mac OS build of The Sims 4 can load symlinks inside other symlinks?" I would assume yes it can because the OS is doing the work and the game is none the wiser. I'm going to have to test this now though. Will play around later and report back with my findings 🙂

    I would personally set it up with bespoke saves and Mods folders and rename them before loading the specific save I wanted to play. If storage was the issue I'd dump the whole Electronic Arts folder on a fast external and symlink to it (the problem I had and why I created this guide all those years ago now).

  • Bluebellflora's avatar
    Bluebellflora
    Hero+
    2 years ago

    @cjso794o1aaw 

    Did some testing. I started with an empty Mods folder and moved it to a new folder called SimsStorage in the Electronic Arts folder (the game would actively ignore this folder):

    I then created a symlink to this Mods folder from the Sims 4 Mods folder and added one piece of CC. It successfully loaded in the game.

    I then created another folder called TestCC and placed it directly in the Documents folder:

    I then created a symlink to this folder in the Mods folder and moved the piece of CC into this TestCC folder. Loaded the game and the CC did not load.

    I moved the piece of CC back into the Mods folder and it loaded:

    I trashed the TestCC folder symlink and instead created a symlink for the individual piece of CC. It loaded successfully into the game:

    ln -s ~/Documents/TestCC/BBFTestSymlink.package ~/Documents/Electronic\ Arts/The\ Sims\ 4/Mods/BBFTestSymlink.package

    And of course if I trash that symlink and move the TestCC folder into the Mods folder, the CC also loads fine:

    Now I'm asking the same question as you! Why doesn't the CC load in a nested folder as it should when a symlink has been created? 

  • cjso794o1aaw's avatar
    cjso794o1aaw
    2 years ago

    Thank you for your thorough testing!! That's exactly it!

    I experimented a bit with scripts in my Terminal; I doubt the game is actually written in Python but I know mods use it, so I tried to test what os.walk() saw in my Mods folder. 

    Turns out os.walk() has an option called followlinks, which is set to False by default. So by default, Python will see files/folders that are symlinks, but will not go through a symlink directory without being told so with followlinks=True. That would explain all of your tests! Especially if a symlink to a file works, but not a symlink to a directory.

    Here's the code I tested and the results it yielded if it's of any interest :

    Spoiler

    Here are my test files in context :

    Here is my code :

    import os
    rootdir = '/Users/user/Documents/Electronic Arts/Global Mods/Modern'
    
    # Chunk of code to ignore folders we do not care about
    dont_go_there = ['1Quarantine', 'BuildBuy', 'BuildBuyMods', 'CAS', 'CASMods', 'GameplayMods']
    def has_keyword(path):
        results = []
        for keyword in dont_go_there:
            results.append(keyword in path)
        return (True in results)
    
    # Going through folders and subfolders
    for full_path, subdirs, children in os.walk(rootdir, followlinks=False):
        if not has_keyword(full_path):
            print(full_path)
            print('\t Has the following subdirs =>', subdirs)
            print('\t Has the following files =>', children)

    And running this with followlinks=False will yield the following result :

    $ python3 test.py
    /Users/user/Documents/Electronic Arts/Global Mods/Modern
    	 Has the following subdirs => ['CAS', 'CASMods', 'TestSymlinkDirectory', 'BuildBuy', 'GameplayMods', '1Quarantine', 'BuildBuyMods']
    	 Has the following files => ['.DS_Store', 'TestSylinkFile.sh', 'Resource.cfg']

    So it can see TestSymlinkDirectory as a child of Modern, but it doesn't go through. TestSylinkFile.sh is here no problem.

    If followlinks is set to true however, it will list the directory and its children :

    $ python3 test.py
    /Users/user/Documents/Electronic Arts/Global Mods/Modern
    	 Has the following subdirs => ['CAS', 'CASMods', 'TestSymlinkDirectory', 'BuildBuy', 'GameplayMods', '1Quarantine', 'BuildBuyMods']
    	 Has the following files => ['.DS_Store', 'TestSylinkFile.sh', 'Resource.cfg']
    /Users/user/Documents/Electronic Arts/Global Mods/Modern/TestSymlinkDirectory
    	 Has the following subdirs => ['CAS', 'CASMods', 'BuildBuy', 'BuildBuyMods']
    	 Has the following files => ['.DS_Store']

    I guess there could be an equivalent "issue" in the game code? 

    What blows my mind is that the Windows build isn't tripped up by the use of symlinks inside the Mods folder, and I would have thought the same bit of in-game code was used for both platforms. So either the way files are loaded is different between the builds (and a tiny parameter is missing); or the way the same bit of code is executed changes between Windows and Mac OS systems. That's actually pretty cool to know!

    I'm sorry, it's my first time using Answers HQ; could you tell me how I could "report" this to the developers?

    I don't have much hope of seeing it fixed -- if the "Me too" button could go sub-zero, that'd be for me and my weird use-case -- and it's not like it's a real problem, but I think it'd be a shame to lose such a nifty feature between the two platforms 😅

    Thank you again for all your help!

  • Bluebellflora's avatar
    Bluebellflora
    Hero+
    2 years ago
    @cjso794o1aaw

    That is so interesting, thanks so much for taking the time to post the explanation. I have no experience of Python but it is something I want to learn, it's near the top of the to do list 🙂

    I'm forwarding this to EA QV. I don't hold out much hope they will do anything, it isn't exactly game breaking but I like to think someone will take an interest 🙂