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 7th Feb 2018 at 11:11 AM
Custom Scripted Interaction not showing up Ingame
Hi everyone, so I'm trying to make an interaction where Sims can start dancing by clicking on the sim and choosing to Snap It from the Dance Pie Menu. But for some reason, it doesn't show up in the game? The Python code doesn't contain any errors, but it still doesn't work. So it would be nice if you guys could help me out. Cheers.

Code:
import services
import injector
import sims.sim as sims
InteractionsPack_sa_instance_ids = (0xC0B144EE6E0536C9L, 0x92AD2D96F34F9121L, 0x15967396231450808)

def InteractionsPack_add_super_affordances(original, self):
    original(self)
    sa_list = []
    affordance_manager = services.affordance_manager()
    for sa_id in InteractionsPack_sa_instance_ids:
        tuning_class = affordance_manager.get(sa_id)
        if tuning_class is not None:
            sa_list.append(tuning_class)
            continue
    self._super_affordances = self._super_affordances + tuple(sa_list)

InteractionsPack_add_super_affordances = injector.inject_to(sims.sim.Sim, 'on_add')(InteractionsPack_add_super_affordances)
Advertisement
Test Subject
#2 Old 7th Feb 2018 at 2:17 PM
Quote: Originally posted by gianny6
Hi everyone, so I'm trying to make an interaction where Sims can start dancing by clicking on the sim and choosing to Snap It from the Dance Pie Menu. But for some reason, it doesn't show up in the game? The Python code doesn't contain any errors, but it still doesn't work. So it would be nice if you guys could help me out. Cheers.

Code:
import services
import injector
import sims.sim as sims
InteractionsPack_sa_instance_ids = (0xC0B144EE6E0536C9L, 0x92AD2D96F34F9121L, 0x15967396231450808)

def InteractionsPack_add_super_affordances(original, self):
    original(self)
    sa_list = []
    affordance_manager = services.affordance_manager()
    for sa_id in InteractionsPack_sa_instance_ids:
        tuning_class = affordance_manager.get(sa_id)
        if tuning_class is not None:
            sa_list.append(tuning_class)
            continue
    self._super_affordances = self._super_affordances + tuple(sa_list)

InteractionsPack_add_super_affordances = injector.inject_to(sims.sim.Sim, 'on_add')(InteractionsPack_add_super_affordances)


The following code works for me. I think for the SA id's you have to use the tuningid instead of the hex.

Code:
import services
import injector
import sims.sim

sa_instance_ids = (000000000000000, )
    
@injector.inject_to(sims.sim.Sim, 'on_add')
def add_super_affordances(original, self):
    original(self)
    sa_list = []
    affordance_manager = services.affordance_manager()
    for sa_id in sa_instance_ids:
        tuning_class = affordance_manager.get(sa_id)
        if not tuning_class is None:
            sa_list.append(tuning_class)
    self._super_affordances = self._super_affordances + tuple(sa_list)
Test Subject
Original Poster
#3 Old 7th Feb 2018 at 5:23 PM
Quote: Originally posted by krullehoofd
The following code works for me. I think for the SA id's you have to use the tuningid instead of the hex.

Code:
import services
import injector
import sims.sim

sa_instance_ids = (000000000000000, )
    
@injector.inject_to(sims.sim.Sim, 'on_add')
def add_super_affordances(original, self):
    original(self)
    sa_list = []
    affordance_manager = services.affordance_manager()
    for sa_id in sa_instance_ids:
        tuning_class = affordance_manager.get(sa_id)
        if not tuning_class is None:
            sa_list.append(tuning_class)
    self._super_affordances = self._super_affordances + tuple(sa_list)


Alright let me try that out fellow dutch man (i am also dutch)
Back to top