Sleep autonomy modding
#1 02-02-2016 
Hey guys. I got a request on MTS that is turning out to be a little bit more complicated than I anticipated. I think it's something a lot of people would appreciate having, so I do want to get through it, but I'm having trouble understanding the guardian BHAV I need to edit, and if I don't understand it I can't tell what needs to stay and what needs to go, and where to add my code.

The request is to modify autonomy for sleeping in beds, making it possible only at low levels of energy. I decided to build upon that and add time parameters, so that it requires different amounts of energy at different times of the night. That way Sims don't end up staying up all night waiting to hit very low energy. I know how to code it, I don't need any help with that, but I need to understand where the original energy check is kept so that I can remove it, and I need to figure out if anything else has to go.

The BHAV I'm modifying is called Interaction - Sleep - Autonomous - TEST. It is group 0x7F4437F2.

1. The BHAV starts with some kind of GUID check. If true, it goes to 1B, which then goes to 1 regardless if true or false. I looked up the GUID of line 0x0 and it comes up as Controller - Temperature Receptivity, which makes no sense to me. I don't understand what 0x0 or 0x1B is doing, and since that's the very beginning of the BHAV I really ought to be sure what it does.
[Image: 309jvuu.jpg]
[Image: 23r8ehe.jpg]

2. What does this mean? I don't know what sleep state refers to, and so I can't really tell what it's doing. It's returning false if false, so it's something to do with hiding this menu option if sleep state isn't zero.
[prim 0x0002] Expression (My motive 0x000B (Sleep state) == Literal 0x0000)

3. Am I correct in understanding it as though adjust ads-lines only affect the autonomy advertising, nothing else?
[semi 0x201B] Bed Rel. - Adjust Ads - Sleep (no args)

4. I think line 0x7 is the one that's deciding if the Sim is tired enough, but it's not in a format I'm used to seeing for that. It's the only line that mentions energy though, so I feel like this has to be the one.
[prim 0x0002] Expression (Check tree advert: Range 0x0005 (Energy) /= Literal 0x0003)
What's check tree advert: Range?

The rest I think I understand. Thanks in advance to anyone who has the energy/time to answer my questions this time <3
gummilutt, proud to be a member of LeeFish since Jun 2013.

0
#2 03-02-2016 
Looking at the coding - my guess is that sleep state is whether the sim is awake or asleep. If the sim is already asleep, then false. For those moments when they don't make it to bed on time.

For the rest of it I'd wait for people who know bhavs better than me.

1
#3 03-02-2016 
That's what I thought at first, but when looking at the true/false I got confused and for some reason thought it couldn't be. I looked at it again now and if false it sends false, so I think you are right that it's simply checking if the Sim is already asleep, or not.

0
#4 03-02-2016 
I wouldn't even touch advertisement stuff with another person's 20 ft pole, let alone with my own bare hands. Because I have no clue what it does. So I'm sorry, but you get no help from me here.

1
#5 03-02-2016 
I'm not trying to touch advertisement stuff BO. I am asking question 3 to confirm that it's related to advertising and should be left as is. Or are you perhaps saying that everything I asked about is all advertising?

0
#6 03-02-2016 
I know you're not touching advertisement directly... yet. But you want to make the sims' decision to get some sleep more dynamic, adjusting their behavior based on both their energy level and the time of night. That must mean that advertisement has a stronger effect as it gets later. That's close enough. I still need to see the first mod by any of the great modders - which I'm not one of - that gets that close to this stuff.

1
#7 03-02-2016 
I know Mog made that dress me correctly mod that was all based on the time of day? Maybe there are some pointers in that.

1
#8 03-02-2016 
That wasn't my plan BO. Sims already have enough drive to go to bed, I don't see the need to mess with advertising. What I was going to do is add time checks, and then an energy need check. If the Sim does not have low enough energy for the time of day, I send false, preventing them from autonomously going to bed. If they are low enough, send true, and they can go to bed if they so desire.

0
#9 03-02-2016 
Ok, I understand that. Well, I hope for your sake that you'll be successful. But If I read your first post on this issue correctly, you are still planning to mod a BHAV that contains this ad check, and you're not sure where in that BHAV to put your code. Right?

1
#10 03-02-2016 
Yes, that is correct. Beds appear to have separate sleep interactions depending on if it's autonomous or not, and this is the bhav for the autonomous version of sleep. Before I start considering where to put the code, I feel I need to understand everything it's doing, and the things I listed in the first post are the things I am unclear about. Before I've figured out what they are, or confirmed they can be ignored, it would be irresponsible of me to modify it and share it with other people.

0


Sorry, that is a members only option