https://triplis.github.io/nav/guides.html
The following are guides that I've written for some aspect of modding The Sims 4. If you have comments or questions, I suggest asking in the creators-workshop section of Deaderpool's discord. I don't have a devoted section for modding questions in my discord and I'm the only modder I know of in my discord who pays attention to it. Deaderpool's discord is the main hangout I know of for modders, so you'll likely get better help there.
I suggest downloading the Template Script first, so that you have the full thing on hand for reference. This guide assumes you have basic knowledge of modding for The Sims 4 already (though you are of course welcome to jump into the deep end if you don't) and will attempt to show you how to inject to the tuning in an interaction test_autonomous
through a script, bypassing issues with overrides and compatibility, such that you will be able to:
guitar_Practice
can be done autonomously under new circumstances, like when a sim has the dazed buff from losing a fight.bed_Nap
can only be done in a certain time range during the day (ex: from 1pm to 5pm).test_autonomous
and the logical issues that could arise if two different mods have conflicting design goals for the same interaction.What this guide will NOT cover:
allow_autonomous
tuning set to False. This is another topic and could require a lot more than fiddling with test_autonomous
test_globals
or main tests
section. For some interactions, you would need to modify both these and test_autonomous
to expand the circumstances under which the interaction can autonomously occur. That is a convoluted area and is just a mess to work with for some interactions.The first thing we will cover is how to add something as a new type of circumstance under which the interaction can trigger autonomously. We will be using the interaction guitar_Practice
as the interaction we want to modify. I suggest locating this file in your extracted files if you have them all extracted, or going and extracting it with your XML Extraction Tool of choice, so you can follow along.
If you look in its test_autonomous
section, you will notice a number of circumstances under which the interaction can occur autonomously already. Things like if it passes the appropriateness
parameter, if Guitar Skill is level 2 or higher, etc. Note that each <L></L>
part is a set of tests. This is important information, but don't worry, you don't need to memorize it. There won't be a test. I mean, wait. There will be tests... in the interaction. There won't be a test, testing you.
You know what I mean.
For what we're wanting to accomplish, we want to add a new set of tests, or new list, aka: <L></L>
part. We're going to place these tests inside of a TestSetInstance file, so that our script only needs to know how to inject one type of input: a TestSetInstance file. You can go and extract any TestSetInstance file for reference, to build yours off of. I'm going to go for the first one I see, which is testSetInstance_NotOverflowingTrash
, but it doesn't matter which one. I'm just pulling one out and making a copy so I don't have to write all of the code by scratch for our TestSetInstance file. I'm going to rename its n=
value to Triplis:TestSetInstance_InjectingToTestAutonomous_Tutorial
and then use my Auto Hash tool on it to get it set up more quickly.
Now we need to figure out what tests we want to have. How about I get your input? ... What's that? You want to make it so that sims can go for the Guitar when their bladder is low? Alright, if you say so.