r/TheSims4Mods • u/ModFoundry • 51m ago
How to Make Mods This is how I manage features in my Sims 4 mod versions.
During the development of my Schedule Mod, I built a mechanism that allowed me to enable or disable features depending on the mod's version.
This was especially useful when I was working on features for version 0.5 or 0.6, but users were requesting improvements, tweaks, or bug fixes for version 0.4. I needed a quick way to disable everything still under development for version 0.5 or 0.6, revert to the 0.4 source code, and continue releasing v0.4.x updates.
Initially, I placed version checks everywhere a feature appeared. I quickly realized this approach would be difficult to scale, so I decided to manage mod versions in a single place:
MOD_VERSION = ScheduleVersion.V0_4_2For each release, I define the supported activities as follows:
V0_2_ACTIVITIES = {
"go_jogging",
"reading",
"sleeping",
}
V0_3_ACTIVITIES = V0_2_ACTIVITIES.union({
"showering",
"cooking",
"watchingTV",
})For larger features, I use small checks with descriptive names:
def is_task_groups_enabled():
return is_version_available("v0.5")This way, the rest of the code just asks if a feature is available. It doesn't need to know which release originally introduced that feature.
It's a small model, but it allows me to maintain a single source code instead of multiple nearly identical branches.
How do you manage features across different versions of your mod?


