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!
Forum Resident
Original Poster
#1 Old 25th Feb 2021 at 12:54 PM
Default Help - Potty Train Self Mod
My mod's main idea is that toddlers have busy parents / caretakers and shouldn't have to wait on them to learn such an essential skill in life, that is potty training! Also, I want to give a higher chance to townie toddlers to autonomously learn to use the potty chair and I think that it will happen more successfully if caretakers' involvement is not a requirement.

My tuning: Inside of the gameplaydata, I found the file "UsePottyChair_PottyChair" and tuned the "SkillThresholdValue" from "1" to "0", making the "use potty chair" interaction available even to toddlers who have not gained the "potty training" skill.

After testing, it turns out that the toddler is only able to unlock the "use the potty chair" interaction on the game's object *at the strict pre-condition* that a caretaker has, AT LEAST ONCE, sat them on the potty chair for the first time. Why? Because that's when the game considers that the skill has started to register.

What I want is:
* to get rid of that "skill being registered by the caretaker action" condition. How can I bypass this requirement?
* to start seeing a skill progress bar above the toddler's head when they use the potty chair. How can I make that happen?

@nitzims has kindly provided feedback and reviewed + contributed code for the project, to lift the restriction to involve the parent. When I use the code in Visual Studio, I get the following error message: "No overload for method 'UnRegisterForSkillLevelUpEvent' takes 1 arguments".

