- Site Map >
- Modding and Creation >
- Sims 3 Creation >
- Modding Discussion >
- What does SimDescription Partner/mPartner return?
- Site Map >
- Modding and Creation >
- Sims 3 Creation >
- Modding Discussion >
- What does SimDescription Partner/mPartner return?
Replies: 2 (Who?), Viewed: 238 times.
#1
27th Oct 2022 at 8:13 PM
Last edited by YolkSims : 27th Oct 2022 at 8:40 PM.
Posts: 56
Thanks: 295 in 7 Posts
What does SimDescription Partner/mPartner return?
I'm trying to determine if a sim has a partner. Using the HasPartner bool in MiniSimDescription was a bust because it's not static.If a sim doesn't have a partner, does it return null? In essence, can I use a null check to filter out sims with partners?
Code:
bool EitherHasPartner = false; SimDescription ActorPartner = Actor.SimDescription.Partner; SimDescription TargetPartner = Target.SimDescription.Partner; if ((ActorPartner != null) || (TargetPartner != null)) { EitherHasPartner = true; } else { EitherHasPartner = false; } bool EitherHasSpouse = false; Genealogy ActorSpouse = Actor.Genealogy.Spouse; Genealogy TargetSpouse = Target.Genealogy.Spouse; if ((ActorSpouse != null) || (TargetSpouse != null)) { EitherHasSpouse = true; } else { EitherHasSpouse = false; }
Advertisement
#2
31st Oct 2022 at 4:37 PM
Posts: 56
Thanks: 295 in 7 Posts
Bump? Sorry, I'm kind of stuck without knowing this.
Space Pony
#3
31st Oct 2022 at 7:09 PM
Posts: 433
Thanks: 792 in 6 Posts
Quote: Originally posted by YolkSims
Bump? Sorry, I'm kind of stuck without knowing this. |
Code:
public SimDescription Partner { get { return mPartner; } set { if (mPartner != value) { mPartner = value; HadBachelorParty = false; if (value == null && mGenealogy.Spouse != null) { mGenealogy.Divorce(mGenealogy.Spouse); } if (value != null) { Relationship relationship = Relationship.Get(this, value, true); relationship.LTR.AddInteractionBit(LongTermRelationship.InteractionBits.HaveBeenPartners); } } } }
As you can see Partner just returns mPartner
Code:
public void ClearPartner() { if (Partner != null) { Partner.Partner = null; Partner = null; } }
And here you can see that clearing the partner means setting it to null.
So if a sim does not have a partner SimDescription.Partner || SimDescription.mPartner will be null
Seems like you waited quite a bit for an answer, in these cases checking a sim via a test script might be giving you the info you are looking for faster.
Who Posted
|