Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!
Test Subject
Original Poster
#1 Old 3rd Sep 2019 at 6:57 AM Last edited by TOC : 3rd Sep 2019 at 8:03 AM.
Default Can someone help me figure out what's wrong with my script?
I can get the phone interaction to work perfectly, but for some reason, the computer doesn't have any interaction whatsoever unless I completely delete that part of the script. I think it might have something to do with it not importing objects.game_object. It says it's an unused import statement. What is going on??

import services
import tocinjector
import objects.game_object
import sims4.resources
from sims4.tuning.instance_manager import InstanceManager
from sims4.resources import Types
import sims.sim

TM_Core_List = []

TOC_SKWeb_PC_sa_instance_ids = (17625649156219832435, )
TOC_SkWeb_PC_object_ids = (77507, 36370, 36369, 34678, 34679, 34684, 34682, 40340, 34680, 112485, 14845, 202931, 202932, 211714, )
TM_Core_List.append((TOC_SKWeb_PC_sa_instance_ids, TOC_SkWeb_PC_object_ids))

@tocinjector.inject_to(InstanceManager, 'load_data_into_class_instances')
def add_superaffordances(original, self):
original(self)
for (inst, obj) in TM_Core_List:
if self.TYPE == Types.OBJECT:
affordance_manager = services.affordance_manager()
sa_list = []
for sa_id in inst:
key = sims4.resources.get_resource_key(sa_id, Types.INTERACTION)
sa_tuning = affordance_manager.get(key)
if not sa_tuning is None:
sa_list.append(sa_tuning)
sa_tuple = tuple(sa_list)

# Now update the tunings for all the objects in our object list
for obj_id in obj:
key = sims4.resources.get_resource_key(obj_id, Types.OBJECT)
obj_tuning = self._tuned_classes.get(key)
if not obj_tuning is None:
obj_tuning._super_affordances = obj_tuning._super_affordances + sa_tuple

TOC_SKWeb_phone_sa_instance_ids = (17935178088851905240,)


@tocinjector.inject_to(sims.sim.Sim, 'on_add')
def TOC_SKWeb_phone_add_phone_affordances(original, self):
original(self)
sa_list = []
affordance_manager = services.affordance_manager()
for sa_id in TOC_SKWeb_phone_sa_instance_ids:
tuning_class = affordance_manager.get(sa_id)
if not tuning_class is None:
sa_list.append(tuning_class)
self._phone_affordances = self._phone_affordances + tuple(sa_list)


**Update** It only causes ALL interactions with any computer stop when I involve a custom pie menu. I can put my interactions into an already-made pie menu, but that's it.**

Is there anyway for me to make my own pie menu???
Back to top