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!
Quick Reply
Search this Thread
Test Subject
Original Poster
#1 Old 26th Jun 2016 at 7:21 AM
Default Help with learning to mod: custom menu interactions and verification checks
Hi guys! I recently decided that I wanted to try making mods for this game. I'm not really sure how to go about it and it all seems so confusing. I was hoping I could get some help to direct me on how I could go about doing what I want. I've been looking around the forums and at some tutorials, but I'm really not sure what I need to do for what I'm interested in doing. To preface this, I'm a programmer and I'm comfortable with both Python and XML, including decompiling with Python, so hopefully that puts me in a good spot for starting.

Anyway, what I want to do is create custom interactions for sims that more or less bypass integrity checks. For example, a sim might be promiscuous, so they might woohoo with someone despite not being in a relationship with them. I think this is the most complicated example I can come up with, since I would expect there to be checks for both involved parties. If instead I did something like talk about books populated for someone who's not a bookworm, I imagine the sim I perform the action on wouldn't say no to it the way they would if I asked for woohoo. Anyway, I imagine I could change the menu so these options could always be available? Perhaps in some sort of custom menu? And then I could figure out some way to disable the check, or maybe make it always pass? I imagine woohoo is going to check sim A is in a relationship with sim B, and sim B is in a relationship with sim A, that they're not family members, etc.

I would be appreciative if someone could help me out. I know basically nothing about modding this game and I came across stuff like XML Tuning or the Super Affordance List, and I'm just lost at what exactly I would need to do.
Advertisement
Instructor
#2 Old 26th Jun 2016 at 6:38 PM Last edited by azoresman : 26th Jun 2016 at 6:48 PM.
Quote: Originally posted by Ohura88
Hi guys! I recently decided that I wanted to try making mods for this game. I'm not really sure how to go about it and it all seems so confusing. I was hoping I could get some help to direct me on how I could go about doing what I want. I've been looking around the forums and at some tutorials, but I'm really not sure what I need to do for what I'm interested in doing. To preface this, I'm a programmer and I'm comfortable with both Python and XML, including decompiling with Python, so hopefully that puts me in a good spot for starting.

Anyway, what I want to do is create custom interactions for sims that more or less bypass integrity checks. For example, a sim might be promiscuous, so they might woohoo with someone despite not being in a relationship with them. I think this is the most complicated example I can come up with, since I would expect there to be checks for both involved parties. If instead I did something like talk about books populated for someone who's not a bookworm, I imagine the sim I perform the action on wouldn't say no to it the way they would if I asked for woohoo. Anyway, I imagine I could change the menu so these options could always be available? Perhaps in some sort of custom menu? And then I could figure out some way to disable the check, or maybe make it always pass? I imagine woohoo is going to check sim A is in a relationship with sim B, and sim B is in a relationship with sim A, that they're not family members, etc.

I would be appreciative if someone could help me out. I know basically nothing about modding this game and I came across stuff like XML Tuning or the Super Affordance List, and I'm just lost at what exactly I would need to do.

Very simple:
Download my Gender preference Set "It's a brand new and unique set of interactions" Nothing was copied from the game, all was built from scratch - Examine what was done:

First : Pie menu categories for your interaction group , unless yo want to put them in a regular category like "Romance"
Second: Start modifying the normal interactions, testsets, sim filters etc.
Third: Every single file has to have a UNIQUE Instance Group should be High bit starting by 8000000 the type stays the same.
Fourth: After having all files connected, add the instances to the sim object Class using a script.

I forgot to mention that there is a Sticky Thread in this section, with links to the EA Official modding documentation where all this is explained sins the game came out, It even has an example mod.

But if you search in the modding section on MTS, there are allot of posts that will guide you. And sins you are good with Python and XML, i guess that's a walk in the park

A good advise i can give is to look at the original code both python core scripts and tuning xml and make sure you understand it.

The rule is XML is given to python that has default values, but can be overridden by the code in tuning xml's. Some have floating values, some can have certain limitations, for that you have to change the function's within the core script and then feed whatever you want.

Good Luck

EDIT: Notice you can just edit a few testsets and for example: Create a blank trait, then in the test where is looks at the relationship between sim, add the requirements which are level of romance and friendship, they may not even have met, and add the test: your custom trait as whitlisted, so only sims with that trait can woohoo with anyone as soon as they see them :D

