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 29th, 2020, 12:17 am

Chain_Reaction wrote:
July 28th, 2020, 11:55 pm
use reflection to invoke a public static woohooer method after checking the assembly is installed
How would I do this? My native coding language is MATLAB so my C terminology is pretty lacking.

Also, I'm testing my first attempt to use my new jealousy handling! And I have already run into weird bugs! I don't expect you to have a solution of course, since this is a mess I created, but I like an excuse to keep logs.

Ever since I added my custom romantic social interactions to the game, it's been throwing an error every time a world loads; I saw a post on here at some point where I think someone else had the same problem, maybe with an existing social they'd recategorized as romantic and discovered Woohooer didn't like that? Will go back and look for it. And even more problematic, the first time I loaded a world after adding all my jealousy stuff to the code, the entire romance socials menu just...doesn't appear. No script error anymore, though, or at least not immediately like it was before, but I suspect that's just because whatever went wrong did so before that point was even reached, not because I fixed anything.

Off to investigate.

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

Making mod compatible with Woohooer

Post by aede_ofThuul » July 29th, 2020, 3:28 am

So it seems like the reason the romance menu was gone was something to do with me having set the active family to be in SP stasis, it's fixed now. The new issue I see now is that since Woohooer sets the jealousy level for every action to none at the same time that it sets IsRomantic to false ("to disable CanGetRomantic checks", the comment on that says; makes sense), I can't get the appropriate jealousy level for each interaction from either Woohooer or the interaction's ActionData while also circumventing Woohooer's jealousy code.

The original jealousy levels are stored in the dictionary CommonSocials.sRomanticSocials, but it's private; so I used the section of CommonSocials that makes entries to sRomanticSocials to make a startup event handler that stores that information in a place my code can access, and that seems to have worked! My CheckCheating and such run instead of the Woohooer ones as long as Woohooer has jealousy set to none. I'm not very familiar with the reasoning behind what kind of event handler you use for what in a mod, but I'm reasonably confident this makes sense.

And now I'm so tired I can't tell if my own writing is coherent, so I'm going to call it a night. Thanks for the advice, seeing this starting to work is awesome!

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

Making mod compatible with Woohooer

Post by aede_ofThuul » July 29th, 2020, 8:38 pm

About the reflection thing: I figured it out by reading this thread on MTS plus some supplemental C# documentation from various places, posting here for the record. And used Convert.ToBoolean on the object created by invoking the TestAllowPushBreakup method, since its output is supposed to be a bool. That was a cool learning experience for the day :D And now the mod shouldn't make the game crash if Woohooer isn't installed, although it is still dependent on Woohooer to bypass EA's standard handling of romantic socials.

Where I'm at now: it seems like everything to do with making this compatible with Woohooer now works, except for whatever is happening with the script error it throws over my custom romantic socials! Which I will come back to after I finish debugging my own jealousy logic, which is not currently producing the desired results.

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

Making mod compatible with Woohooer

Post by aede_ofThuul » July 31st, 2020, 4:49 am

I have another update! And also a question about attraction. [Edit: wait, I'm an idiot, I don't need to derail Woohooer's attraction I can just edit the scoring package to account for my traits can't I]

My jealousy logic now works; I have what seems to be a functional system for maintaining multiple relationships simultaneously without them imploding from jealousy, on the condition of adequate communication and attention all around, and the sims involved having personalities that are up to it. It's definitely not as polished as I want it, but I'm hoping I can start looking for early testers soon-ish.

I haven't edited attraction yet, so that's what I'm doing next. If I remove the Woohooer Scoring module, will that disable CalculateAttraction from running altogether, or will I need to try some other way of making sure the attraction score that's used is the one my code calculated? There doesn't appear to be as convenient a way to disable attraction as there is for jealousy, unless I'm missing something.

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

Making mod compatible with Woohooer

Post by Chain_Reaction » August 1st, 2020, 5:50 am

You should be able to calculate the attraction score and set it without woohooer touching it. It only recalculates when the user uses an interaction like gauge attraction or scan room. Glad to hear you're making progress. Unfortunately I don't always have time to get back to you right away but I'll get here eventually. :)

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

