Post by oxojessi on Feb 24, 2019 12:04:25 GMT -5
Hey guys,
So I'm a bit stuck. I'm trying to create a confess to cheating mod (based on the breakup interaction) and the amazing scumbumbos script doesn't seem to work for me. The mod works alright when I manually add it to the xmls but when I try to input it into the script, it doesn't show up. So I don't have a clue where I'm screwing up (maybe it's a compiling issue, but I'm not sure how to double check that it actually compiled what it was supposed to but I based it off of these instructions so I figured it must be okay.)
The Social Mixers
n="social_Mixers_Mean_NonTouching_ForReference" s="163706"
n="social_Mixers_Mean_NonTouching" s="24511"
In case it helps, I've uploaded my mod below (one version without above manual social mixers and one with)
Here are the scumbumbos scripts I've tried but failed
import injector
import sims4.resources
from sims4.tuning.instance_manager import InstanceManager
from sims4.resources import Types
import services
SNIPPET_ID = 24511
MIXER_ID = 12617662110556936800
@injector.inject_to(InstanceManager, 'load_data_into_class_instances')
def add_mixer_to_snippet(original, self):
# Let the original function finish up its work
original(self)
# This function gets called once for each tuning type, so by only running this if we're specifically
# working on the snippets, we can just get that snippet directly using the key rather than looping
# through all the instances to and checking the guids. The same tactic works for getting the tuning
# straight for the mixer interaction directly from the affordance manager.
if self.TYPE == Types.SNIPPET:
# Get the snippet tuning
key = sims4.resources.get_resource_key(SNIPPET_ID, Types.SNIPPET)
snippet_tuning = self._tuned_classes.get(key)
# Check that we found it....
# If we were running in a loop, we'd probably want to skip to the next iteration
# rather than just returning if the snippet id is invalid.
if snippet_tuning is None:
return
# Get the mixer from the affordance manager
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
# Add the mixer tuning to the snippet's value (a tuple)
snippet_tuning.value = snippet_tuning.value + (mixer_tuning, )
import injector
import sims4.resources
from sims4.tuning.instance_manager import InstanceManager
from sims4.resources import Types
import services
SNIPPET_IDS = (24511, 163706)
MIXER_ID = 12617662110556936800
@injector.inject_to(InstanceManager, 'load_data_into_class_instances')
def add_mixer_to_snippet(original, self):
original(self)
if self.TYPE == Types.SNIPPET:
# Just get the mixer tuning once, outside the loop
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
# Loop through all the snippets in the SNIPPET_IDS and add the mixer
for snippet_id in SNIPPET_IDS:
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_tuning, )
Any help would be appreciated.
(I have some a spare humble bundle game code for Snake Pass or Life is Strange Complete (via Steam). I can gift ya, if you want them and can point me in the right direction!) Thanks