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 13th Jul 2016 at 6:10 AM Last edited by pjsutton : 13th Jul 2016 at 4:37 PM.
Default How to check if a Sim owns addotional properties
I'm trying to find a way to check if a household owns any additional properties in the current world, and then show a message that displays that at a certain time. I think this might be helpful:


Code:
public static List<LocationHomeDeed> GetAllDeedsForHouseholdForWorld(Household household, WorldName world, bool bIncludeDuplicates)
{
	List<LocationHomeDeed> list = new List<LocationHomeDeed>();
	if (household != null)
	{
		Dictionary<ulong, bool> dictionary = new Dictionary<ulong, bool>();
		foreach (Sim current in household.Sims)
		{
			foreach (LocationHomeDeed current2 in current.Inventory.FindAll<LocationHomeDeed>(false))
			{
				if (current2.World == world && !dictionary.ContainsKey(current2.LotId))
				{
					if (!bIncludeDuplicates)
					{
						dictionary.Add(current2.LotId, true);
					}
					list.Add(current2);
				}
			}
		}
	}
	return list;
}



But I'm not sure what to do with the parameters. If I run this method, how could I use it to decide if the current household owned something? This seems to me like it would just create a list of who owns properties.

Anyone ever use this before?
Advertisement
Virtual gardener
staff: administrator
#2 Old 13th Jul 2016 at 10:05 AM
It looks like a empty list to me, I'm not sure what file you're opening or just a random script/XML from somewhere in the game itself.
Field Researcher
Original Poster
#3 Old 13th Jul 2016 at 4:37 PM
Quote: Originally posted by Greenplumbbob
It looks like a empty list to me, I'm not sure what file you're opening or just a random script/XML from somewhere in the game itself.


!@&^#@!@ I just noticed the first lin got cut off! It's supposed to be:

Code:
public static List<LocationHomeDeed> GetAllDeedsForHouseholdForWorld(Household household, WorldName world, bool bIncludeDuplicates)


It's in Sims3.Gameplay.Locations.LocationHomeDeed
Field Researcher
Original Poster
#4 Old 13th Jul 2016 at 6:07 PM
Ok, I figured out that if I use

Code:
if (Household.ActiveHousehold.RealEstateManager != null)


it works, because owning a lot means the Real Estate Manager has been activated. But now I want to be able to determine what property they own, to get its Lot ID, address, etc.
Virtual gardener
staff: administrator
#5 Old 13th Jul 2016 at 6:58 PM
I think the game does that with Instances. Sometimes it does it with names though. So it could be either these two. I'm still wondering what file you're opening here. Is it from your own saves? Because I was able to find the XML tuning file for the LocationHomeDeed so there is likely a linked script to it which you just opened up.
Field Researcher
Original Poster
#6 Old 13th Jul 2016 at 11:03 PM
Quote: Originally posted by Greenplumbbob
I think the game does that with Instances. Sometimes it does it with names though. So it could be either these two. I'm still wondering what file you're opening here. Is it from your own saves? Because I was able to find the XML tuning file for the LocationHomeDeed so there is likely a linked script to it which you just opened up.


It's a script in one of the DLL files - Sims3GameplaySystems.

What instance should I search for? I've done lots of searching of the code in IL-Spy and can't find anything directly related to that, being able to find the properties they own and getting its address, Lot ID, etc.

This is all for a mod about getting rental income on owned properties and being able to play as a "landlord." You can sort of do this with NRaas Story Progression, but it's pretty basic.
Virtual gardener
staff: administrator
#7 Old 14th Jul 2016 at 6:23 PM
Sounds like an awesome mod! But I don't think the answer of one active lot is in the DLL script files of the sims3gameplaysystem. I guess the game uses the script to 'fill' the information in inside the save files. Maybe it's even in the Meta.data files.
Field Researcher
Original Poster
#8 Old 14th Jul 2016 at 9:25 PM
Quote: Originally posted by Greenplumbbob
Sounds like an awesome mod! But I don't think the answer of one active lot is in the DLL script files of the sims3gameplaysystem. I guess the game uses the script to 'fill' the information in inside the save files. Maybe it's even in the Meta.data files.


It's going to be an update to this one that I made: http://modthesims.info/download.php?t=554197

No, it's somewhere. Just gotta find the right function to call!
Field Researcher
Original Poster
#9 Old 19th Jul 2016 at 7:38 AM
UPDATE: I have it *almost* figured out! Just trying to get it to give me the number of Sims that live on a current lot that may be owned!
Back to top