Replies: 15 (Who?), Viewed: 345 times.
Lab Assistant
Original Poster
#1 Old 21st Jun 2022 at 11:49 PM
Default Would it be possible to make a condition based off if the target sim is BF/GF?
So I am aware that the their are conditions for if the sim is Married, Is Engaged, and the Actor.IsInRomatincRelationshipWith(Target). However, I would be interested in trying to find a condition for boyfriend and girlfriend. I know their is the "Partner" in ILspy, but whenever I try it I get the error "Non-invocable member "SimDescrption.Partner" cannot be used like a method. Here is the method I tried while testing.
Code:
private static void AddExampleBuff(Sim Target, Sim Actor)
{
if (Actor.IsInRomanticRelationshipWith(Target)) && Actor.SimDescription.Partner(Target))
{
ulong buffGuid = BuffExample.StaticGuid;
Target.BuffManager.AddElement(buffGuid, Origin.None);
}
}

Also is it possible to create custom relationships? If not it is no big deal. I will most likely use moodlets to accomplish these custom relationships. Any help would be appreciated thanks.
Advertisement
Field Researcher
#2 Old 22nd Jun 2022 at 1:52 AM
"Partner" is a property, which is a special kind of method that is used like a simple value. In other words, to check if the Sim's partner is the target, you'd just use an equality comparison like:
Code:
Actor.SimDescription.Partner == Target.SimDescription
Quote:
Originally Posted by MonocoDoll
Also is it possible to create custom relationships? If not it is no big deal. I will most likely use moodlets to accomplish these custom relationships.
My guess is probably not, though I admit I'm not the most qualified to speak on the topic.

"The Internet is the first thing that humanity has built that humanity doesn't understand, the largest experiment in anarchy that we have ever had." - Eric Schmidt

If you enjoy the mods I put out, consider supporting me on patreon: www.patreon.com/Gamefreak130
Lab Assistant
Original Poster
#3 Old 22nd Jun 2022 at 3:15 AM
Quote:
Originally Posted by gamefreak130
"Partner" is a property, which is a special kind of method that is used like a simple value. In other words, to check if the Sim's partner is the target, you'd just use an equality comparison like:
Code:
Actor.SimDescription.Partner == Target.SimDescription
My guess is probably not, though I admit I'm not the most qualified to speak on the topic.
Thank you. I just tested it and it worked. I will definetely put this method to good use!
Lab Assistant
Original Poster
#4 Old 22nd Jun 2022 at 4:06 PM
I have another question. Is there a way to apply a condition if the two sims are friends or not? for example something similar to.
Code:
Actor.SimDescription.AreFriends == Target.SimDescription
Forum Resident
#5 Old 22nd Jun 2022 at 6:52 PM
There ought to be a way to retrieve the relationship value between two sims and then compare it to the minimum value for friendship. I believe it's called LTR (long-term relationship). Sorry for the vagueness. My computer with my code on it is still out for repair.

Echo Weaver's Simblr: http://echoweaver.tumblr.com/
A portrait in stubbornness - Playing the same legacy since 2009
Sample a Brave Legacy: http://sims3sample.illation.net
Field Researcher
#6 Old 22nd Jun 2022 at 10:49 PM
The liking value would probably work, but you can also do the following:

Code:
Relationship relationship = Relationship.Get(Actor, Target, false);
if (relationship != null && relationship.AreFriends())
{
    // Code you want to run if friends
}


This will check whether the Target shows up as any variation of "friend" in the Actor's relationship panel, including Old Friend and Distant Friend.

"The Internet is the first thing that humanity has built that humanity doesn't understand, the largest experiment in anarchy that we have ever had." - Eric Schmidt

If you enjoy the mods I put out, consider supporting me on patreon: www.patreon.com/Gamefreak130
Forum Resident
#7 Old 23rd Jun 2022 at 7:24 PM
I would suggest something like

Code:
var rel = Actor.SimDescription.GetRelationship(Target.SimDescription, false);
if (rel != null && rel.LTR.CurrentLTR == Sims3.UI.Controller.LongTermRelationshipTypes.Partner)
{
    // code to run if BF/GF
}


The RelashionshipTypes Enum has all possible relationships Sims can have:

Undefined,
Stranger,
Acquaintance,
Disliked,
DistantFriend,
Friend,
GoodFriend,
BestFriend,
OldFriend,
BestFriendsForever,
RomanticInterest,
ExSpouse,
Ex,
Enemy,
OldEnemies,
Partner,
Fiancee,
Spouse,
Default,
All