I'm not joking, I actually have that and much more in my mod folder, I can even send a totally strange sim woohoo with anyone he/she doesn't know XD
Test Subject
Original Poster
#3 Old 27th Jun 2016 at 7:04 AM Last edited by Ohura88 : 27th Jun 2016 at 12:30 PM.
So I spent some time messing around with your mod, the XML files, s4pe, the documentation, etc. I have a much better grasp on it, but I suppose I'm not quite there since what I tried failed.

I've kind of always wanted to try re-creating Game of Thrones in the Sims, seems like a cool environment and a fun project. The only problem is that GoT has some incestuous relationships, such as brother and sister who have children. When I was looking through the XML, I came across test_incest. It seemed like something I could easily modify.

I copied all the XML files that had that line in it, then edited each file to set the value to False. There were a couple other instances I removed as well, all of them are listed below. I added all of the modified files into s4pe. I generated unique instance groups and set the high bit so they're all 8000000 or higher now. I kept the type the same as what the file started with, as they all had some default non-zero value. I saved my package and placed it in the mod folder.


These lines were removed when I came across them:

<V n="test_incest" t="is not incestuous" />

<V t="disabled" n="test_incest" />
<V t="disabled" n="tooltip" />
<T n="track">16651<!--RelationshipTrack: LTR_Romance_Main--></T>

When I tried to use it, didn't work. Looks like some of the relationship checks are still failing, as the romance option never populates. I fast-forwarded it by using the cheat code to modify their relationship to 100 romance.

Any ideas? Seems like you know a thing or two about this.
Instructor
#4 Old 2nd Jul 2016 at 11:03 PM
Quote: Originally posted by Ohura88
So I spent some time messing around with your mod, the XML files, s4pe, the documentation, etc. I have a much better grasp on it, but I suppose I'm not quite there since what I tried failed.

I've kind of always wanted to try re-creating Game of Thrones in the Sims, seems like a cool environment and a fun project. The only problem is that GoT has some incestuous relationships, such as brother and sister who have children. When I was looking through the XML, I came across test_incest. It seemed like something I could easily modify.

I copied all the XML files that had that line in it, then edited each file to set the value to False. There were a couple other instances I removed as well, all of them are listed below. I added all of the modified files into s4pe. I generated unique instance groups and set the high bit so they're all 8000000 or higher now. I kept the type the same as what the file started with, as they all had some default non-zero value. I saved my package and placed it in the mod folder.


These lines were removed when I came across them:

<V n="test_incest" t="is not incestuous" />

<V t="disabled" n="test_incest" />
<V t="disabled" n="tooltip" />
<T n="track">16651<!--RelationshipTrack: LTR_Romance_Main--></T>

When I tried to use it, didn't work. Looks like some of the relationship checks are still failing, as the romance option never populates. I fast-forwarded it by using the cheat code to modify their relationship to 100 romance.

Any ideas? Seems like you know a thing or two about this.


There are other tests like "prohibitive_relationships_bits" these have all relationship links like brother/sister uncle_niece ect.

This test <V n="test_incest" t="is not incestuous" /> and <V t="disabled" n="test_incest" />
is actually a bypass to the test for incest and is active when club gatherings are active, so to allow incest to a certain degree, no woohoo though, just sit_together and at most kissing under very strict conditions.
The first one can be found in the pregnancy utils , so if you manage to have an incestuous child family links are destroys in the family tree.

The tooltip can be left alone, because it would only show if the test failed.

The default for incest test is disabled so if you remove the code it will be good, alternatively you can just put false works the same.

Remember that whenever you see a testset followed by other tests, only the tests that mach the testset will pass, if any fail than the interaction will be unavailable.

For example testset_woohoo says that minimum romance level should be 35 and required to have the first kiss bit, and the interaction says which sims to apply for that test. So we dont need to remove romance tests, we can simply create a new testset and then tell the interaction what testset to check. Alternatively remove the testset all together.
Test Subject
Original Poster
#5 Old 3rd Jul 2016 at 1:40 AM
Quote: Originally posted by azoresman
There are other tests like "prohibitive_relationships_bits" these have all relationship links like brother/sister uncle_niece ect.

This test <V n="test_incest" t="is not incestuous" /> and <V t="disabled" n="test_incest" />
is actually a bypass to the test for incest and is active when club gatherings are active, so to allow incest to a certain degree, no woohoo though, just sit_together and at most kissing under very strict conditions.
The first one can be found in the pregnancy utils , so if you manage to have an incestuous child family links are destroys in the family tree.

