Forum Announcement, Click Here to Read More From EA_Cade.

Can't get script overrides working at all

IngeJonesIngeJones Posts: 3,247 Member
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?
Post edited by IngeJones on

Comments

  • Options
    ZerbuZerbu Posts: 3,457 Member
    edited September 2016
    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.
  • Options
    IngeJonesIngeJones Posts: 3,247 Member
    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...
  • Options
    ZerbuZerbu Posts: 3,457 Member
    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.
  • Options
    IngeJonesIngeJones Posts: 3,247 Member
    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?
Sign In or Register to comment.
Return to top