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
#51 Old 15th Aug 2015 at 7:19 AM Last edited by pjsutton : 15th Aug 2015 at 7:58 AM.
If anyone is still reading this ... I hope so! ... I'm having a problem with the HouseholdUpdateEvent:



The HouseholdUpdate does what I want it to the first time I switch active households, but then never again. I have this in my OnWorldLoadFinished:

Code:
 EventTracker.AddListener(EventTypeId.kHouseholdSelected, new ProcessEventDelegate(RestoreRoommateStatus)); 



Did I forget something somewhere? Do I need to put a "ListenerAction.Remove" somewhere?

I (sort of) think that I got this to work - I have multiple lots with roommates on them at the same time! I'm having a problem though ... let me share this:



One of the problems I'm having is that the "first" roommate on Lot A that it saves also reappears in Lot B when I switch. When I go back to Lot A, it also re-adds the same person. And that person keeps going back and forth. I don't understand if it's a problem with my code with all the "activeLotId" changes going on or not.

I didn't post the rest of the code because it doesn't really pertain to these 3 methods... Hopefully someone can follow my way of thinking there with all the for each loops. It looks convoluted, but I used a similar process for creating a list of lot IDs and adding it a set number of times based on how many roommates are selected, and then retrieving that number by counting the number of IDs == Household.Active Household.LotId. and that works successfully.
Advertisement
Field Researcher
Original Poster
#52 Old 16th Aug 2015 at 6:34 AM
Well ........... now I feel like a complete idiot! Somehow in one of my re-writes I borked up my .package file - the XML did not have my Namespace.Class for some reason.

I started completely over with a new package file and made a new The Sims 3 folder for testing purposes and only put in my mod and NoIntro - and it's working again! The HouseholdUpdateEvent it working perfectly now. And I currently -- somehow -- have 1 household with 5 roommates, another with 1. The numbers aren't quite right, but that's an entirely different issue to deal with!

So, thanks for the help -- even though it was mostly my (embarrassing!) problem - I really do feel pretty dumb about the whole thing right now...
Field Researcher
Original Poster
#53 Old 18th Aug 2015 at 6:04 AM
I finally have it working the way I want! I have multiple sets of roommates on multiple lots, and they stay there -- or at least the correct number will stay there when I switch active households!

The inherent "problem" is that EA uses a list of roommates "mRoommates" that they create and add to when roommates are enabled - which is fine. BUT, when running RoommateValidation (which adds the roommate), there is a part that uses the current number of roommates to determine how many should be added. All they do to get this number is mRoommates.Count - so, if you have roommates on one lot and then go to another to add more, it's still counting the previous ones. I copied/pasted the parts of RoommateValidation where that happens and added it to my custom one - which I'd already edited to change the way rent was collected. I simply changed the line that references mRoommates.Count and changed it to a function that counts roommates on the current lot and Voila! IT WORKS! Other parts of the roommate manager still refernce mRoommates, but they don't try to count it (they only add or remove items from it) so they still seem to function normally...
Page 3 of 3
Back to top