Closed deAnjou closed 2 years ago
Yes I'm having the same issue! I was wondering the same thing, thank you for bringing it up! Hopefully we get some answer soon. I've been having accidents naturally for like a year straight (in game year obviously) and nothing seems to have happened regarding continence.
Ditto here for a recent playthrough. The ChangeBladderContinence and ChangeBowelContinence functions in body.cs should be lowering their respective continence values by 0.01 per !voluntary wetting, but the in-game behavior is that continence is actually increasing by 0.01 per accident, up to the maximum of 1.0. I tested this and was able to reproduce it across two different saves and a fresh file. It at least tells us the functions are being called, but it seems they're not behaving as intended.
My first thought was that the value of the "percent" variable might be getting set to a negative somewhere for !voluntary wettings and messings, resulting in ChangeBladderContinence/ChangeBowelContinence subtracting -0.01 for any involuntary accidents, rather than subtracting 0.01 as it should.
I was thinking the StartWetting and StartMessing functions could be the culprits with the following lines, since (I think?) it sets percent to a negative for a !voluntary accident:
if (!voluntary || bowelFullness > GetBowelTrainingThreshold())
this.ChangeBowelContinence(-0.01f);
else
this.ChangeBowelContinence(0.01f);
But if that were the case then voluntary wettings and messings should be decreasing continence (since voluntary = true would set "percent" to 0.01f and "bowelContinence -= percent;" would subtract that amount, right?), which isn't happening.
My coding knowledge is pretty limited though, so I'm probably just misunderstanding how the function works in general. Maybe that portion is working as intended and the voluntary variable is just always getting set to true for all wettings and messings?
As an aside, I wanted to second the thanks for reviving the mod and the work that's been done on it since. I keep coming back to playing SDV and it's in no small part due to how well this mod integrates needs and diapers. Appreciate you tons, Zippity and co.!
Hi, I suppose the code work as it should. The problem is the code work not exactly as we expect. Continence level decrease only if you mess or wet by pressing F1/F2 buttons, and your fullness level is less than half of the bar. In short you continence decrease if do it too often (I suppose the same thing as in real life). In opposite way continence level increase if you have an incident or you press F1/F2 with fullness level higher than half.
Btw how do you think it would be better to work?
The first line of the StartMessing/StartWetting functions set the voluntary bool to false, then !voluntary inverts the value of voluntary. So "if (!voluntary || bowelFullness > GetBowelTrainingThreshold())" actually means "if voluntary = true or bowelFullness is greater than GetBowelTrainingThreshold, increase continence".
That said, this means the continence decrease is definitely not functioning as intended. When voluntary = false, we should be hitting the " else this.ChangeBowelContinence(0.01f);" line and having 0.01 subtracted from continence, which again, is not happening.
Not quite this.
"public void StartWetting(bool voluntary = false, bool inUnderwear = true)" this piece of code mean that if you call "StartWetting();" Without any bool variables, the code will automatically set "voluntary" to default (false) and "inUnderwear" to default (true).
But if you call "StartWetting(true, true);" at this time, the code will use data that you have passed and never change it to default values.
That's cool that you have experience in c++, regardless it was long ago.
Haha I was just rewriting my post to update to effectively what you just said. And unfortunately, as you can see, the past experience leaves me in that "knows just enough to be wrong all the time" state 😅 Learning experiences though!
Code aside, continence is intended to be decreasing for involuntary accidents. It's how it's functioned in all past versions, with perhaps the exception of the one previous to this (I skipped one or two updates since my last playthrough). Nothing in the change logs for these past few releases indicate that this was an intended change, either, and Zippity has been pretty on-point with documenting the intentions of changes.
I'm guessing it was something in the body_rebalance_take_2 update, considering the Leo one is just a small change for Leo and the SMAPI update. There was a change to bowelCapacity that might be worth checking out, only thing I'm seeing that could be related, but I'm done combing through code for a few days here, I think haha.
As I suppose this problem has appeared because the mod works in a way that people don't expect to.
If you have any proposals, I can try to rework this level system.
I have found changes that possibly had break the system.
if (!voluntary || (double)this.bowels < (double)this.maxBowels * 0.5)
this.ChangeBowelContinence(true, 0.01f);
else
this.ChangeBowelContinence(false, 0.01f);
Had changed to
if (!voluntary || bladderFullness > GetBladderTrainingThreshold())
this.ChangeBladderContinence(-0.01f);
else
this.ChangeBladderContinence(0.01f);
-
public void ChangeBowelContinence(bool decrease = true, float percent = 0.01f)
{
if (decrease)
percent = -percent;
float bowelContinence = this.bowelContinence;
this.bowelContinence += 2f * percent;
Had changed to
public void ChangeBladderContinence(float percent = 0.01f)
{
float previousContinence = bladderContinence;
//Modify the continence factor (inversly proportional to rate at which the bladder fills)
bladderContinence -= percent;
In the first review if you mess or wet voluntarily you will increase your level, and if you had an incident you will decrease it. And finally is that you change your Continence level two times faster than now.
Phew, look at these messages. I love the community involvement!
I apologize for the slow turn-around; I now have an infant son and that is taking up most of my time. :)
As has been speculated here, this is indeed a bug. I must have pushed it up without proper testing. I think it slipped into a fix while I was still working on it.
I am putting up a new version with this resolved, with the added bonus that continence loss/gain rates are now configurable in the config file!
I will close this issue once I have it released.
Release is up! v1.2.7
Firstly i'd like to say that this is a fantastic mod and i can't thank you enough for reviving it.
Though i am struggling to figure out how continence works.
No matter how many accidents happen the continence of a character doesn't decay, to check if it was working i tried forcing several consecutive accidents via the debug commands but to no effect. I know this because i checked the RegressionSave file after every night to see if the character bladder/bowel stats changed but they always stayed at 0.99, barely changed at all.
I don't know if this is truly a bug or if i'm just missing something here, any advice would be greatly appreciated.