Target_function = getattr(target_object, target_function_name) Return new_function(target_function, *args, **kwargs)ĭef inject_to(target_object, target_function_name): If not, you can use the following:ĭef inject(target_function, _inject(*args, **kwargs): If you already have an injector, skip this step.
Injectors are used to insert your code into the game's code. It is assumed that you already have your custom trait(s) made, and that you are at least somewhat familiar with Python scripting. Please view the updated tutorial on Medium.Īre you making a mod that has custom traits? Do any of those traits need to be automatically assigned to all of the sims in the game? This tutorial will show you one quick way to achieve that.