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!
Field Researcher
Original Poster
#1 Old 21st Aug 2015 at 5:34 AM
Default Event Tracker for new game created
I'm having a problem with a mod: it works fine, except for when I create a new game. When starting a new game from the Main Menu, none of my alarms or event trackers that are in "OnWorldLoadFinished" are started.

What do I need to do to get them to start in a new game? Is there another game state that I somehow overlooked?
Advertisement
1978 gallons of pancake batter
#2 Old 21st Aug 2015 at 6:19 AM
You mean it works when you load an existing hood, but not when you start a new one? Interesting. Is it the same behavior no matter if you start the new game right after loading the game or loading an existing game, returning to the main menu and then starting a new game? Can you show your code?

If gotcha is all you’ve got, then you’ve got nothing. - Paul Krugman
Field Researcher
Original Poster
#3 Old 21st Aug 2015 at 6:57 AM
Quote: Originally posted by Buzzler
You mean it works when you load an existing hood, but not when you start a new one? Interesting. Is it the same behavior no matter if you start the new game right after loading the game or loading an existing game, returning to the main menu and then starting a new game? Can you show your code?


Yes, it is the same behavior.

I have it set up so that it displays a series of notifications if the lot is an Apartment lot. I have been doing this: Starting a new game, choosing a household, going to Edit Town, and changing a lot into an Apartment lot. Move a family into the Apartment lot, and the messages do not come up ... and the game then does not recognize any of the new interactions I've changed for my Roommates Fix mod... until I save, go back to main menu, and load the newly created game again. Here's the code: (probably just the parts you need):

Instructor
#4 Old 22nd Aug 2015 at 4:19 AM
I'm not so familiar with how your mod works (as I haven't been following your another thread here) but I just noticed this:
Code:
EventTracker.AddListener(EventTypeId.kHouseholdSelected, new ProcessEventDelegate(OnHouseholdChanged));


Is there a specific reason why you use this listener? As far as my knowledge goes it isn't really used by modders, I'd go with the Sim Instantiated one (forgot the specific name, find it on NRaas's Design and Discussion pages). In fact I think the differences between all the loadup events are not really known for now. But probably it's just me.
Field Researcher
Original Poster
#5 Old 22nd Aug 2015 at 4:24 AM
Quote: Originally posted by SimsMatthew
I'm not so familiar with how your mod works (as I haven't been following your another thread here) but I just noticed this:
Code:
EventTracker.AddListener(EventTypeId.kHouseholdSelected, new ProcessEventDelegate(OnHouseholdChanged));


Is there a specific reason why you use this listener? As far as my knowledge goes it isn't really used by modders, I'd go with the Sim Instantiated one (forgot the specific name, find it on NRaas's Design and Discussion pages). In fact I think the differences between all the loadup events are not really known for now. But probably it's just me.


Oh, because I want it to check for stuff when the Active Household changes. I use that to re-set the roommate status and the number of roommates on each lot where it's enabled. If it doesn't check when it switches households, it doesn't work...
Instructor
#6 Old 22nd Aug 2015 at 2:30 PM
By reading through your code more clearly:
1. Why do you define the interaction singletons OnPreLoad? Is there a specific reason?
2. I suddenly think about the problem I've talked about before: the world is "instantiated", but the objects / sims aren't, especially in big worlds. That means, OnWorldLoadFinished doesn't mean all your required targets are properly loaded. You may want to ensure an active household actually exists in a world using the method I've PM-ed you and then implement the rest of the stuff.
Field Researcher
Original Poster
#7 Old 22nd Aug 2015 at 4:37 PM
Quote: Originally posted by SimsMatthew
By reading through your code more clearly:
1. Why do you define the interaction singletons OnPreLoad? Is there a specific reason?
2. I suddenly think about the problem I've talked about before: the world is "instantiated", but the objects / sims aren't, especially in big worlds. That means, OnWorldLoadFinished doesn't mean all your required targets are properly loaded. You may want to ensure an active household actually exists in a world using the method I've PM-ed you and then implement the rest of the stuff.


To be honest, I was still new to all this back then, and I either copied it from a tutorial or someone here suggested I do that. Either way, that part works! Just not the alarms I have set up...
Back to top