I'm attaching my VisualStudio source code - I can't seem to be able to upload my tuning package file (MTS won't take the zip file). If needed I can create a link to the file on Dropbox.

Can anyone help me get unstuck? I'm not sure what to do next to get this going, or even if it's possible to achieve at all...?
Attached files:
File Type: zip  MissPatTS3.PottyTrainSelf_VS.zip (27.3 KB, 38 downloads)
Advertisement
Field Researcher
#2 Old 25th Feb 2021 at 1:37 PM
When I was looking at this for my auto-potty-training addon to TheSweetToddler's mod, I think I saw that the level this skill - and every other not-even-started skill? - is initially set to is -1, not 0. So maybe setting it to 0 instead of -1 is what happens that first time to register the skill? You could check if that's true that with MasterController, and if it is, do something like what my auto-potty-training mod does for the older life stages, to set every toddler with level -1 potty training skill to 0 instead when a world loads/they age up to toddler/they're created as a toddler.

Not sure about the progress bar question though!
Forum Resident
Original Poster
#3 Old 25th Feb 2021 at 2:27 PM
Oh, that is super insightful! Thank you so much liz, going to try this tonight and publish an update.
Virtual gardener
staff: administrator
#4 Old 25th Feb 2021 at 2:40 PM
Quote: Originally posted by lizcandor
When I was looking at this for my auto-potty-training addon to TheSweetToddler's mod, I think I saw that the level this skill - and every other not-even-started skill? - is initially set to is -1, not 0. So maybe setting it to 0 instead of -1 is what happens that first time to register the skill? You could check if that's true that with MasterController, and if it is, do something like what my auto-potty-training mod does for the older life stages, to set every toddler with level -1 potty training skill to 0 instead when a world loads/they age up to toddler/they're created as a toddler.

Not sure about the progress bar question though!
This is indeed true!

Basically, -1 is a way for the UI to know "Oh this isn't the correct integer as it's a negative number, therefore we should never show the skill" (Because all sims do have all skills set for them, just that you can't see them in the UI)


Quote:
* to start seeing a skill progress bar above the toddler's head when they use the potty chair. How can I make that happen?

Actually quite easy! In your run function do:

Code:
Skill skill = base.Target.SkillManager.AddElement(SkillNames.PottyTrain);
 skill.StartSkillGain(num / 60f, showSkillMeterEvenForNpc); (OR DO:  skill.StartSkillGain())

/// When done:

 skill.StopSkillGain();

But that's just the easy way of doing it  The actual potty training code actually has this whole stuff of how many points to give it depending on traits, nannies and such.
Forum Resident
Original Poster
#5 Old 25th Feb 2021 at 5:26 PM
Wow, thank you so much for the piece of code Lyralei! Going to test it and let you know how it went.
Forum Resident
Original Poster
#6 Old 27th Feb 2021 at 1:59 AM
Tiny update: problem #1 is now solved! Tuning the "SkillThresholdValue" to "-1" (instead of "0") successfully unlocks the "use the potty chair" interaction for all toddlers, even those that no adult ever sat on the chair! Yay, thank you both lizcandor and Lyralei for this insight! I'd never have thought about using this negative value.

I need to implement the "skill progress bar above toddlers head" code tomorrow, will let you know how it went!
Forum Resident
Original Poster
#7 Old 5th Mar 2021 at 5:02 PM Last edited by MissPat : 11th Mar 2021 at 5:07 PM.
Default EA Default Values for Potty Training
Small progress & update: I've done what I call a "benchmark" gameplay with no mods affecting the potty training skill, and found this data for reference (includes looking up EA's own ITUN files data):



CORRECTION
I wrote "Also: at the condition that the toddler's caretaker (parent/robonanny/daycare pro) has not used the "change the diaper" interaction which fills up the Bladder motive." However after testing in-game this statement, it turns out that there is no such interaction as "change the diaper" in the game, that fills up both the Hygiene bar and the Bladder bar.
The interaction name is only "change" and it only fills up the "Hygiene" bar. Mea maxima culpa.
Forum Resident
Original Poster
#8 Old 5th Mar 2021 at 5:59 PM Last edited by MissPat : 11th Mar 2021 at 5:02 PM.
Default Baby / Toddler Wipes Mod Idea
The main insight/breakthrough I had through my "benchmark" gameplay of the potty training skill, is that caretakers will unknowingly ruin critical opportunities for toddlers to learn the skill, when looking after the toddler's hygiene motive. Indeed, as it turns out, most the Store's changing table TS3 interactions that involve solving a toddler's low Hygiene motive, are mixed up with interactions that simultaneously solve a toddler's low Bladder motive.

It may not sound like a big deal, but it is annoying when you consider that in a "normal" lifespan, your toddler has 7 days to learn all 3 essential skills (potty train, talk, walk) and then some extra skills like they do when playing with the xylophone / activity table and so on.

Do also keep in mind that my mod ideas are almost always geared towards townies - and in this case townie toddlers - achieving things autonomously, on their own, as opposed to the vanilla EA, user-directs-all gameplay.

Strong (and frustrated by) this discovery, I took it to Discord and asked:


The amazing @SimsKtar came to the rescue and made a jaw-dropping really good point:


This is nothing short of a brilliant idea and the kind of gameplay breakthrough I live for, as a Tuning Modder and a (very struggling) aspiring script modder! Baby / toddlers wipes mod idea was born from this exchange and I'll be creating a separate thread to discuss that very mod development.

For now, back to working on the "Potty Train Self" mod. Hope that sounds like a cool thing to do with my days.
Forum Resident
Original Poster
#9 Old 11th Mar 2021 at 4:52 PM
Short but mighty update: I did a final "benchmark" gameplay using EA default value for the potty chair usage, and it turns out that it took a whopping 16 hours for my test potty-trained toddler, to go from a full Bladder bar, to a critical orange Bladder (bar only about 5% full), when he autonomously decided to go and use the potty chair.

Judging from this data, the bladder of EA programmers' toddlers must be made of steel.

NEXT STEPS


Then it will be time to take fun game pics for the MTS upload queue. Can you believe I found colorful toilet paper rolls CC just yesterday! So ready to use them.

CORRECTION
I've edited one of my posts above where I claimed that the "change" interaction performed by a caretaker on a toddler filled up the Bladder bar of toddlers. I assumed "change" meant "change the diaper". Wrong assumption on my end. Mea culpa. I've tested this interaction, and it does not fill up the Bladder bar of the toddler, at all. It only fills up their Hygiene bar.
Virtual gardener
staff: administrator
#10 Old 12th Mar 2021 at 6:51 PM
LOL that IS a strong bladder! :p Especially given the fact that for child and above, the moodlets for toilets are like in 3 steps!

Can't wait to see it!
Forum Resident
Original Poster
#11 Old 12th Mar 2021 at 9:55 PM
Thank you for the support Lyralei!

Today's update:
So I did try to add a "Fun" commodity kind to the "use potty chair" ITUN file. I tried to set the advertising value to, in order: 400, 150 and 100 and the actual value to 0. With those values, the test trained toddler would literally PEE IN A LOOP. He'd get on and off the potty chair every 30 minutes (every end of usage cycle). Apparently *nothing else* in the home appeared more fun than the potty chair. Did. Not. Expect. That. Wow.

When I checked the "Fun" value that EA sets for most toddlers objects, it is either 30, 35 or 40, at the exception of the "play with the mirror" interaction in the playpen, that lasts 10 min each time and has a "Fun" value of 150! No wonder toddlers can't stop babbling in the playpen.

So now I'm down to the fun value 45 since it's barely above EA's max value of 40 and doesn't seem to be distracting toddlers from going about their day (playing with toys, reading toddler skill books, etc.) before autonomously using the chair.

The trained toddler still go every 16-18h to the potty chair autonomously which I guess from the data above, I can't quite influence (I can't make him use the chair more frequently unless it involves a pee loop). Now I'm hoping that untrained toddlers, with the Fun advertised at 45, will not have Bladder accidents anymore and will autonomously use the potty chair when their Bladder bar is only 5% full.

If it fails, and untrained toddlers still have Bladder accidents, then it will mean my tuning mod can't work as I intended it. In which case, I will need to start my plan from scratch with script modding... One can only hope it works

To be continued.
Forum Resident
Original Poster
#12 Old 13th Mar 2021 at 2:51 PM
Default Tuning failure
My untrained toddler had a Bladder failure accident. He never autonomously walked to the potty chair, even when his Bladder need became critical.

I guess it was to be expected? Unlocking the "use potty chair" via tuning for untrained toddlers, does not equate to giving untrained toddlers the "instinct" to actually crawl to the chair and use it.

I'm not going to lie, this is a huge disappointment as I was hoping I could achieve all this via tuning. I'm back to square one and having to roll up my sleeves and learn script modding to reach my goals.

I'm going to start with Pudding Face's video tutorial here. Going to take a break from this mod for a bit and pick up pending mod projects where I'm more likely to be successful...

*Terminator Voice* I'll be back.
Back to top