Forum Discussion
8 years ago
Not sure if you're still looking for help with this, but I was browsing and saw this. Realized it'd be quick to share a working example. Haven't looked at the code in a while, but this was a setup I copied the structure of from someone else (I'd give credit if I could remember who).
Here's an example. Enables you to do both multiple mixers per snippet and do more than one snippet type.
Hope this helps. :)
Here's an example. Enables you to do both multiple mixers per snippet and do more than one snippet type.
Hope this helps. :)
Triplis_SorcererTrait_Interactions_mixer_to_snippets =
@Triplis_SorcererTrait_Injector.inject_to(InstanceManager, 'load_data_into_class_instances')
def Triplis_Sorcerer_add_mixers_to_snippets(original, self):
original(self)
if self.TYPE == Types.SNIPPET:
# For each set of interaction ids and object ids...
for snippet_tun_hash in Triplis_SorcererTrait_Interactions_mixer_to_snippets:
# First, get a tuple containing the tunings for all the social mixers...
affordance_manager = services.affordance_manager()
mixer_list = []
for mixer_id in snippet_tun_hash:
key = sims4.resources.get_resource_key(mixer_id, Types.INTERACTION)
mixer_tuning = affordance_manager.get(key)
if not mixer_tuning is None:
mixer_list.append(mixer_tuning)
mixer_tuple = tuple(mixer_list)
# Now update the tunings for all the snippets in our snippet list
for snippet_id in snippet_tun_hash:
key = sims4.resources.get_resource_key(snippet_id, Types.SNIPPET)
snippet_tuning = self._tuned_classes.get(key)
if not snippet_tuning is None:
snippet_tuning.value = snippet_tuning.value + mixer_tuple
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.15,979 PostsLatest Activity: 2 minutes ago
Recent Discussions
- 13 minutes ago
- 15 minutes ago
- 17 minutes ago
- 35 minutes ago