The tooltip can be left alone, because it would only show if the test failed.

The default for incest test is disabled so if you remove the code it will be good, alternatively you can just put false works the same.

Remember that whenever you see a testset followed by other tests, only the tests that mach the testset will pass, if any fail than the interaction will be unavailable.

For example testset_woohoo says that minimum romance level should be 35 and required to have the first kiss bit, and the interaction says which sims to apply for that test. So we dont need to remove romance tests, we can simply create a new testset and then tell the interaction what testset to check. Alternatively remove the testset all together.

I tried to get it to work by removing more and more things. I just removed as many things as I thought would interfere, and wound up removing most of the tests just to see if I could get it to work. I for sure went way overboard, for example you can pick anyone to woohoo with now, or every single option for romance is available all the time. I saw things like the prohibitive relationship bits, which were all removed. I removed all the test_incest instances from the code completely. Instead of altering things like the romance level or creating my own testsets to check things, it was easier to just remove the code. I also realized the one thing was the tooltip at some point, but it doesn't really matter.

I managed to get the romance to work, except pregnancy still doesn't work. So everything about romance works, you can woohoo, try for baby, kiss, etc. It shows marriage options (I didn't test it). However, when you try for baby, it's pretty messed up. I actually got an instance where it said they were not pregnant, then said they were right after. The sim got the moodlet for finding out they're pregnant, but the sim never progressed in the pregnancy nor did it become visible. I know the game dictates pregnancies become visible immediately after finding out, but it didn't work.

I'm not really sure why it isn't working. I removed the tests from a lot of files, including interactions.utils.pregnancy and bed_TryForBaby. Maybe it's possible I removed too much? Maybe I missed something?

I have the package attached if you care to look.
Attached files:
File Type: rar  removeIncest.rar (438.3 KB, 13 downloads) - View custom content
Instructor
#6 Old 3rd Jul 2016 at 2:02 PM
Quote: Originally posted by Ohura88
I tried to get it to work by removing more and more things. I just removed as many things as I thought would interfere, and wound up removing most of the tests just to see if I could get it to work. I for sure went way overboard, for example you can pick anyone to woohoo with now, or every single option for romance is available all the time. I saw things like the prohibitive relationship bits, which were all removed. I removed all the test_incest instances from the code completely. Instead of altering things like the romance level or creating my own testsets to check things, it was easier to just remove the code. I also realized the one thing was the tooltip at some point, but it doesn't really matter.

I managed to get the romance to work, except pregnancy still doesn't work. So everything about romance works, you can woohoo, try for baby, kiss, etc. It shows marriage options (I didn't test it). However, when you try for baby, it's pretty messed up. I actually got an instance where it said they were not pregnant, then said they were right after. The sim got the moodlet for finding out they're pregnant, but the sim never progressed in the pregnancy nor did it become visible. I know the game dictates pregnancies become visible immediately after finding out, but it didn't work.

I'm not really sure why it isn't working. I removed the tests from a lot of files, including interactions.utils.pregnancy and bed_TryForBaby. Maybe it's possible I removed too much? Maybe I missed something?

I have the package attached if you care to look.


Hi, can you make a package with all the same files in it's original state, so I can run a file compare to be easier for me ?
Test Subject
Original Poster
#7 Old 3rd Jul 2016 at 6:37 PM
Quote: Originally posted by azoresman
Hi, can you make a package with all the same files in it's original state, so I can run a file compare to be easier for me ?
Here you are. Thanks again.
Attached files:
File Type: zip  removeIncestOriginal.zip (545.0 KB, 12 downloads) - View custom content
Instructor
#8 Old 3rd Jul 2016 at 9:28 PM
Quote: Originally posted by Ohura88
Here you are. Thanks again.

Thanks, I'll check it and let you know what to do.
So the objective is to remove incest, and allow romance without requirements so anyone can be free to woohoo with everyone else, should Teens be included?
Test Subject
Original Poster
#9 Old 3rd Jul 2016 at 10:37 PM
Quote: Originally posted by azoresman
Thanks, I'll check it and let you know what to do.
So the objective is to remove incest, and allow romance without requirements so anyone can be free to woohoo with everyone else, should Teens be included?
Sure, that sounds about right. Teens being allowed was surprisingly easy to change since there was always just a test for age requirement.
Instructor
#10 Old 4th Jul 2016 at 6:29 PM
Hi again !

