Gender in the Sims 4 and how can it be incorporated in modding? (Modding Discussion/Experimentation)

Gender in the Sims 4 and how can it be incorporated in modding? (Modding Discussion/Experimentation)

Hey guys, new to the community but not to the Sims, and I have something I want to discuss the possibility of with the modding community.

I'm a complete noob when it comes to modding, so pardon me if this sounds completely inane and asinine. I'm more curious than actually requesting any sort of mod (I know we're not supposed to make requests on these boards anyways), so consider this a symposium more than anything.

Many, many months ago, I had quit and given up on the Sims 4, but I immediately came straight back when EA announced their patch to make gender more fluid and less binary. While simplistic, I loved that they at least acknowledged some of the spectrum in game terms, allowing us to make characters who may be "male" in a strict sense but also have female characteristics, or vice versa. I also like that it's much easier to switch gender and even sex on the fly, even if the game mechanics themselves don't really acknowledge it. As a transgender individual who has always been fascinated by the fluidity of gender and sex, I have always tried to incorporate some form of transgender storytelling into my game, even if I had to do so in a more narrative and less mechanical sense.

But I was wondering what the possibilities were, now that these mechanics are actually incorporated - however simply - into the game, our ability to use mods to play with these features within the game mechanics (rather than having to enter CAS to change a sim's gender features). For example, could we create an item - a "potion" perhaps - that could change the Sim's gender? Or have them get corrective surgery? Or even just add a command to the mirror that alters their gender/sex/whatever. In my various projects since returning to the game (I spend way more time world-building/planning than actually playing), I have noticed that these gender features - a Sim's ability to become pregnant, their peeing situation, even their body frame and actual sex - are represented in a Sim's traits (hidden, of course), just like their walk type. Now, I've played around with this a bit. I can't figure out how to console command all of this (i.e. traits.remove_trait or traits.equip_trait...I don't know what the console name for the walk cycles are, or even if they can be affected this way), but with radial commands in debug mode, I know we can remove walk cycles and replace them, which immediately changes a sim's walk cycle.

Can we do this for gender?

In my own experimentation, I found the sim's sex (male vs. female) represented by a trait, and I can remove this trait (again, via radial commands, not console commands). However, I can't seem to find the opposite sex trait (the one I removed is available in the add trait menu, but not the opposite sex trait). HOWEVER, I was able to remove the sim's physical frame trait (while not accurate, I'll refer to this as their "gender" because it's basically how they present, even though there's a lot more to it than that) and replace it with the opposite gender, which, after a brief delay, did indeed change the Sim's frame shape.

Now the question I have, as a complete modding novice, is this: can mods create commands/items that can alter a sim's traits? If so, this would create a lot of possibilities.

So to continue this discussion, if you folks are willing, can a knowledgeable modder weigh in? Even if you've no interest in exploring this sort of thing, I'd love to hear if it was at all possible to create a more immersive way to alter a sim's sex and gender within the actual game, rather than having to go into CAS to do it. It'd be nice for telling stories, if nothing else.

I'd be very curious to see more ways for our Sims to explore their gender. I don't know how helpful this is (it's been a little while since I looked at game code) but there are certain objects in game which can (oftentimes temporarily) give a Sim a trait. The one that comes to mind most specifically is the Wishing Well from the Romantic Garden pack which adds a lot of hidden traits to Sims who wish on/in it. I would have no idea how to use that with the in-game gender traits, but the code on those types of objects could be helpful in figuring out how to implement gender in other various ways in-game.

That would be the sort of thing that would be a great way to implement something like this, simply being able to wish to be a different gender. While it would be nice to have it be a "realistic" medical procedure or some sort, I think that would be a nice, easy place to start. Thanks for pointing that out!

No problem! The coding on the wishing well could potentially be added to other objects as well (such as a mirror) to implement various different ways to get that certain fluidity that so many who explore gender experiment with. I wouldn't know exactly how to do that and I don't have time to work on any "fun" projects right now so sorry I can't be more useful.

Another mod to check out for ideas (now that I'm really thinking of it) is the Become a Sorcerer Mod here on MTS. There's a lot of cool concepts in that mod that could be used as inspiration for a gender transition mod and how to implement it in-game. It would be a lot of hard work, but I bet the results would be kinda fun (If you want to go that route, that is . No pressure to conform to anything you don't want/need/are unable to do, I'm just spit-balling to (hopefully) inspire).

I actually keep checking mods like that (and whenever EA adds mystical/magical stuff) to see if they finally add some kind of gender-changing spell/potion. But alas.

I guess I really am going to have to just learn how to mod myself. Alas. :-P It's not really something I'm opposed to, but starting from absolutely no understanding of how anything in this game (or really any game/mod) works, I don't know if I have the time to devote to even learning, let alone learning how to do really quirky stuff like this. And I've yet to find a relevant tutorial that starts from absolute beginner.

I can completely understand that frustration. I think (and this is just from seeing how mods get made here on MTS) that, typically, if you want something complex done the expectation is that you learn to do it yourself. Most of the people who know the code inside and out have become frustrated with some aspect of playing or modding Sims 4 and have backed out from a more public stance in the community. This means that we don't have as many code-guides, whereas in Sims 2 we had oodles of in-depth beginner tutorials for modding just about any aspect of the game. I wish I knew more about certain types of modding that go into Sims 4 in order to make a tutorial on how to do it. I've spent most of my time for modding in XML mods for personal use since I can't keep up with an update schedule (and I'm not very good at those anyway).

That said, I would assume that most of the modding for the wishing well scenario would be copy/paste from one object to the other and then modifying a handful of lines of code to direct the code to call upon the gender trait rather than, say, the fertile trait. That, would at least start the non-visual side of the mod. Actually changing the sim's physical appearance might be more tricky and I wouldn't know exactly how to do that off the top of my head (I'm not that great at Python yet either, and I think that would require some Py).

My best tip for you, should you choose to go down the path of creating this mod, is to just look at the code associated with each object (so the mirror and the wishing well) and see how they relate to other aspects of the code. All code follows a logical path from start to finish and typically calls on some other action to happen. You could always copy/paste the fertility wish to the mirror code and test it in game to see how it functions in a new object. Just set up the choice bubbles/pie menu for it by using the same code the other options have (You might not even have to do this step). That's were I would start. Then add in finding what you could do to change how a sim from being listed as "male to "female" in the game code (TwistedMexi has a mod to change a sim from male to female using console commands, you could always check it out here on MTS). Most coding is trial and error anyway.

You may get frustrated early on and quit, and that's okay, too. I think Sims 4 did a good job in allowing players to play with gender easily, though I wouldn't be upset by more options in-game either (since there's not a lot of options for born in-game sims). I really don't know enough code to be able to help you finish this mod and most of what I've done myself has come from trial and error and picking apart other's mods to learn how they did something in their own code. Then again, for most coding/creating aspects I do best just tinkering away until I get something good from it (except music, i have to have a teacher for music). You my not be that way.

There's a few basic tutorials on how to extract XML using Sims 4 Studio and I've used that to code most of my mods (that and Notepad ++). Beyond that, just compare how different XML files relate to one another and search for common themes. That will get you the wishing well code onto the mirror. From there, just search out the coding for the gender traits and switch them out for, say, the fertility trait. That's the best I can do without spending time actually writing an in-depth, step-by-step tutorial on how to do this (and I don't know it well enough to do so anyway). Good luck!

Yeah, I've gotten that about MTS. Not that I blame people. No one owes me anything, and they already do so much.

I really don't mind learning to mod, I just don't know how much I'm going to be able to wrap my head around it. And I don't think it's rude to reach out to see if someone wants to take on a project, so long as you don't act like people are obliged to help you.

I'll see how it goes, I suppose. I have a few tutorials bookmarked and I'm ready to get started on something simple this week - a hidden trait that negates aging and motives, maybe. That one seems like it'd be pretty simple (it already probably exists somewhere, it'd just be more helpful for me personally to make it myself). I'll probably go through a lot of my trait projects before I ever feel comfortable even starting to look at something this complex.

Quote:

Originally Posted by bamrd

I can completely understand that frustration. I think (and this is just from seeing how mods get made here on MTS) that, typically, if you want something complex done the expectation is that you learn to do it yourself. Most of the people who know the code inside and out have become frustrated with some aspect of playing or modding Sims 4 and have backed out from a more public stance in the community. This means that we don't have as many code-guides, whereas in Sims 2 we had oodles of in-depth beginner tutorials for modding just about any aspect of the game. I wish I knew more about certain types of modding that go into Sims 4 in order to make a tutorial on how to do it. I've spent most of my time for modding in XML mods for personal use since I can't keep up with an update schedule (and I'm not very good at those anyway).

That said, I would assume that most of the modding for the wishing well scenario would be copy/paste from one object to the other and then modifying a handful of lines of code to direct the code to call upon the gender trait rather than, say, the fertile trait. That, would at least start the non-visual side of the mod. Actually changing the sim's physical appearance might be more tricky and I wouldn't know exactly how to do that off the top of my head (I'm not that great at Python yet either, and I think that would require some Py).

My best tip for you, should you choose to go down the path of creating this mod, is to just look at the code associated with each object (so the mirror and the wishing well) and see how they relate to other aspects of the code. All code follows a logical path from start to finish and typically calls on some other action to happen. You could always copy/paste the fertility wish to the mirror code and test it in game to see how it functions in a new object. Just set up the choice bubbles/pie menu for it by using the same code the other options have (You might not even have to do this step). That's were I would start. Then add in finding what you could do to change how a sim from being listed as "male to "female" in the game code (TwistedMexi has a mod to change a sim from male to female using console commands, you could always check it out here on MTS). Most coding is trial and error anyway.

You may get frustrated early on and quit, and that's okay, too. I think Sims 4 did a good job in allowing players to play with gender easily, though I wouldn't be upset by more options in-game either (since there's not a lot of options for born in-game sims). I really don't know enough code to be able to help you finish this mod and most of what I've done myself has come from trial and error and picking apart other's mods to learn how they did something in their own code. Then again, for most coding/creating aspects I do best just tinkering away until I get something good from it (except music, i have to have a teacher for music). You my not be that way.

There's a few basic tutorials on how to extract XML using Sims 4 Studio and I've used that to code most of my mods (that and Notepad ++). Beyond that, just compare how different XML files relate to one another and search for common themes. That will get you the wishing well code onto the mirror. From there, just search out the coding for the gender traits and switch them out for, say, the fertility trait. That's the best I can do without spending time actually writing an in-depth, step-by-step tutorial on how to do this (and I don't know it well enough to do so anyway). Good luck!

I definitely think you did the right thing by posting this. I'm sorry the only person whose been replying is no-time me. :/

The most I've learned from coding for Sims 4 is picking apart mods that have aspects I want to emulate, especially since there's not much support anymore for the Newbie coder. I know not everyone is able to learn that way, but that's how I was able to learn how to do anything that I've done so far.

How bamrd would go about coding this mod (since I've taken some time to at least think about my process if I were to go about coding a prototype for this mod):

- Make an override for a Base Game Mirror or Base Game Dresser and also a clone and override of the Romantic Garden Wishing well in S4S (Sims 4 Studio)
- Extract the XML Game Files using S4S and make sure they are searchable (I'm blanking on what it's called at the moment. It's also a one click process in File Explorer in Windows and then takes maybe an hour to be fully available (probably less)). I found a Windows Tutorial on Google to learn how to do it myself and if I could think of the term (Indexing??) it would be easier to find this tutorial in a simple search)
- Search XML for the Wishing Well Files (this is why you make them searchable) and find the XML relating to one of the wishes (say, fertility) and copy it. (I think this will be in XML, it might be associated with the object itself which is why I said to clone the wishing well object).
- Search and find the XML for Gender in Sims 4, copy it, and replace (Copy/Paste), say, Fertility with, Gender in the Wishing Well copy file.
- Save the copy file, rename it, add it to your Mods folder.
- Test in Game to see if Fertility is replaced by a Gender Difference.
- If it works, add your code to the options on the Mirror/Dresser (there is a tutorial on how to do that *somewhere*, I've seen it, so probably a Google search will find it - possibly over at S4S's website??)
- Save, and add that override file to your Mods Folder.
- Test in game. If your sim can click on the option and will follow through with the change without glitching it works!

This is very over simplified, but it's the main process I would start with. Chances are you'll get some errors and have to troubleshoot something, but I can't predict where you'll have problems. It's also likely you'll delete some unnecessary code that has nothing to do with your specific mod from your XML files at some point (like the failure chance as that has so many negative connotations to it in regards to gender - eeeek!). You'll also want to remove all mentions to Fertility or whatever wish you edit since that might be weird/confusing. And you'll still have to get the game to recognize the actual gender change (so recognize that the sim IS going by male/female pronouns now and that they do more masculine/feminine actions) but I have no idea how to do that (like I said in an earlier post, you might want to check out TwistedMexi's command line gender change mod). You'll also probably need several XML files to do everything you need and S4PE to combine them and edit certain contents. I'd also suggest Notepad ++ and add in some XML and PY add-ons. (all these resources I'm mentioning are 100% free, I try not to spend more money on Modding Sims than what I do on the games/packs themselves).

There's also a chance that the Gender Code is not in XML and if it isn't I won't be much help since I've really just learned *some* XML and am pretty bad at actually writing Python (reading it, tho? I CAN actually do that...). This method does assume that everything is in Object Files and XML (which is generally a safe bet for Sims 4 since most things are programmed by some XML file somewhere) but it's entirely possible that it's somewhere in the Python code (since everything not handled by XML is typically in Python).

Keep up the good work! I'd really love to see any form of a Gender Transition Mod!

I ended up finding some time to play around in the code. I extracted all the Gender Traits and found the Wishing Well files. I randomly chose wishingWell_WishOutcomes_YouthfulVigor_OverwhelminglyPositive and wishingWell_MakeAWish_Promotion to use as a basic base for modding in a Gender Wish. From the look of things, I can make several versions that call upon certain gender traits and *possibly* "grant" them to the wisher (still working out how everything becomes *visible* and not just given traits). That said, I really only know how to override an XML file and have no idea how to actually create one. I found how to create updated hexadecimal and decimal code but can't figure out what I need to do to update a certain line of code that is necessary:

The "s="130922" is important to calling the actions of *new* XML files. If I don't update this line, I'll override the Youthful Vigor wish with the Gender one instead of creating a new wish entirely. Does anyone know how I go about editing this? Or even what that pesky "s" stands for?

Everything else is mostly copy/paste into the source files and renaming certain aspects (assuming this very simplistic approach actually works and doesn't cause all sorts of glitching or just plain not work).