Making mod compatible with Woohooer

Talk nerdy to us here.
aede_ofThuul
Reactions:
Posts: 50
Joined: April 26th, 2020, 5:37 am

Making mod compatible with Woohooer

Post by aede_ofThuul » July 18th, 2020, 9:52 pm

Hello, developer forum! I'm not sure if this is the right place to post this, but I'm working on a mod for a more structured form of polyamory. I'll need to add some logic to the CheckCheating method that accounts for that (initially just checking whether the "cheating" social's actor, target, and observer have the custom traits I made, and if that works maybe adding some more complicated stuff to allow committed non-monogamy), so I was wondering if I could get some advice on 1) inserting a custom version of that method, as Woohooer does (I've decompiled Woohooer and it looks like it replaces entire interactions with custom versions that use the Woohooer CheckCheating instead of the EA one?), and 2) avoiding conflict with Woohooer while doing so. As much as I'd love to have committed polyamory be an option, I can't go back to those pre-NRaas days.

User avatar
Chain_Reaction
Site Admin
Reactions:
Posts: 7618
Joined: December 30th, 2011, 6:00 pm
Answers: 82
Contact:

Making mod compatible with Woohooer

Post by Chain_Reaction » July 20th, 2020, 1:17 am

aede_ofThuul wrote:
July 18th, 2020, 9:52 pm
inserting a custom version of that method, as Woohooer does
Woohooer just listens for the kSocialInteraction event and calls it's custom code that way. And yes the interactions are replaced so EA's code is never ran.
aede_ofThuul wrote:
July 18th, 2020, 9:52 pm
avoiding conflict with Woohooer while doing so
You can run your own event listener which can apply effects based on your traits and/or cancel the effects applied by woohooer but woohooer will always have control over how the Sims initially react. It may be possible to stop certain interactions if you use the overrides folder which will cause woohooer's jealousy features to stop working in those cases which may or may not be desired.

What exactly are you attempting with polyamory? Woohooer pretty much does as much as the game core will safely allow with such a topic.

aede_ofThuul
Reactions:
Posts: 50
Joined: April 26th, 2020, 5:37 am

Making mod compatible with Woohooer

Post by aede_ofThuul » July 20th, 2020, 2:53 am

Chain_Reaction wrote:
July 20th, 2020, 1:17 am
woohooer will always have control over how the Sims initially react
Hm, I see. I guess overriding interactions might be a better approach then? Would that interfere with other parts of Woohooer as well?

My original intent was just to make sims with my polyamory-handling traits have different conditions for considering an interaction cheating than everyone else does, and add custom socials so polyamorous relationships depend on communication about sims’ traits to not implode.

Since the only-one-partner thing is a big limitation on how complex committed relationships can get, I’m also trying to make a parallel method for keeping track of who’s in what kind of committed relationship with who regardless of their official status, based on the SurgeryManager from Sims MX’s Hospital Overhaul. It’s not meant to replace the standard relationships; right now it’s just a dictionary of sims and their partners' IDs and what kinds of relationships they have (from a custom relationship types enum). I’d actually like to ask some questions about that kind of thing if you’ve ever got time; I want to make sure this feature won’t damage people’s games the way I’ve read that mods like Kinky World and the Hospital Overhaul do if I get it working, but it’s not totally clear from the warnings I’ve read why that damage happens.

And finally I also want to make a third, hidden trait (other 2 and the social/object interactions are done) that gets assigned to sims in committed relationships for as long as some conditions are met, and gives them a heavy attraction penalty with everyone who’s not already at least a romantic interest of theirs as long as they have it, to discourage ruining relationships for no reason without disallowing it across the board. That's probably all of it; overall I'd say the idea is to add a more nuanced handling of commitment and more "defining the relationship" talks.

User avatar
Chain_Reaction
Site Admin
Reactions:
Posts: 7618
Joined: December 30th, 2011, 6:00 pm
Answers: 82
Contact:

Making mod compatible with Woohooer

Post by Chain_Reaction » July 22nd, 2020, 2:11 am

aede_ofThuul wrote:
July 20th, 2020, 2:53 am
I guess overriding interactions might be a better approach then? Would that interfere with other parts of Woohooer as well?
Well, it shouldn't. But that is only going to stop things like the accuse of cheating interaction from running. You still won't be able to stop the event listener from firing thus what I said about woohooer always controlling how they initially react still applies. Relationship changes and things will already be done I'm afraid.
aede_ofThuul wrote:
July 20th, 2020, 2:53 am
I want to make sure this feature won’t damage people’s games the way I’ve read that mods like Kinky World and the Hospital Overhaul do if I get it working, but it’s not totally clear from the warnings I’ve read why that damage happens.
Hospital Overhaul improperly overrides the world load event listener so all mods that load after it break. It was also never updated for newer patches so those are the only issues I know of. Kinky world interjects it's self too deep into the core by overriding systems the game has no way to reset when the mod is removed like the autonomy managers. There's also the injecting of data into core systems leaving them confused as to what to do with it. Then it's just carelessly coded which in the end causes data corruption. It's always best to try to work with what EA gave you, however limited. Be very creative about finding ways to hook into the core without interjecting foreign data. If what you want isn't possible under that constraint, build your own system and leave EA alone. It sounds like you're on the right path by what you're doing there.

aede_ofThuul
Reactions:
Posts: 50
Joined: April 26th, 2020, 5:37 am

Making mod compatible with Woohooer

Post by aede_ofThuul » July 25th, 2020, 4:01 pm

That's interesting to know, thank you! I guess for now I'll try replacing interactions like Woohooer does without Woohooer installed, just to see if I can make something that works, and then see about making it Woohooer-compatible somehow once I've achieved that. I'll be back!

aede_ofThuul
Reactions:
Posts: 50
Joined: April 26th, 2020, 5:37 am

Making mod compatible with Woohooer

Post by aede_ofThuul » July 27th, 2020, 2:20 am

I'm back, and setting up the parallel relationship tracking system was easier than I expected! But replacing interactions is, uh...not. I got myself pretty disoriented. Update below, but first I have another question to ask, Chain_Reaction (I finally learned to do mentions :D): could I try to make this a module for Woohooer, instead of working around it from the outside? I checked out the Creating an NRaas Project page, and I don't know what the quality standards here are or what the original vision for the mods was, but I'm willing to adapt this to them if that's possible!

Details of what I've got working so far:

I've made a persistable RelationshipManager class containing the dictionary and methods for adding or changing or checking entries in it, and confirmed it works. I've also got social interactions for getting sims into and out of any number of simultaneous relationships, changing relationship types, and finding out who other sims' RelationshipManager-defined partners are and what kinds of relationships they have with them. So most of the infrastructure for my polyamory system is now built; next will be the hidden trait and the code to assign and remove it, and testing whether what I've done to make the mod removable works. Also, I've made it so none of this is dependent on the traits I've made using Arsil's traits manager, just enhanced by them; so it can stand without Arsil's mod installed if necessary.

User avatar
Chain_Reaction
Site Admin
Reactions:
Posts: 7618
Joined: December 30th, 2011, 6:00 pm
Answers: 82
Contact:

Making mod compatible with Woohooer

Post by Chain_Reaction » July 28th, 2020, 5:15 am

After reading more about what you're attempting I did some code review and an easier solution rather than interfacing with woohooer might be to disable jealousy for everyone in woohooer then using your mod to push reactions on to the Sims you want to react. Woohooer is still controlling how Sims react (no reaction) but you can then alter that hopefully without much resistance. Let me know if you think that'd be a viable solution and how it goes.

aede_ofThuul
Reactions:
Posts: 50
Joined: April 26th, 2020, 5:37 am

Making mod compatible with Woohooer

Post by aede_ofThuul » July 28th, 2020, 11:11 am

Oh, I see, that's a good idea! I'll try that tonight and report back, it sounds like it would work!

aede_ofThuul
Reactions:
Posts: 50
Joined: April 26th, 2020, 5:37 am

Making mod compatible with Woohooer

Post by aede_ofThuul » July 28th, 2020, 9:10 pm

Can I borrow some of the code from Woohooer's CheckCheating, CaresAboutJealousy, and SendCheatingEvents methods, and write my code so it tries to check TestAllowBreakup before pushing sims to accuse of betrayal if Woohooer is installed, since those all get skipped if Woohooer has jealousy turned off? I've seen other people's mods with a variable in them indicating whether AwesomeMod is installed and changing how they work based on that, and I don't remember how that worked but I think I could reference the .dll for Woohooer and wrap TestAllowBreakup in a try/catch statement so it gets skipped if it doesn't exist.

User avatar
Chain_Reaction
Site Admin
Reactions:
Posts: 7618
Joined: December 30th, 2011, 6:00 pm
Answers: 82
Contact:

Making mod compatible with Woohooer

Post by Chain_Reaction » July 28th, 2020, 11:55 pm

Sure, that'd be fine. You'll have to use reflection to invoke a public static woohooer method after checking the assembly is installed otherwise referencing the DLL will make woohooer be required to be installed or the game will crash. Unless you'd like to make woohooer a requirement for your mod which is also fine.

Post Reply