Home | Download | Discussion | Help | Site Map | New Posts | Sign in

Latest Site News

Nysha's New Creators for November - posted on 1st Dec 2017 at 9:00 AM
Replies: 3 (Who?), Viewed: 4563 times.
Instructor
Original Poster
#1 Old 9th Apr 2017 at 2:34 PM
Default Set days into season?
I know how to set the current season (and the day of the week and the time - both hours and minutes), but is there any way to set the number of days into a season?

So, if seasons have 5 days, is it possible to set Spring:1 thru Spring:5?

TIA

W

Just call me William, definitely not Who-Ward
Advertisement
Née whiterider
staff: administrator
#2 Old 10th Apr 2017 at 10:49 AM
Yes, it is - SimWardrobe's Seasons & Weather controller (Sims 2 -> Objects -> Other Objects) does this.

What I lack in decorum, I make up for with an absence of tact.
Instructor
Original Poster
#3 Old 10th Apr 2017 at 11:45 AM Last edited by whoward69 : 10th Apr 2017 at 3:47 PM.
That will change the number of days in a season (so three of seven day season), not how far into the season you are. I want to be able to set "the second day of Spring, or the fourth day of Autumn"

Edit: Even tried looking at the Lua for "Set Current Season" (assuming that did something to set day 1) ... my head hurts now!

Edit2: Think I've found this in the WCD (Climate Controller) BHAV 0x1001

Just call me William, definitely not Who-Ward
Instructor
Original Poster
#4 Old 16th Apr 2017 at 10:42 AM
Posting this in case anyone else comes looking for the information ...

Seasons have two time based components - their length in days and the number of days remaining in them.

Confusingly, the number of days remaining in a season can be longer than the season's length.

It is not possible to set (via code) the length of a season - they are hard-coded in BCON 0x1016 (Seasons - Season Lengths) in the Climate Controller (group 0x7F232AB) (you could however write a global mod to override the BCON, but that's just swapping one hard-coded value for a different one!)

All objects/mods (that I've found) that claim to set the season length actually set the number of days remaining in the season. What's the difference?

If you set Spring to be "7 days long" by setting the remaining days in the season to be 7, only the current Spring will be 7 days in length, wait a year and next Spring will be the standard 5 days long (see BHAV 0x1002 - "Season - Update" in the Climate Controller)

To add further confusion, the number of days remaining in a season is comprised of two values - Days Standard and Days Additional.

If Days Additional is set to -1, the season never ends, otherwise Days Additional is decremented for each day that passes. When it reaches zero, Days Standard is decremented for each day that passes, and when that reaches zero the season changes.

When the season changes, Days Additional is set to 0 and Days Standard is set to the associated value from the BCON

Why two parts to the days remaining in a season? Who really knows, but Days Standard controls how much of the "season progress meter" is filled in. Confusingly, while the (hard-coded) length of the seasons is five days, there are only four divisions in the progress meter. This means that for both day 1 and day 2 of the season, the meter will be one-quarter full, on day 3 it will change to half full, on day 4 it will be three-quarters full and on day 5 it will be completely filled.

To change the meter it is therefore necessary to change the number of remaining days in the season in Days Standard (via the Lua primitive 0x7E and the script "Season - Days Standard - Set")

To change which day of the season it is, it is necessary to zero Days Additional and set Days Standard to be ((5+1) - RequiredDayOfSeason), eg to set the second day of the current season, Days Standard would be set to ((5+1) - 2) = 4

Note: In an ideal world we wouldn't use the hard-coded value of 5 in the above equation but read the appropriate value from the BCON in the Climate Controller for the current season - except it's a private BCON and there is no provided BHAV to get the value(s). We could add a CT style BHAV to the Climate Controller, get an instance of the Climate Controller, use Run Tree By Name to execute the added CT BHAV and use the value it returned ... the choice is yours!

Just call me William, definitely not Who-Ward
Back to top