Forum Discussion
SacrificialsMods
9 years agoNew Vanguard
when I changed it to "__init__" I got an error saying "script Attempting to access the terrain object before it is created." in the last exception file.
Thanks for the suggestion though, I really appreciate it, I'll keep trying & hopefully I'll get it to work
EDIT: I've finally found a code that adds interactions to terrain object by "batman101
from Sims 4 Occult Life State: Succubus mod.
This is the working code to add interactions to a terrain via python
Thanks for the suggestion though, I really appreciate it, I'll keep trying & hopefully I'll get it to work
EDIT: I've finally found a code that adds interactions to terrain object by "batman101
from Sims 4 Occult Life State: Succubus mod.
This is the working code to add interactions to a terrain via python
import services
import injector
import sims4.resources
from sims4.tuning.instance_manager import InstanceManager
from sims4.resources import Types
DG_DeadlyToddlers_Interactions_ObjectTerrain_sa_instance_ids = (13434953397345340498, 11438713963126644620, 15313978156997466037,)
DG_DeadlyToddlers_Interactions_ObjectTerrain_object_ids = (14982,)
@injector.inject_to(InstanceManager, 'load_data_into_class_instances')
def add_superaffordances(original, self):
original(self)
if self.TYPE == Types.OBJECT:
affordance_manager = services.affordance_manager()
sa_list = []
for sa_id in DG_DeadlyToddlers_Interactions_ObjectTerrain_sa_instance_ids:
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)
for obj_id in DG_DeadlyToddlers_Interactions_ObjectTerrain_object_ids:
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