Weather

Post new mods and scenarios here.

Moderator: MOD_Command

Post Reply
kahta
Posts: 543
Joined: Sat Sep 21, 2019 6:42 pm
Location: Arkansas

Weather

Post by kahta »

Does anyone have a working example of how to set up and manage/change the weather in multiple zones on the map?
User avatar
schweggy
Posts: 194
Joined: Tue Feb 03, 2015 8:24 pm

Re: Weather

Post 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.
Attachments
Screen Shot
Screen Shot
Weather Test.JPG (309.42 KiB) Viewed 531 times
Weather Test.zip
Weather Test Scenario
(38.92 KiB) Downloaded 12 times
- schweggy -

Montani Semper Liberi - Mountaineers are always free
User avatar
Gunner98
Posts: 5940
Joined: Fri Apr 29, 2005 12:49 am
Location: The Great White North!
Contact:

Re: Weather

Post 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)
Check out our novel, Northern Fury: H-Hour!: http://northernfury.us/
And our blog: http://northernfury.us/blog/post2/
Twitter: @NorthernFury94 or Facebook https://www.facebook.com/northernfury/
BDukes
Posts: 2629
Joined: Wed Dec 27, 2017 12:59 pm

Re: Weather

Post 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})
Don't call it a comeback...
User avatar
schweggy
Posts: 194
Joined: Tue Feb 03, 2015 8:24 pm

Re: Weather

Post 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.
- schweggy -

Montani Semper Liberi - Mountaineers are always free
temkc5
Posts: 113
Joined: Sun Oct 11, 2015 8:30 pm

Re: Weather

Post 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
Non mihi, Non tibi, Sed nobis

Post Reply

Return to “Mods and Scenarios”