Page 1 of 1

Weather

Posted: Fri Jan 13, 2023 3:09 pm
by kahta
Does anyone have a working example of how to set up and manage/change the weather in multiple zones on the map?

Re: Weather

Posted: Fri Jan 13, 2023 3:32 pm
by schweggy
This is what I've done with regards to "CEV's or custom environment zones." They're created in the reference point manager in the public beta "tiny."

I've created a zone... a circular zone about 100nm in diameter. This, to simulate a hurricane or typhoon. I've modified the CEZ "weather" to also simulate the temperature, sea/wind state and cloud decks. I then make the reference points relative to a surface vessel on a neutral side. This way the weather pattern moves. I would think you could do this for as many zones as you'd like. I'm not sure about overlapping zones, or rings. I think once you get too many reference points, especially moving around it can bog things down.

To actually change the CEV "weather" during game time I think you'd have to use Lua scripts that are triggered at whatever time you want. I'm not familiar with Lua scripting so I can't provide an example, but I'm pretty sure it's doable.

Here's a screen shot of it and an attached zip of the actual scen file.

Re: Weather

Posted: Fri Jan 13, 2023 9:31 pm
by Gunner98
I've used this lua script before. Does not take into account the new weather zone system but I set it on a regular time trigger with a low % chance of firing. I did not write this script, cannot remember who did through, and I know that there are much better scripts out there, I just haven't used them.


local temp= math.random(18,24)
local rain= math.random(0,3)
local cloud= math.random(0,3)/10.0
local sea= math.random(1,4)

ScenEdit_SetWeather(temp,rain, cloud, sea)

ScenEdit_SpecialMessage('Russia', '<P><FONT size=2 face="Courier New">COMMANDER,</P><P>NEW WX REPORT,</P> TEMPERATURE: ' .. temp .. ' DEGREES CELSIUS, RAIN STATE: ' .. rain .. ' CLOUD LEVEL: ' .. cloud .. ' AND SEA STATE: ' .. sea)
ScenEdit_SpecialMessage('US', '<P><FONT size=2 face="Courier New">COMMANDER,</P><P>NEW WX REPORT,</P> TEMPERATURE: ' .. temp .. ' DEGREES CELSIUS, RAIN STATE: ' .. rain .. ' CLOUD LEVEL: ' .. cloud .. ' AND SEA STATE: ' .. sea)

Re: Weather

Posted: Fri Jan 13, 2023 9:35 pm
by BDukes
Sloppy but works. Create zones. Lua code below to move them.

-CMO Weather Layering works. Just make sure first custom layers is the worst weather with nicer after.

local wrp1=ScenEdit_GetReferencePoint({side="Nature", name="RP-5"})
local wrp2=ScenEdit_GetReferencePoint({side="Nature", name="RP-6"})
local wrp3=ScenEdit_GetReferencePoint({side="Nature", name="RP-7"})
local wrp4=ScenEdit_GetReferencePoint({side="Nature", name="RP-8"})
local rpbearing= 45 --Change this bearing for weather direction
local rprange= 5 --weather movement in nautical miles. Evaluate vs. your trigger's rate.
local NewRpPos1=World_GetPointFromBearing({lat=wrp1.latitude,lon=wrp1.longitude,distance=rprange,bearing=rpbearing})
local NewRpPos2=World_GetPointFromBearing({lat=wrp2.latitude,lon=wrp2.longitude,distance=rprange,bearing=rpbearing})
local NewRpPos3=World_GetPointFromBearing({lat=wrp3.latitude,lon=wrp3.longitude,distance=rprange,bearing=rpbearing})
local NewRpPos4=World_GetPointFromBearing({lat=wrp4.latitude,lon=wrp4.longitude,distance=rprange,bearing=rpbearing})
ScenEdit_SetReferencePoint({side="Nature", name="RP-5", lat=NewRpPos1.latitude, lon=NewRpPos1.longitude, highlighted =true})
ScenEdit_SetReferencePoint({side="Nature", name="RP-6", lat=NewRpPos2.latitude, lon=NewRpPos2.longitude, highlighted =true})
ScenEdit_SetReferencePoint({side="Nature", name="RP-7", lat=NewRpPos3.latitude, lon=NewRpPos3.longitude, highlighted =true})
ScenEdit_SetReferencePoint({side="Nature", name="RP-8", lat=NewRpPos4.latitude, lon=NewRpPos4.longitude, highlighted =true})

Re: Weather

Posted: Sat Jan 14, 2023 12:05 am
by schweggy
Like I said.. Lua can probably do it better.

But, a vast majority of users/players do not "do" Lua. It is not intuitive. Thus... I have no abilities, nor interest in learning it.

Re: Weather

Posted: Sun Jan 15, 2023 8:34 pm
by temkc5
Sakura Blue 2018 By Rory Noonan (database build 476)
https://www.matrixgames.com/forums/view ... a+Blue#top
I think it's a really intricate scenario that also has a Lua folder with Weather creation, Typhoon creation, Search and Rescue also Random breakdowns to name a few