- Site Map >
- Modding and Creation >
- Sims 4 Creation >
- Modding Discussion >
- [Resolved]Injecting custom interactions
- Site Map >
- Modding and Creation >
- Sims 4 Creation >
- Modding Discussion >
- [Resolved]Injecting custom interactions
Replies: 1 (Who?), Viewed: 560 times.
#1
27th Jan 2020 at 3:33 PM
Last edited by Erisa : 30th Jan 2020 at 6:29 AM.
Reason: Marking as resolved
Posts: 27
Thanks: 2 in 1 Posts
[Resolved]Injecting custom interactions
Edit:Greetings. I decided to edit the question to look less blurry.
I am having trouble injecting custom interactions in the career I am making.
I wish to use those interactions as work from home assignments. If I use vanilla interactions, like "Jog" or "Workouts for 8 hours", it works. At least, it works when I use vanilla promotion tasks.
But when I try to use a custom interaction, there is nothing.
This is the snippet of the code I used to inject on computers:
Code:
import injector import services import sims4.resources from sims4.tuning.instance_manager import InstanceManager from sims4.resources import Types Erisaren_ContractKiller_ObjectIds_Computer = (14845, 36370, 34678, 34680, 211714, 34684, 36369, 202931, 34682, 34679, 77507, 40340, 202932, 112485, 216358, 224975) Erisaren_ContractKiller_InteractionIds_Computer = (14060147464684786163, 12992379042537101572, 17991661174693444353) @injector.inject_to(InstanceManager, 'load_data_into_class_instances') def Erisaren_ContractKiller_add_superaffordances(original, self): original(self) if self.TYPE == Types.OBJECT: affordance_manager = services.affordance_manager() sa_list = [] for sa_id in Erisaren_ContractKiller_InteractionIds_Computer: key = sims4.resources.get_resource_key(sa_id, Types.INTERACTION) sa_tuning = affordance_manager.get(key) if sa_tuning is not None: sa_list.append(sa_tuning) sa_tuple = tuple(sa_list) for obj_id in Erisaren_ContractKiller_ObjectIds_Computer: key = sims4.resources.get_resource_key(obj_id, Types.OBJECT) obj_tuning = self._tuned_classes.get(key) if obj_tuning is not None: obj_tuning._super_affordances = obj_tuning._super_affordances + sa_tuple
Is there any suggestion? I compared with other mods and I really see nothing odd.
Advertisement
#2
30th Jan 2020 at 6:24 AM
Posts: 27
Thanks: 2 in 1 Posts
Long story short.
I was compiling manually instead of using the compile tool from the workspace.
Pretty silly. I didn't know it mattered how it was compiled.
Good thing it is probably the last question I will ask.
*leaves with embarrassment*
I was compiling manually instead of using the compile tool from the workspace.
Pretty silly. I didn't know it mattered how it was compiled.
Good thing it is probably the last question I will ask.
*leaves with embarrassment*
Who Posted
|