Page 1 of 1

ScenEdit_SetWeather and numbers

Posted: Fri Jun 22, 2018 9:44 pm
by Whicker
Undercloud is supposed to be 0 to 1.0 in .10 increments.

is it ok to pass in larger numbers like 1.2? it works great, it just gets treated as 1.0.

Also, I get really long decimals when I put in values - like 8/10 frequently becomes .799 or something.

Everything is working really well, it just chooses what ever is closest to an accepted value. Just seeing if this is unsupported or normal/approved behavior.

For example I modify the undercloud by .04 either up or down every xx minutes to give a smooth transition over time. So my undercloud values are never 1 decimal place. Being able to pass in 1.2 is great as it makes the bad weather last longer if my modifier is small. So at midnight a random number is generated between .7 and 1.2 and passed in to the undercloud- if you get 1.2 it will stay foggy for a long time.

RE: ScenEdit_SetWeather and numbers

Posted: Fri Jun 22, 2018 11:19 pm
by Rory Noonan
If it's working as expected and doesn't throw an error, then there's no problem.

The 8/10 returning .799 is unusual though. Happy to take a look at that, just post the scenario with the script in it (and let me know where to look)

RE: ScenEdit_SetWeather and numbers

Posted: Fri Jun 22, 2018 11:36 pm
by Whicker
try this in the cosole:

local x = 8/10;
ScenEdit_SetWeather(15,0,x,1);
local scenarioWeather = ScenEdit_GetWeather();
print (scenarioWeather);

I get undercloud as an 18 digit decimal. I can't post it as I am too new, it thinks it is a phone number.

RE: ScenEdit_SetWeather and numbers

Posted: Sat Jun 23, 2018 4:17 am
by Rory Noonan
Yeah. That is weird. I'll add a ticket for the code guys to look into it.

Thanks for the heads up!

RE: ScenEdit_SetWeather and numbers

Posted: Sat Jun 23, 2018 9:07 am
by michaelm75au
Will add some validation to the function to keep the numbers in the expected range.