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!
Quick Reply
Search this Thread
Test Subject
Original Poster
#1 Old 27th Dec 2023 at 9:38 AM
Default How can I give every Sim a persistent custom buff?
Hiya, I'm newish to modding and have managed to get interactions and custom moodlets to work properly and would appreciate a little guidance

What I'm hoping to do (if it's even possible) is to give every human Sim a particular persistent buff when starting a new save. I have further plans but can't get anywhere until I do this first step and for the life of me I cannot figure it out.

As an example:

When you start up Sunset Valley, every Sim will start with a persistent buff called "Atheist".

This is what I have so far:

Code:

public static void OnWorldLoadFinishedHandler(object sender, EventArgs e)
		{
			
			EventTracker.AddListener(EventTypeId.kSimInstantiated, new ProcessEventDelegate(OnSimInstantiated));
			
			foreach (Sim sim in Sims3.Gameplay.Queries.GetObjects<Sim>())
			{
				if (sim != null)
				{
					AddInteraction(sim);
					AddAtheistBuff(sim);
					
				}
				
				
			}


This ended up causing my game to get stuck in an infinite loading screen so I've done something wrong

Is anyone able to steer me in the right direction or is this not possible at all?

Thanks!
Advertisement
Trainee Moderator
staff: trainee moderator
#2 Old 29th Dec 2023 at 6:25 PM
The code you provided is insufficient for anyone to help you.
What does "AddInteraction" do? What does "AddAtheistBuff" do? What does "OnSimInstantiated" do?
The part you gave doesn't seem wrong itself. It must be one of those methods causing error.
Back to top