Forum Discussion

IngeJones's avatar
9 years ago

Can't get script overrides working at all

I have had my non-override scripts working in the past, and tuning overrides but can't get a script override seen. I mean as in they are totally ignored. Going by:


You can override Maxis Scripts, however to avoid breaking the game your Scripts should preserve the existing Maxis APIs where possible. To override a Script in a sub-package (a Script in a subdirectory containing an “__init__.pyo” file), your Mod must include all other files in the same directory.


I have put these three files: __init.py__, door.py, front_door.py in a folder in various places in my mods folder structure, including loose in ScriptMods where every other script file is happy running. (NB I edited door.py to output some logging so I would know it's running but it isn't). I have had both .py and .pyo files of mine running for me in the past but I just can't get this override seen by the game.

For the purpose of this question I don't want advice about injectors, as this isn't a mod to share, I am just trying to learn a principle. So, any concrete instruction about where to put them or how to compose their folder?
  • When I tried this, the scripts needed to be placed in a subfolder with the same name as the one the scripts were copied from. For example, if overriding the buff script, it will need to be placed inside a "buff" folder.

    I'm not sure how the game handles sub-subfolders. It might only work if you copy the entire "objects" folder (which would conflict with any other mod that does the same) but I'm not sure. You could try leaving the "objects" folder empty and only putting files in the "door" folder, but I'm not sure if that will work. There's also the fact that the decompiler isn't always perfect, so the more files there are, the higher the chance one of them will contain game-breaking code.
  • The .zip file should be placed in any subfolder of /Mods (for example /Mods/Scripts) and the BuffsOrWhatever folder(s) should be placed inside the .zip file. The last time I checked, .py files seem to have stopped working, so you'll probably have to compile them.
  • Thanks. So if I am testing them as .py before compiling, and that usually means they have to go in a /Scripts subfolder under my mod's own folder, you'd say it would need to be /Mods/MyMod/Scripts/BuffsOrWhatever ?? Or directly down from Mods as in Mods/BuffsOrWhatever. Or won't they work at all non-compiled? Anyway I can start heading off in this direction...
  • Can't get it working.. Made a zip file containing /objects/doors with __init__.pyo, door.pyo and front_door.pyo. Placed zip into Mods/ScriptMods where zipped scripts from many other modders including yourself are working well. The game continues to work as if my override was not noticed at all. If it requires the whole of /objects to be fully populated then I am not prepared to override that many files.

    @SimGuruEugi or @SimGuruModSquad any ideas from yourselves?

About The Sims 4 Mods & Custom Content

Find expert tips, troubleshooting help, tutorials for mods and custom content, and The Sims 4 patch files in our forum.4,704 PostsLatest Activity: 7 hours ago