Forum Discussion
8 years ago
Yes, it seems like it's the return that allowed you to skip the original part in the ensure_age_based_career. Injections aren't meant for overwriting completely functions, but to add some behavior either before or after the original one, at least that's what I understood :) Deaderpool has a post explaining how injections work here : http://modthesims.info/showthread.php?p=4751246#post4751246
You could simply overwrite the fucntion with something like
or you could do something like this if you want to keep the original code in case there's some change in it :
You could simply overwrite the fucntion with something like
def my_verify_school(self, from_age_up):
if from_age_up or self._time_sim_was_saved is None:
if self.is_child:
self.create_homework(self.CHILD_HOMEWORK)
elif self.is_teen:
self.create_homework(self.TEEN_HOMEWORK)
if from_age_up:
self.update_school_career()
sims.sim_info.SimInfo.verify_school = my_verify_school
or you could do something like this if you want to keep the original code in case there's some change in it :
def my_verify_school(original, self, from_age_up):
if from_age_up
original(self, from_age_up)
About The Sims 4 Mods & Custom Content
Find expert tips, troubleshooting help, tutorials for mods and custom content, and The Sims 4 patch files in our forum.14,700 PostsLatest Activity: 3 years ago
Recent Discussions
- 2 hours ago
- 2 hours ago
- 4 hours ago
- 7 hours ago
- 8 hours ago