Jump to content
meatball

What's up with setOvercast?

Recommended Posts

So, I've been spending a lot of time digging through the weather code lately working on a new weather script, and for the most part a lot of the commands are pretty straight forward and work pretty well consistently. There is one exception....setOvercast.

I've done a lot of testing, and come to the conclusion that setOvercast makes it very difficult to write up any weather scripts. From what I've found, moving the overcast up/down is not a nice straight line up and down over time. Here's what I've found with some testing.

1) If you start at 0.5 overcast, if you try to go up using '0 setOvercast 1' or down using '0 setOvercast 0' the increase/decrease rate (at first) will be the same at approximately .083 per minute.

2) If you start at 0 overcast and go up towards 1 using '0 setOvercast 1', you will initially go up at a rate of approximately .0167 per minute.

3) If you start at 1 overcast and go down towards 0 using '0 setOvercast 0', you will initially go down at a rate of approximately .0167 per minute.

4) On the other hand, if you try to go up when you are already at a high level of 0.9 and then try to '0 setOvercast 1', it goes extremely slow, only going up approximately .00167 per minute.

5) And the same goes on the reverse, at 0.1 overcast, going down to 0 goes at .00167 per minute.

To make matters worse, things don't match up if you use a different transition time. For example, starting at 0, I tried setting 3600 setOvercast 1; (3600 because it takes about 3600 seconds to go from 0 to 1 at .0167/minute). The numbers went up about .011/minute...

I'm sure with some math magic you can write some script that would look at the original overcast value and figure out how fast it'll go up and down and set the 'setOvercast' command, but it would be soooo much easier if it was just a linear progression up or down, regardless of where you are on the overcast scale to start. If there's any Dev's that could shed some more light on the command, that'd be great. :)

Share this post


Link to post
Share on other sites

So, I did a bit more experimenting and it clears up some stuff, but raises more questions. The speed at which you can up / down in Overcast is directly related to the starting overcast level. The speed will stay consistent the entire time it's going up or down, but that speed will vary based on the starting level. For example:

1) Starting a 0 overcast, 0 setOvercast 1; still goes up about .0167 per minute as I mentioned before. But that stays constant the entire time and you'll reach one in about 60-61 minutes.

2) Starting at .5 overcast, 0 setOvercast 1; goes up just about half at .083. Going from .5 to 1 takes, you guessed it, 60-61 minutes.

3) Starting at .9 overcast, 0 setOvercast 1; goes up at about .00167 per minute (10x slower than when starting at 0) and takes....about 60-61 minutes to reach 1.

Starting at 1 and going down works in the inverse with 1 to 0 going the fastest and 0.1 to 0 going the slowest.

So, yes, that makes a bit more sense of what it's doing, but it makes it a mess to try to handle scripting of weather.

Edited by Meatball

Share this post


Link to post
Share on other sites

I have found that if you use the skiptime command, you can get it to be exactly what weather type you want.

skipTime -24;

86400 setOvercast 1;

skipTime 24;

This will instantly change the overcast to exactly what you set it to. Hope this helps.

Share this post


Link to post
Share on other sites

Yes, that works to start a game with a specific type of weather, but it doesn't help if you want to allow for random changes in weather from mission to mission or even during a mission.

Some more followup to testing.

Starting at 0.0, 0 setOvercast 1: Moves up ~ 0.0167/Minute

Starting at 0.2, 0 setOvercast 1: Moves up ~ 0.0131/Minute

Starting at 0.4, 0 setOvercast 1: Moves up ~ 0.0099/Minute

Starting at 0.6, 0 setOvercast 1: Moves up ~ 0.0066/Minute

Starting at 0.8: 0 setOvercast 1: Moves up ~ 0.0033/Minute

Doing the reverse inverses the numbers (moving from 0.8 -> 0 at 0.0131, etc.) and there's definitely a pattern here. But even with the pattern, there's no way to use it because if you change the transition time, it throws it off. For example, starting a 0 and moving to 1 you get to 0.2 overcast in 20 minutes. Yet...if you toss in the command 1200 setOvercast 0.2;, (1200 seconds = 20 minutes) after the transition you are only up to .066 overcast (0.0033/minute).

Le sigh...

Edited by Meatball

Share this post


Link to post
Share on other sites

This is a known issue and is on the feedback tracker. If you want the commands fixed please vote it up here

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×