So I took a quick look at a few files you had change and the first thing i have to say is that there is no subject nor target for the interactions, that's why you don't even see it appearing (Woohoo)

We cant just remove all the tests or the interaction wont be available.

I'll make a set for woohoo in a single object and send it your way for testing. That way you'l have a notion of how to do the rest, there are many files missing, but ill tell you next time.

Remember that eve though you remove things from tuning files there is a default set in python core, and, in the absence of custom code in the tuning that default takes over.

I will try to do it later at night.
Test Subject
Original Poster
#11 Old 6th Jul 2016 at 7:37 AM Last edited by Ohura88 : 7th Jul 2016 at 8:11 AM.
Quote: Originally posted by azoresman
Hi again !

So I took a quick look at a few files you had change and the first thing i have to say is that there is no subject nor target for the interactions, that's why you don't even see it appearing (Woohoo)

We cant just remove all the tests or the interaction wont be available.

I'll make a set for woohoo in a single object and send it your way for testing. That way you'l have a notion of how to do the rest, there are many files missing, but ill tell you next time.

Remember that eve though you remove things from tuning files there is a default set in python core, and, in the absence of custom code in the tuning that default takes over.

I will try to do it later at night.

So I went back on my own and tried some more stuff. You were right on a bunch of accounts:

1. I added back a lot of the tests, only removing those I thought necessary to remove. The attempt I sent you removed everything because things weren't working, more so as a test to see if I could get it to work at all. I realize in the attempt I sent you, I removed everything including tests for certain buffs to occur, like jealousy, which there's no point in removing. The relationship works and I don't have a crazy bugged game now.

2. I realized I never did anything with the testSet files, which I went and added in. The testSet_tryForBaby didn't really have much. Other than global tests like dying and household size, it seemed to primarily just check the gender and age.

I still can't seem to get my sim pregnant though. They can get pregnant with their spouse but not with the related sim. I tried with a male and female adult sim of brother/sister. Everything else works fine, the romantic relationship, woohoo, try for baby, all of it works fine. It's just the one detail of actually getting pregnant seems to fail. Is there maybe a file I missed along the line? The files I've used that relate to pregnancy are:

interactions.utils.pregnancy
testSet_TryForBaby
bed_TryForBaby
debug_MakePregnant

I can't seem to figure out what test is failing, or why it's restricting it. I wouldn't think it has to do with the child being spawned, because that shouldn't happen until birth. It seems to have to be related to the family relationship.

EDIT:

I did some regression testing and figured out why I got that weird pregnant and not pregnant issue. It was because I removed the CommodityBasedObjectiveStateValue test in pregnancy_StartShowing. I'm still lost to how I solve this, but at least I figured that one out.
Instructor
#12 Old 8th Jul 2016 at 8:18 PM
Quote: Originally posted by Ohura88
So I went back on my own and tried some more stuff. You were right on a bunch of accounts:

1. I added back a lot of the tests, only removing those I thought necessary to remove. The attempt I sent you removed everything because things weren't working, more so as a test to see if I could get it to work at all. I realize in the attempt I sent you, I removed everything including tests for certain buffs to occur, like jealousy, which there's no point in removing. The relationship works and I don't have a crazy bugged game now.

2. I realized I never did anything with the testSet files, which I went and added in. The testSet_tryForBaby didn't really have much. Other than global tests like dying and household size, it seemed to primarily just check the gender and age.

I still can't seem to get my sim pregnant though. They can get pregnant with their spouse but not with the related sim. I tried with a male and female adult sim of brother/sister. Everything else works fine, the romantic relationship, woohoo, try for baby, all of it works fine. It's just the one detail of actually getting pregnant seems to fail. Is there maybe a file I missed along the line? The files I've used that relate to pregnancy are:

interactions.utils.pregnancy
testSet_TryForBaby
bed_TryForBaby
debug_MakePregnant

I can't seem to figure out what test is failing, or why it's restricting it. I wouldn't think it has to do with the child being spawned, because that shouldn't happen until birth. It seems to have to be related to the family relationship.

EDIT:

