https://levelup.gitconnected.com/the-sims-4-modern-python-modding-part-1-setup-83d1a100c5f6

Why I’m writing this article

I’ve been programming for many years but I’m very new to Sims 4 modding and was ashamed and baffled by the state of Sims 4 scripting tutorials online. Most tutorials are from 2014–2018 and are terribly written and put together using bad teaching practices and are very much out of date. Explanations were also very lacking. You can’t just be told what to do, you obviously want to be a great modder and to do that you have to understand what you’re doing.

The tutorials are so bad that for the past 6 years all people have been talking about are how bad the tutorials are and how very few their are. I’m going to be hopefully writing better articles over a span of time, I know programming pretty well, I just have to figure out Sims 4 modding without much help online. My goal is to document what I’ve learned into tutorials with good explanations so you can stand on your own and take it further.

What you need before starting

I’m helping you learn how to make scripting mods for the Sims 4 written in Python, something that’s very lacking on the internet for the past 6 or so years. This means you need to know python at least a little. I’m new to python as well so you don’t need to know a whole lot to get started but I’m not going to take up article space explaining how to program and what programming tools you should use. I assume you know at least the very basics because if you don’t there’s a plethora of tools and resources out there to get you on your feet.

If you’re curious, the tool I use is the free version of PyCharm because it offers great code support and hints and works well with different Python versions. I encourage you to use whatever you want. Everybody has their preferences and I want you to stand on your own. Other great tools are VisualStudio Code, Notepad++, Sublime, etc…

I also use Windows, I used Mac a long time ago but I don’t have a mac anymore so I don’t know how to translate these steps to Mac OSX. Hopefully though it’s not that difficult to follow if you’re on a mac.

The python version is extremely important

I’m just going to come out and say this, EA could make this all a billion times easier and it actually angers me they don’t.

You can’t claim to support the modding community and make it so easy to mod the game yet offer no help whatsoever to the modding process you created.

With that said, as of this writing, it’s vital you get the latest version of Python 3.7. I’m using 3.7.9. It can’t be 3.8 or any later version and it can’t be 3.6 or any earlier version. It has to be exactly 3.7. This is very important. This also assumes EA hasn’t haven't upgraded the python version the Sims 4 uses (which they sometimes do). In the future this could be out of date but just know that if it EA changes it in the future it has to be the exact version they change it to.

You can find all the current latest python versions from here and as of this writing you need to download the latest 3.7 one. I have multiple python versions installed so I just download it to C:\\Python37 and chose not to add it to the system path because I hate dealing with multiple versions on the system path.

Normally I recommend for you to not to just blatantly copy me as this helps you to learn better instead of copying/pasting/replicating each step. However for Python, I do suggest installing it to C:\\Python37 or any path that doesn’t have spaces in it. If you can’t download it to C:\\Python37 you may can download it to C:\\Users\\Python37 , C:\\Users\\YourName\\Python37 (If you don’t have a space in your name), or C:\\Users\\Public\\Python37 . There’s a step we’re going to do below that won’t work if you have a space anywhere in the path.

The Sims 4 python library

Remember when I said this angers me that EA says one thing and acts a different way to the modding community. Well, this is what I’m talking about.

In order to write python scripts for The Sims 4, you need to know how to interact with the game. To do that you need to know what code is available inside the game for you to work with. Normally EA would provide you with a specially licensed zip folder containing the files for you to look at and use for development purposes. Much like how Android, Bukkit, Skyrim, and a whole slew of other companies and projects do. It’s fairly standard practice that EA hasn’t gotten the memo on in over 6 years. This is not intuitive at all nor is it easy yet it’s highly critical so it’s the first thing we need to do and I’m sorry EA makes this so difficult.

Imagine someone gives you the recipe for a particular meal, but they actually just hand you the meal itself and expect you to figure out the recipe on your own. You need the recipe to make or modify it but your left with a very slow, bad, and error prone way to figuring it out on your own. This is exactly what we’re having to do in the next step.

Option 1: Automatic Setup