Since I can't figure out how to get my mods working I figure I'll post the code I created for my Food Baby mod hopefully someone can get them working or if need be rebuild it from the ground up, here it is. <Buff>
<BuffTuning>
<BuffName>FoodBabyBuff</BuffName>
<Duration>auto</Duration>
<Stages>
<BuffStage>
<Stage>1</Stage>
<Moodlet>Buff_FoodBaby_Dazed_Stage1</Moodlet>
</BuffStage>
<BuffStage>
<Stage>2</Stage>
<Moodlet>Buff_FoodBaby_Dazed_Stage2</Moodlet>
</BuffStage>
<BuffStage>
<Stage>3</Stage>
<Moodlet>Buff_FoodBaby_Dazed_Stage3</Moodlet>
</BuffStage>
</Stages>
</BuffTuning>
</Buff>
import sims4.commands
from sims4.tuning.tunable import HasTunableSingletonFactory, AutoFactoryInit, TunableReference, Tunable
class FoodBabyBuff(AutoFactoryInit, HasTunableSingletonFactory):
FACTORY_TUNABLES = {
'moodlet': TunableReference(description='Moodlet applied when sim has the Food Baby buff.'),
'swimming_interaction': TunableReference(description='Interaction to remove the Food Baby buff when sim swims.'),
'treadmill_interaction': TunableReference(description='Interaction to remove the Food Baby buff when sim uses the treadmill.'),
}
@staticmethod
def remove_food_baby_buff(sim_info):
# Remove the Food Baby buff from the sim
sim_info.buffs.remove_buff_by_type('FoodBabyBuff')
def on_addition(self, sim_info):
# Apply the Food Baby buff and dazed moodlet to the sim
sim_info.buffs.add_buff(self.moodlet)
def on_removal(self, sim_info):
# Clean up any necessary actions when the buff is removed
pass
FoodBabyBuff.TunableFactory()
sims4.commands.Command('sims.add_food_baby_buff')
def add_food_baby_buff(_connection=None):
# Command to add the Food Baby buff to the active sim
active_sim_info = services.active_sim_info()
active_sim_info.buffs.add_buff(FoodBabyBuff.TunableFactory().default)
class FoodBabyBuff(AutoFactoryInit, HasTunableSingletonFactory):
FACTORY_TUNABLES = {
# ...
'feel_food_baby_interaction': TunableReference(description='Interaction to feel the Food Baby.'),
}
def on_addition(self, sim_info):
# Apply the Food Baby buff and dazed moodlet to the sim
sim_info.buffs.add_buff(self.moodlet)
sim_info.walk_style = 'pregnant' # Change the walk style to pregnant
# Add the interaction to feel the food baby
sim_info.add_interaction(self.feel_food_baby_interaction())
# ...
class FeelFoodBabyInteraction(super_interaction.SuperInteraction):
def run_interaction_gen(self, timeline):
# Implement the logic for the feel food baby interaction
pass
# Register the FeelFoodBabyInteraction as a custom interaction
sims4.commands.Command('sims.register_feel_food_baby_interaction')
def register_feel_food_baby_interaction(_connection=None):
interaction_utils.register_super_interaction(FeelFoodBabyInteraction, 'FeelFoodBabyInteraction')
# Icon Path
ICON_PATH = 'path/to/buff_icon.png'
# Localization Strings
def _load_string_table():
strings = {
# Buff Name
'buff_FoodBabyBuff': 'Food Baby',
# Buff Moodlets
'buff_FoodBaby_Dazed_Stage1': 'Dazed - Trimester 1',
'buff_FoodBaby_Dazed_Stage2': 'Dazed - Trimester 2',
'buff_FoodBaby_Dazed_Stage3': 'Dazed - Trimester 3',
}
return strings
# Register the strings table
sims4.commands.Command('sims.register_string_table')
def register_string_table(_connection=None):
localization.register_strings('foodbaby', _load_string_table())
# Packaging the Buff Icon
sims4.commands.Command('sims.package_buff_icon')
def package_buff_icon(_connection=None):
sim_info = services.active_sim_info()
icon_resource = icons.IconResource(ICON_PATH)
sim_info.buffs.add_icon('FoodBabyBuff', icon_resource)
class FeelFoodBabyInteraction(super_interaction.SuperInteraction):
def on_started(self, *args, **kwargs):
super().on_started(*args, **kwargs)
self.add_statistic(self.sim_info.buffs.get_statistic_type('buffs_received'))
def on_interaction_start(self):
self.start_carry('generic')
def on_interaction_cancel(self):
self.stop_carry('generic')
def on_carried_object_change(self, carried_object):
if carried_object is None:
# Interaction completed, remove the Food Baby buff
self.sim_info.buffs.remove_buff_by_type('FoodBabyBuff')
self.stop_carry('generic')
else:
# Still carrying the object, play appropriate animations or effects
pass
def get_carried_object(self):
# Return the carried object (can be a dummy object)
return None
def generate_carried_object(self):
# Generate and return the carried object (can be a dummy object)
return None
def get_carried_object_visual_target(self):
# Return the visual target for the carried object (can be None)
return None
def on_carried_object_visual_target_change(self, visual_target):
pass
def on_carried_object_visual_target_done(self):
pass
def on_interaction_performed(self):
pass
sims4.commands.Command('sims.add_food_baby_buff')
def add_food_baby_buff(_connection=None):
active_sim_info = services.active_sim_info()
active_sim_info.buffs.add_buff(FoodBabyBuff.TunableFactory().default)
<TriggeredBuff id="FoodBabyTrigger" >
<DisplayName>Food Baby</DisplayName>
<Description>Aww, looks like someone's got a food baby...</Description>
<MaxOccurrences>1</MaxOccurrences>
<AllowanceFlags value="128"/>
<DisallowanceFlags value="0"/>
<ConditionString> (Buff_Duration(FoodBabyTrimester1) == -1) and (Buff_Duration(FoodBabyTrimester2) == -1) and (Buff_Duration(FoodBabyTrimester3) == -1) and (NumServingsEatenInRow >= 4)</ConditionString>
<BuffData>
<BuffName>FoodBabyTrimester1</BuffName>
</BuffData>
<EffectData>
<Effect type="PlayFX" val="bfx_buff_foodbaby"/>
<Effect type="PlaySound" val="SFX_Gen_Buff_Earned"/>
</EffectData>
</TriggeredBuff>
<TriggeredBuff id="FoodBabyTrimester1To2Trigger" >
<DisplayName>Food Baby Trimester 1 to 2</DisplayName>
<Description>Time for the second course...</Description>
<MaxOccurrences>1</MaxOccurrences>
<AllowanceFlags value="128"/>
<DisallowanceFlags value="0"/>
<ConditionString> (Buff_Duration(FoodBabyTrimester1) > 0) and (Buff_Duration(FoodBabyTrimester2) == -1) and (NumServingsEatenInRow >= 4)</ConditionString>
<BuffData>
<BuffName>FoodBabyTrimester2</BuffName>
</BuffData>
<EffectData>
<Effect type="PlayFX" val="bfx_buff_foodbaby_transition"/>
<Effect type="PlaySound" val="SFX_Gen_Buff_Transition"/>
</EffectData>
</TriggeredBuff>
<TriggeredBuff id="FoodBabyTrimester2To3Trigger" >
<DisplayName>Food Baby Trimester 2 to 3</DisplayName>
<Description>It's getting bigger...</Description>
<MaxOccurrences>1</MaxOccurrences>
<AllowanceFlags value="128"/>
<DisallowanceFlags value="0"/>
<ConditionString> (Buff_Duration(FoodBabyTrimester2) > 0) and (Buff_Duration(FoodBabyTrimester3) == -1) and (NumServingsEatenInRow >= 4)</ConditionString>
<BuffData>
<BuffName>FoodBabyTrimester3</BuffName>
</BuffData>
<EffectData>
<Effect type="PlayFX" val="bfx_buff_foodbaby_transition"/>
<Effect type="PlaySound" val="SFX_Gen_Buff_Transition"/>
</EffectData>
</TriggeredBuff>
<Effect type="BoneScale" val="Belly" weight="1.0" x="1.05" y="1.05" z="1.05"/>
<Effect type="BoneScale" val="Belly" weight="1.0" x="1.1" y="1.1" z="1.1"/>
<Effect type="BoneScale" val="Belly" weight="1.0" x="1.15" y="1.15" z="1.15"/>