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!
Inventor
Original Poster
#1 Old 3rd Jun 2021 at 6:15 PM
Default Checking for moodlets from another mod?
I'm looking to do something to a sim if a moodlet from a different mod is present.

I know other people have integrated mod functionality. Could someone give me a tip on how this is done? I can include the dll from the mod in question, but I don't want everything to break if the mod isn't installed.

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
Advertisement
Space Pony
#2 Old 3rd Jun 2021 at 7:07 PM
You can use the Buffmanager to check if the sims has the guid of the moodlet

Code:
Actor.Buffmanager.HasElement(guid)


E: cast the ulong to buffnames like Actor.Buffmanager.HasElement((BuffNames)10086937382061335616uL) // in this instance this would be the vanilla Amused buff.
Space Pony
#3 Old 3rd Jun 2021 at 7:08 PM
Quote: Originally posted by echoweaver
I'm looking to do something to a sim if a moodlet from a different mod is present.

I know other people have integrated mod functionality. Could someone give me a tip on how this is done? I can include the dll from the mod in question, but I don't want everything to break if the mod isn't installed.


If you're just looking for a custom moodlet, you shouldn't need to reference the assembly or use reflection at all. So long as you have the GUID value of the moodlet in question (i.e. the number that begins with "0x" in the XML), you can just check directly:

Code:
sim.BuffManager.HasElement((BuffNames)0x52D33C8C0D2C1CC9);


EDIT: Darn, ninja'd by Battery

"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
Inventor
Original Poster
#4 Old 4th Jun 2021 at 12:04 AM
Thanks both of you! That makes perfect sense. It seems obvious now that you say it.

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
Back to top