"Partner" is Bf/Gf, "Spouse" is husband/wife

Find my Mods: Here at MTS, over at Simlogical
Lab Assistant
Original Poster
#8 Old 24th Jun 2022 at 12:08 AM
Thank you everyone. I will put these lovely methods to use. Also, I just realized I increased my rank to Lab assistant. How did that happen lol?
Field Researcher
#9 Old 24th Jun 2022 at 1:57 AM
Quote:
Originally Posted by MonocoDoll
Thank you everyone. I will put these lovely methods to use. Also, I just realized I increased my rank to Lab assistant. How did that happen lol?


That title changes the more you post here on the site. I've been stuck on "Field Researcher" for what seems like forever, but I quite like it.

"The Internet is the first thing that humanity has built that humanity doesn't understand, the largest experiment in anarchy that we have ever had." - Eric Schmidt

If you enjoy the mods I put out, consider supporting me on patreon: www.patreon.com/Gamefreak130
Lab Assistant
Original Poster
#10 Old 24th Jun 2022 at 6:12 AM
Quote:
Originally Posted by gamefreak130
That title changes the more you post here on the site. I've been stuck on "Field Researcher" for what seems like forever, but I quite like it.


Oh, that is neat. Can't believe I rank up for asking questions lol.
Lab Assistant
Original Poster
#11 Old 24th Jun 2022 at 6:14 AM
Speaking of questions would anyone know if it is possible to make buffs invincible? correct me if I am wrong, but I could have sworn I saw an invicible buff before while using Nrass. Apparently the buff would increase skill gains from the best of my memory. But, at the moment I am simply interested in making a buff invincible.
Forum Resident
#12 Old 24th Jun 2022 at 6:41 PM
Well, that's a new tidbit to me! Is it in code snippets?

Will this detect partner relationships or just variants of friend? I.e. if you check against the LTR value, you should get sims who have any type close relationship, whether their status is some sort of friend, romantic interest, partner, etc. I'm pretty sure different types of relationships can have the same value. So it might depend on whether you're trying to test for just being emotionally close or whether you specifically want friends but not romantic interests.

Quote:
Originally Posted by gamefreak130
The liking value would probably work, but you can also do the following:

Code:
Relationship relationship = Relationship.Get(Actor, Target, false);
if (relationship != null && relationship.AreFriends())
{
    // Code you want to run if friends
}


This will check whether the Target shows up as any variation of "friend" in the Actor's relationship panel, including Old Friend and Distant Friend.

Echo Weaver's Simblr: http://echoweaver.tumblr.com/
A portrait in stubbornness - Playing the same legacy since 2009
Sample a Brave Legacy: http://sims3sample.illation.net
Field Researcher
#13 Old 25th Jun 2022 at 2:09 AM
Quote:
Originally Posted by echoweaver
If you check against the LTR value, you should get sims who have any type close relationship, whether their status is some sort of friend, romantic interest, partner, etc. I'm pretty sure different types of relationships can have the same value. So it might depend on whether you're trying to test for just being emotionally close or whether you specifically want friends but not romantic interests.


Correct, AreFriends() will be false if the Sims are romantically involved (or if they're exes), whereas an LTR value threshold would include such relationships if they're on good terms.

"The Internet is the first thing that humanity has built that humanity doesn't understand, the largest experiment in anarchy that we have ever had." - Eric Schmidt

If you enjoy the mods I put out, consider supporting me on patreon: www.patreon.com/Gamefreak130
Virtual gardener
staff: administrator
#14 Old 28th Jun 2022 at 1:04 PM
Oh this is quite helpful! Initially, I checked Romantic Interests in this very convoluted and arguably weird way Reading over it after having gone through the options here, I just realised it's very prone to return mistakes (In case you're curious


Thank you for sharing this!
Forum Resident
#15 Old 28th Jun 2022 at 10:11 PM
@Lyralei

Oh that's the code you discarded? I started reading it and thought "uhm wait, this is weird"

Find my Mods: Here at MTS, over at Simlogical
Virtual gardener
staff: administrator
#16 Old 30th Jun 2022 at 2:19 PM
Lol yeah! I actually copied it from EA funnily enough, although in that use case it made sense since it was straight from a social interaction (which already came with checks in the XML against what LTR they are)
Back to top