x4fab HI, here my considerations.
Regarding your idea of time-dependency of weather parameters, I think it is good as long as it extends to more settings. For Instance, if I understood your idea:
if SEASON == 'winter' then
SKY = {
LOW = ( 0, 31, 89, 1 ),
HIGH = ( 0, 35, 102, 1 )
}
elseif TIME_HOUR < 13 then
SKY = {
LOW = ( 0+ TIME SKYLOW_COEFF1, 32+ TIME SKYLOW_COEFF2, 90 + TIME SKYLOW_COEFF3, 1++ TIME SKYLOW_COEFF4 ),
HIGH = ( 0+ TIME SKYHIGH_COEFF1, 45+ TIME SKYHIGH_COEFF2, 112+ TIME SKYHIGH_COEFF3, 1+ TIME SKYHIGH_COEFF4 )
}
SUN= {
LOW = ( 0+ TIME SUNLOW_COEFF1, 32+ TIME SUNLOW_COEFF2, 90 + TIME SUNLOW_COEFF3, 1++ TIME SUNLOW_COEFF4 ),
HIGH = ( 0+ TIME SUNHIGH_COEFF1, 45+ TIME SUNHIGH_COEFF2, 112+ TIME SUNHIGH_COEFF3, 1+ TIME SUNHIGH_COEFF4 )
}
....
else
SKY = {
LOW = ( 0+ TIME SKYLOW_COEFF5, 32+ TIME SKYLOW_COEFF6, 90 + TIME SKYLOW_COEFF7, 1+ TIME SKYLOW_COEFF8 ),
HIGH = ( 0+ TIME SKYHIGH_COEFF5, 45+ TIME SKYHIGH_COEFF6, 112+ TIME SKYHIGH_COEFF7, 1+ TIME SKYHIGH_COEFF8 )
}
SUN= {
LOW = ( 0+ TIME SUNLOW_COEFF5, 32+ TIME SUNLOW_COEFF6, 90 + TIME SUNLOW_COEFF7, 1++ TIME SUNLOW_COEFF8 ),
HIGH = ( 0+ TIME SUNHIGH_COEFF5, 45+ TIME SUNHIGH_COEFF6, 112+ TIME SUNHIGH_COEFF7, 1+ TIME SUNHIGH_COEFF8)
}
....
end
Better use a multiplier than a divider, and coefficient must allow negative/decimals values.
Regarding the idea of "extended time slidebar" (THIS IS NEEDED FOR NIGHT SCENARIOS), my idea is the following:
- TIME_HOUR is the hour selected by the end-user in the Racing_Menu and ranges between 0 and 23:59
- AC_HOUR is the actual time (in the range 8-18) sent by CM_Laucnher to AC racing engine
"Sample Code"
AC_HOUR=TIME_HOUR
if TIME_HOUR > 18 then
if TIME_HOUR > 20 then
AC_HOUR = (TIME_HOUR - 12) #this transforms the SUN cycle in the MOON rising cycle
else AC_HOUR = 8 #needed to avoid inconsistent timing for AC racing engine (when TIME_HOUR is between 18 and 20)
elseif TIME_HOUR < 8 then
if TIME_HOUR < 6 then
AC_HOUR = (TIME_HOUR + 12) #this transforms the SUN cycle in the MOON descending cycle (when TIME_HOUR is between 0 and 6)
else AC_HOUR = 18 #needed to avoid inconsistent timing for AC racing engine (when TIME_HOUR is between 6 and 8)
Unfortunately the editor deletes the indentation, hope you get the idea