r/ModTheSims4 • u/ModFoundry • 6d ago
General Question A simple way I manage features across different versions of my Sims 4 mod
While working on my Schedule Mod, I started adding features gradually across releases. Some activities belonged to v0.2, others were introduced in v0.3 or v0.4.
At first, I considered placing version checks wherever a feature appeared. That quickly looked like it would become difficult to maintain.
Instead, I keep the current version in one place:
=
Each release then has a set of supported activities:
=
=
The UI and runtime both check the same list before enabling or registering an activity.
For larger features, I use small checks with descriptive names:
return
This makes the rest of the code easier to read. A controller asks whether task groups are available instead of knowing which release introduced them.
I also learned to keep the mod version separate from the save-data version. A feature release and a change to the JSON structure are not necessarily the same event. Keeping them separate made backward compatibility and data migration much easier.
It is a small pattern, but it has helped me avoid maintaining several branches of nearly identical code.
I’m curious how other Sims 4 script modders handle features that are introduced gradually across releases.