- Site Map >
- Modding and Creation >
- Sims 3 Creation >
- Modding Discussion >
- Making a social interaction : "Who do you live with?"
- Site Map >
- Modding and Creation >
- Sims 3 Creation >
- Modding Discussion >
- Making a social interaction : "Who do you live with?"
Replies: 5 (Who?), Viewed: 1088 times.
#1
11th Nov 2019 at 12:40 AM
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
Attached files:
NouvelEssai.rar (3.9 KB, 13 downloads) - View custom content | ||||||||||
----------- --------- -------- ----- -------- ----- -------- ---- ..A.... 4801 3912 81% 10-11-19 18:37 C063E470 NouvelEssai.package ----------- --------- -------- ----- -------- ----- -------- ---- 4801 3912 81% 1 |
Advertisement
Space Pony
#2
11th Nov 2019 at 5:03 PM
Last edited by Battery : 11th Nov 2019 at 5:13 PM.
Posts: 433
Thanks: 782 in 6 Posts
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
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
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
#3
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!
#4
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 !
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 !
Attached files:
WhoDoYouLiveWith.rar (4.2 KB, 11 downloads) - View custom content | ||||||||||
----------- --------- -------- ----- -------- ----- -------- ---- ..A.... 5054 4112 81% 12-11-19 17:18 CBC61D24 WhoDoYouLiveWith.package ----------- --------- -------- ----- -------- ----- -------- ---- 5054 4112 81% 1 |
#5
17th Nov 2019 at 5:48 PM
Posts: 3,856
Thanks: 8479 in 67 Posts
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?
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?
#6
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
Who Posted
|