🛠️ Scripting workspace for modding The Sims 4
This repository is designed to bootstrap your scripting process when making mods for The Sims 4. If you don't know where to start or can't seem to get your script files organized, check out this repository. It's designed as a boilerplate for you to customize for your own modding process. It provides the following:
- Utility mods (to be compiled and used as neded):
hello_world: example modexample_script.py: includes ahello_worldcommand and an example injection with a notificationinjector.py: this mod's symlink to./Utilities/injector.py
hotreload: includes commands for reloading your*.pyand*.xmlfiles without restarting the gamescript_reloader.py: hotreloads the specified*.pyfile (e.g.,r.script hello_world example_script)settings.py: this mod's symlink to./Utilities/injector.pyxml_reloader.py: hotreloads the*.xmlfile configured inxml_reloader.py(e.g.,r.xml)
- Bash scripts (to be run with
./Scriptsas thecwd):compile.sh: compiles the specified mod and puts the*.ts4scriptfile in your Mods folder- Example:
sh ./compile.sh hotreload
- Example:
decompile.sh: decompiles The Sims 4 source code- Example:
sh ./decompile.sh
- Example:
- Utility scripts (to be symlinked into your mod folders/files as needed):
get_dir.py: easily fetch the directory of your mod, helpful for working with files your mod might generate or useinjector.py: inject your scripts into pre-existing game code (learn how to use here and see@inject_toin./Mods/hello_world/example_script.pyfor reference)
- Install Python 3.7.* (e.g., Python 3.7.12)
- You may already have
python3installed but it must be version 3.7.*! You can check withpython3 -V.
- You may already have
- Symlink the
python3executable into yourts4-modding-workspacefolder aspython3- Example:
ln -s /usr/local/Cellar/[email protected]/3.7.12_1/Frameworks/Python.framework/Versions/3.7/bin/python3.7 /ts4-modding-workspace/python3 - Tip: You can confirm the version on the local symlink with
./python3 -V.
- Example:
- Edit
./Utilities/settings.pyto point to the corresponding folders on your computer.- Tip: The included directories are from OSX, yours may vary!
- Don't use capital letters in mod folder or file names.
- Have ideas for improving the workspace? Fork and submit a PR back to the repository!
- Instead of duplicating your shared files, have one single source and symlink all references (e.g.,
ln -s /path/to/original /path/to/link)
This repository was made possible by:
