ScenEdit_SetWeather and numbers (Full Version)

All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion



Message


Whicker -> ScenEdit_SetWeather and numbers (6/23/2018 12:44:43 AM)

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.




Rory Noonan -> RE: ScenEdit_SetWeather and numbers (6/23/2018 2:19:29 AM)

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)




Whicker -> RE: ScenEdit_SetWeather and numbers (6/23/2018 2:36:31 AM)

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.




Rory Noonan -> RE: ScenEdit_SetWeather and numbers (6/23/2018 7:17:28 AM)

Yeah. That is weird. I'll add a ticket for the code guys to look into it.

Thanks for the heads up!




michaelm75au -> RE: ScenEdit_SetWeather and numbers (6/23/2018 12:07:38 PM)

Will add some validation to the function to keep the numbers in the expected range.




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.0234375