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!
Instructor
Original Poster
#1 Old 11th Nov 2019 at 12:40 AM
Default Making a social interaction : "Who do you live with?"
Hello, I hope you are all doing well!

I'm trying to add a new social interaction that displays the names of other sims in the target's household.
I followed this great tutorial :
http://www.modthesims.info/showthread.php?t=491875

So far I've tried using the method : " target.HouseholdSims.Name "
and also : " GetHouseholdSims() "

But as you can see in the picture this is not the good method for what I intend to do ^^'


If any of you has tips for what I'm trying to do (I'm a big noob haha!), any help will be greatly appreciated :D
Screenshots
Attached files:
File Type: rar  NouvelEssai.rar (3.9 KB, 13 downloads) - View custom content
Advertisement
Space Pony
#2 Old 11th Nov 2019 at 5:03 PM Last edited by Battery : 11th Nov 2019 at 5:13 PM.
Hey Anitaka00,
what youre doing right now is putting out the name of the list. You need to loop through the content of the list like that instead


Code:
                        string message = "";
			for (int i = 0; i < target.Household.SimDescriptions.Count; i++) 
                        {
				message += target.Household.SimDescriptions[i].FirstName; // add each name to the message
			}


E: ofc you could also add conditions in the statement so if the target is married he or she could mention that he/she lives with his/her wife/husband etc

kind regards and best of luck with your mod
Instructor
Original Poster
#3 Old 11th Nov 2019 at 5:05 PM Last edited by Anitaka00 : 11th Nov 2019 at 8:49 PM.
Quote: Originally posted by Battery
Hey Anitaka00,
what youre doing right now is putting out the name of the list you need to loop trough the content of the list like that


Code:
                        string message = "";
			for (int i = 0; i < target.Household.SimDescriptions.Count; i++) 
                        {
				message += target.Household.SimDescriptions[i].FirstName; // add each name to the message
			}




Thank you very much Battery, I'm going to try that right now :D!


Thank you it works very well :D! Now I'm going to dig a little to do as you suggests (I live with : "my husband", "my mother" etc)!
And after that I want this interraction not to be immediate and also to be located in "friendly interraction" (with GetPath).

Learning how to do this is great, thanks again!
Screenshots
Instructor
Original Poster
#4 Old 12th Nov 2019 at 11:24 PM Last edited by Anitaka00 : 19th Nov 2019 at 8:49 PM.
Hello it's me again ,

I've been working on this project and I have a question about adding the conditions to : I live with..."My husband/child etc..."

This is what I wrote so far :

public sealed class ShowNotification : ImmediateInteraction<Sim, Sim>
{
public static readonly InteractionDefinition Singleton = new Definition();
public override bool Run()
{
string message = "";
for (int i = 0; i < base.Target.Household.SimDescriptions.Count; i++)
{
if(message.Length > 0)
{
message += ", ";
}

if(Target.Household.SimDescriptions[i].FullName != Target.FullName)
{
message += Target.Household.SimDescriptions[i].FullName;
if(Target.Household.SimDescriptions[i].Child)
{
message += " (my child)";
}
}


}
StyledNotification.Show(new StyledNotification.Format(" I live with " + message,
StyledNotification.NotificationStyle.kGameMessagePositive));
return true;



I wanted to specify that the sim in the household is the target's child, but in game this is simply telling me that the sim IS A child haha...

I'm sure I have to put "relationship" somewhere, so far none of what I have tried worked. Do you know how I should put it?

Thank you for your time


E : I got it to work, it's getting better !
Screenshots
Attached files:
File Type: rar  WhoDoYouLiveWith.rar (4.2 KB, 11 downloads) - View custom content
Virtual gardener
staff: administrator
#5 Old 17th Nov 2019 at 5:48 PM
Just so I get this for the logistics. With this:

Quote:
I wanted to specify that the sim in the household is the target's child, but in-game this is simply telling me that the sim IS A child haha...


You mean that if the sim you're playing happens to have a child that is THEIRS but is not in the "current" (target) sim's household right?
Instructor
Original Poster
#6 Old 19th Nov 2019 at 8:46 PM
Quote: Originally posted by Lyralei
Just so I get this for the logistics. With this:



You mean that if the sim you're playing happens to have a child that is THEIRS but is not in the "current" (target) sim's household right?


Hi Lyralei !

I meant that it was telling me that the sim in the target's household was A child (in term of age) and not THE target's child. But it's working fine now

This mod is working in my game, and so is the "Do you have children? " mod I was working on as well. Now I'm learning how to make these actual social interactions with the help of this tutorial :

http://modthesims.info/t/492221

Cheers
Back to top