I did some regression testing and figured out why I got that weird pregnant and not pregnant issue. It was because I removed the CommodityBasedObjectiveStateValue test in pregnancy_StartShowing. I'm still lost to how I solve this, but at least I figured that one out.


Commodity as to be ADD_IF_NOT_SET>True
Test Subject
Original Poster
#13 Old 12th Jul 2016 at 9:39 AM Last edited by Ohura88 : 12th Jul 2016 at 10:20 AM.
Quote: Originally posted by azoresman
Commodity as to be ADD_IF_NOT_SET>True
I don't really get how this helps, and I'm confused. Is that how I can set the commodity when I want to? Could you give me an example of how that would be written out, cause I don't see it anywhere in the XML.

It seems like I just need to invoke pregnancy_StartShowing somehow in a way invokes correctly on the sim. How do I invoke a commodity on a sim? I feel like if we just set it to start showing, it will handle everything, though I could be wrong.

As far as I can tell, pregnancy_StartShowing gets invoked from commodity_PregnancyDiscovery. This gets called after try for baby or pregnancy test. This makes sense to me so far, it should randomly discover pregnancy or discover immediately if you invoke the test. The PregnancyDiscovery file confuses me though, so I tried to bypass it. I tried changing the instances of Discovery to StartShowing, but it didn't work. In fact, when I changed it, the toilet test option got disabled.

I don't really understand the whole loot file system, in the PregnancyDiscovery file how it calls the StartShowing file. To me it looks like it's calling on some sort of failure reasoning, but I can't tell. I'm just really confused because it works in normal instances (non-incestuous) but fails on the incestuous try for babies. And I've gotten some to show some of the buffs, but it still doesn't get further than just a buff showing.
Test Subject
Original Poster
#14 Old 21st Jul 2016 at 6:06 AM
Anyone have any ideas? I'm still stuck on this
Instructor
#15 Old 21st Jul 2016 at 10:38 PM
Quote: Originally posted by Ohura88
I don't really get how this helps, and I'm confused. Is that how I can set the commodity when I want to? Could you give me an example of how that would be written out, cause I don't see it anywhere in the XML.

It seems like I just need to invoke pregnancy_StartShowing somehow in a way invokes correctly on the sim. How do I invoke a commodity on a sim? I feel like if we just set it to start showing, it will handle everything, though I could be wrong.

As far as I can tell, pregnancy_StartShowing gets invoked from commodity_PregnancyDiscovery. This gets called after try for baby or pregnancy test. This makes sense to me so far, it should randomly discover pregnancy or discover immediately if you invoke the test. The PregnancyDiscovery file confuses me though, so I tried to bypass it. I tried changing the instances of Discovery to StartShowing, but it didn't work. In fact, when I changed it, the toilet test option got disabled.

I don't really understand the whole loot file system, in the PregnancyDiscovery file how it calls the StartShowing file. To me it looks like it's calling on some sort of failure reasoning, but I can't tell. I'm just really confused because it works in normal instances (non-incestuous) but fails on the incestuous try for babies. And I've gotten some to show some of the buffs, but it still doesn't get further than just a buff showing.

It seems like I just need to invoke pregnancy_StartShowing somehow in a way invokes correctly on the sim. How do I invoke a commodity on a sim? I feel like if we just set it to start showing, it will handle everything, though I could be wrong. Using an actionloot.

Most code is not on XML. Python side had the defaults and unless we want no default actions then we can do it though XML, other than that python runs the default settings .

I've been away and still am, so I can't do much now.

One advice, If you want, just use MC command center, it has all you need to accomplish your goal.
Test Subject
Original Poster
#16 Old 24th Jul 2016 at 9:14 AM
Quote: Originally posted by azoresman
It seems like I just need to invoke pregnancy_StartShowing somehow in a way invokes correctly on the sim. How do I invoke a commodity on a sim? I feel like if we just set it to start showing, it will handle everything, though I could be wrong. Using an actionloot.

Most code is not on XML. Python side had the defaults and unless we want no default actions then we can do it though XML, other than that python runs the default settings .

I've been away and still am, so I can't do much now.

One advice, If you want, just use MC command center, it has all you need to accomplish your goal.
I had no idea such a mod existed, it's got so much jammed into one mod. It worked and it's great.

Anyway, I didn't know you were away. I'm still interested in doing it just to figure it out and maybe leverage it to something else later. But I can wait until you've got time to help me out.
Back to top