Making mod compatible with Woohooer

Post by aede_ofThuul » August 1st, 2020, 1:23 pm

No problem at all, I appreciate the help you've given me so far; I just like posting updates on what I've tried and what issues came up in case knowing that is useful to future forum-searchers trying to accomplish the same thing. I know it helps me a lot when other people's modding processes are well-documented. It's actually kind of more fun to get a hint and then just go for it than have my hand held, so as long as me posting so much isn't annoying/a misuse of the forum I'm happy!

About the attraction score: that's good to know, thanks! In that case I'll just fiddle around with different conditions in which to trigger my own version of CalculateAttraction, and see which makes the most sense. I know the game keeps track of when sims talked last, I could run it on every social interaction that's the first time the sims have talked in at least n days.

Right now I'm working on a different feature; I noticed sims dislike other sims doing romantic socials in front of them in group conversations even if they're not jealous, and I want that to not happen under conditions where it doesn't make sense. I think the negative response they have now might be implemented using a SocialRule, so I'm editing the social rules of every romantic interaction like Woohooer does for some of them, to try and add a check for polyamory; but I run my interaction edits on world load instead of preload so Woohooer won't overwrite them. This makes the game lag pretty badly for a few seconds on world load, though, so I'm wondering if there's a better approach?

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

Making mod compatible with Woohooer

Post by Chain_Reaction » August 3rd, 2020, 5:16 am

Using an alarm set to 1 second after world load should help since those will yield to the simulator unless set not to.

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

Making mod compatible with Woohooer

Post by aede_ofThuul » August 4th, 2020, 1:43 am

That helped! Thank you!

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

Making mod compatible with Woohooer

Post by aede_ofThuul » August 24th, 2020, 11:18 pm

Hey Chain_Reaction, I am back with another question! Last one, for real this time. Should I be able to suppress CalculateAttractionScore and substitute my own version by including in my mod a dummy dll containing an assembly that's named "NRaasChemistry", but doesn't do anything except trick CalculateAttractionScore into thinking Chemistry is installed and so it doesn't need to run? Or by having my mod edit the AssemblyCheck.sAssemblies dictionary in NRaas.Common so it'll think an assembly with that name is there even though it isn't?

I know you said Woohooer only calculates attraction when Gauge Attraction or Scan Room is used, but I was looking at AttractionHelper.OnSocialEvent, and it looks like it's saying CalculateAttractionScore should run on kSocialInteraction if it hasn't run in more than a day - of course I may be confused though.

Overall this mod is getting into pretty good shape I think - I've posted a beta testing version on MTS to get feedback on whether the most central features are working. I'd like to share a link to the testing thread here too once it's more polished if that's alright? I also don't want to make this forum devolve into advertising for mods hosted elsewhere of course; but I've seen more interest in a feature like this here than on MTS so I thought people here might be more willing to help me put it through its paces, and posts on this forum are what started my sims polyamory mission to begin with.

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

Making mod compatible with Woohooer

Post by Chain_Reaction » August 25th, 2020, 8:24 pm

aede_ofThuul wrote:
August 24th, 2020, 11:18 pm
Should I be able to suppress CalculateAttractionScore and substitute my own version by including in my mod a dummy dll containing an assembly that's named "NRaasChemistry", but doesn't do anything except trick CalculateAttractionScore into thinking Chemistry is installed and so it doesn't need to run?
It will cause me headaches if another user starts using our DLL names or namespaces. I am overhauling woohooer and attraction in a new mod which is what that is for. It does look like you're right, I missed that event call when I responded about it. Sorry about that.
aede_ofThuul wrote:
August 24th, 2020, 11:18 pm
Or by having my mod edit the AssemblyCheck.sAssemblies dictionary in NRaas.Common so it'll think an assembly with that name is there even though it isn't?
After reviewing more, this would be best.
aede_ofThuul wrote:
August 24th, 2020, 11:18 pm
I'd like to share a link to the testing thread here too once it's more polished if that's alright?
Yes that's fine. :)

Post Reply