Separately setting the weather and visibility

SDK supports Prepar3D’s philosophy of an open development architecture and encourages third parties to bring new innovations with improved add-ons and training content.
Locked
ppp333ddd_
Posts: 58
Joined: Fri Aug 18, 2017 1:04 am

Separately setting the weather and visibility

Post by ppp333ddd_ »

Hi,
I need to set weather and visibility separately. I have successfully used DataModel.sim.WeatherSetModeTheme("wwonder"); to set the weather by specifying the string , e.g. "wwonder".

Now I also need to set the visibility without changing the weather which is already set. Among the sim vars, there is only one variable called "AMBIENT VISIBILITY" but not settable. So I am now trying to use METAR to set the visibility. I found that I cannot set the visibility alone by METAR - it will change the weather to "CLR" (sky clear) as well. I also tried to set the visibility and weather in one METAR string but only the visibility setting worked. My METAR string is like this:"GLOB 010000Z 00000KT 2000M +SN CLR 15/05 Q1013", in which "+SN" means heavy snow but it doesn't work. The function DataModel.sim.WeatherSetModeTheme() will also reset the visibility which I don't want it to.

I want to set the weather and visibility individually which means the setting of one doesn't affect another. Alternatively, it will also be good if I know how to specify the expected weather in METAR. I appreciate any help.
User avatar
WarpD
Posts: 1469
Joined: Mon Feb 14, 2011 5:29 am

Re: Separately setting the weather and visibility

Post by WarpD »

1. Read the SDK. It gives detailed information on the use of a METAR string to set weather conditions.
2. A weather theme is not useable with custom weather. It's either one or the other.
3. There is absolutely no way to set visibility alone. Visibility and weather go hand in hand, even in the real world.
Ed Wilson
Senior Developer
Mindstar Aviation
Locked