Checking for time and stack object stuff
For example, you have three different energy levels: one for the period from 1800 to 2000, one for 2000 to 2200, and one for 2200 to 2400. You must then test in the following order:
0. Global Hour >= 0x12 (True -> 1, False -> 9)
1. Global Hour < 0x14 (True -> 2, False -> 3)
2. Test sim's energy check for this window (True -> 8, False -> 9)
3. Global Hour >= 0x14 (True -> 4, False -> 9)
4. Global Hour < 0x16 (True ->5, False ->6)
5. Test sim's energy check for this window (True -> 8, False -> 9)
6. Global Hour >= 0x16 (True -> 7, False -> 9)
(there is no test for midnight, becasue time resets to 00 anyway)
7. Test sim's energy check for this window (True -> 8, False -> 9)
8. Send sim to bed.
9. Window for sending sims to bed has passed, so have them drink coffee instead.
If you wish to test times past midnight, remember that midnight is 00 the next day. So perform those test first.
One *could* put tests out of order, but it's much easier to mess that up. So do yourself a favor, and keep things ordered chronologically.
Also, some tests *could* be ommitted (for example: testing for ">= 0x14" is not really needed if you've already tested for "< 0x14") but just to make it easier for yourself and others to read, keep those tests in, anyway. At least until you're absolutely certain that everything works as intended (rigorous testing is recommended). Then later, you can always remove the superfluous tests...
As information to anyone wanting to attempt this themselves, I first did what BO said and defined both lower and upper limit for each span. But as I was setting it up, it was clear that the lower threshold was superfluous. If test 1 checks if it's earlier than 2am, what's the point of checking that it's later than 2 am before checking if it's earlier than 8am? We already know it's later than 2am when that check runs, because we already checked if it's earlier and it came back false. So I first tried doing it as BO said, including both a lower and upper limit, and when I found that worked, I tried removing the checks that were repeating the previous stage, and it still works. So it seems if you just set it up properly you only need one hour check for each stage
I'll add a picture of how I set it up, since it's probably hard to understand from text
Now that I know the code runs properly, I'll incorporate it into the sleeping code. I was using it as guardian bhav for a painting interaction while testing, easy to test that way.
I'm exhausted, so I'll head off to bed now. I'll be back with my second question when I have an example to show what I mean, easier when there's something concrete to refer to
Perhaps @MSD or @mustluvcatz?
The tiny car in inventory approach is at a stand still. The manage inventory we used in car code does not work in school code, because stack object does not refer to the person. I either have to figure out how to edit stack object to be the Sim, and then edit it back to what it was previously, or I have to figure out a different way to set up manage inventory. I posted about it in bounding box thread, but no replies so far so at the moment I can't do anything.
EDIT: I'm still hoping to figure that part out, because children can't own cars and I'd like to be able to stop the school bus for them as well I have a couple of Sim parents that I think would like to drive their kids to school.
I've been poking around in the different arguments for expressions, and I noticed you can make it check for flags and all kinds of things. So I suppose if anyone knows how to check for a specific thing that I could give to my car that will be unique to my car (meaning regular maxis cars won't have it), that would work as an alternative to checking for guid