-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Male/Female-only genes leave sex-change thoughts on newly-generated pawns #32
Comments
Hi @callavico , thanks for the report! I noticed the thought too, it's new from RJW 5.3.4 and Taleirs cleanups, which don't break things, but actually I think it was slightly off before. I am not 100% sure if the check for endogene covers all cases. I will have a short check if |
@callavico , can you try this version out? |
I am pretty sure that there's no way other than devmode (which like... fair) to add an endogene after a pawn is generated. That's the point of endogenes. Endogenes are generated at birth and can't be changed, and represent the way the pawn is supposed to have been from birth. If you want to proceed with this path though, then there are more than just m2f and f2m thoughts. Pawns can spawn as none, trap, or futa, and get corresponding "2f"/"2m" thoughts which should be removed. There's also a set of "was_" hediffs that are used if the pawn is forcibly changed later to determine if they are happy to have "changed back". I pulled the list of thoughts from RJW itself using Traverse. |
Good Morning @callavico , yes sorry I was a bit unclear. The issue I have with "just" checking for endogenes is that the thoughts also appear for xenogenes when the xenogene was added "before game". E.g. you create a succubus in colony creation and the spawned pawn has the So my approach is to check if the pawn was spawned when the gene was added, in the good faith that "fixed gender pawns that spawn on the map are contempt with their gender". That catches the xenogenes and xenotypes too. But you are right, I have to check for the futa and none thoughts too, I just .... first have to check if they appear 😄 Have you checked the |
I see what you mean. I was thinking in the other direction, that you were saying there were times that there were endogenes which weren't added at spawn time. I had originally written a version that added a patch for PawnGenerator.SpawnGenes that removed the thoughts when that method ran. Do you want to take a look at that version? It is guaranteed to remove the thoughts from any pawn that has the gene added at the time that the Pawn generates. I had originally worked it this way because it feels cleaner to just straight remove them when they are created, and adding the notify method could potentially be re-used elsewhere. It's more invasive, but it also doesn't rely on guessing which situations should have them removed, it just does it if the gene is there at generation-time. dev...callavico:RJW-Genes:notifyOnPawnGeneration I didn't try your method, but it would definitely work to catch the cases that are relevant: where the pawn is not yet on the map when the gene is added, or when the pawn is a baby. Those are the two immediately evident cases. If you extend the list of hediffs you're looking for to remove, your solution would work in all cases, for sure. I'd still recommend removing the "was_" hediffs as well because, as you said, a pawn that spawned as a succubus never "was a boy" so if it is forced male somehow later, it should be a sexchange that it's unhappy with. |
I like it! And I like the notify too. If you prepare a PR I am more than happy to merge it. |
Steps to reproduce:
Expected: Pawns wouldn't have sex-change thoughts about genders that they never were (and are incapable of being by gene).
Proposed fix: During AdjustPawnToFemale/Male we can check if the pawn has the gene as an endogene or xenogene. If endogene, we can clear the sexchange thoughts, since the assumption would be that the pawn had that gene from birth and thus never was a different gender.
I have code that does this my local, and I've been playing with it for a few days. I tested pawns at pawn generation as well as children inheriting the gene with it as an endogene, and used god mode to add the gene as a xenogene to a pawn, and everything worked as expected (the xenos with the gene as an endogene didn't get sexchange thoughts even if they spawned as male and then were forced female, and the pawn who had it added as a xenogene did get the sexchange thought).
I can send a PR if you'd like, but before I take the time to clean the code up and do the legwork of making the PR itself, I wanted to see if you agreed with this change at all.
The text was updated successfully, but these errors were encountered: