Hello, I'm trying to inject multiple interactions to a snippet using python.
I've used "Scumbumbo's" code which worked on a "Single Interaction" only, adding more than one interaction to the "Mixer Id" didn't work.
import injector
import sims4.resources
from sims4.tuning.instance_manager import InstanceManager
from sims4.resources import Types
import services
SNIPPET_ID = 24511
MIXER_ID = 13984173314801262715
@injector.inject_to(InstanceManager, 'load_data_into_class_instances')
def add_mixer_to_snippet(original, self):
original(self)
if self.TYPE == Types.SNIPPET:
key = sims4.resources.get_resource_key(SNIPPET_ID, Types.SNIPPET)
snippet_tuning = self._tuned_classes.get(key)
if snippet_tuning is None:
return
affordance_manager = services.affordance_manager()
key = sims4.resources.get_resource_key(MIXER_ID, Types.INTERACTION)
mixer_tuning = affordance_manager.get(key)
if mixer_tuning is None:
return
snippet_tuning.value = snippet_tuning.value + (mixer_tuning, )
How can I modify this to make it accept more than one interaction in the "MIXER_ID" ?
Thank You very much.
Comments
Here's an example. Enables you to do both multiple mixers per snippet and do more than one snippet type.
Hope this helps.
Thank You so much! I got help by Basemental a while ago so I stopped checking this thread.
This will come in handy for future projects.
Much appreciated ♥