Repository navigation
Wind Patterns
Vanilla sets each map region's wind by a wind pattern: a named strength, rolled by chance and held until it runs out. Rough Seas sets that pattern from the wind of its own model instead, so the wind vanilla reports is ours. This page is for a mod that reads or sets a region's pattern.
We add 13 patterns, roughseas-force0 to roughseas-force12, one per Beaufort force. Each region carries the one for the strongest wind in it, at that wind's exact strength, so a mod that reads the pattern's name learns the force, and one that reads its strength learns the wind.
We hold a region with a lease: we set its pattern to run for one game hour, and every two seconds, while the region still carries the pattern we set, we set it again to the wind of the moment and the hour starts over. So our pattern never runs out on its own, and vanilla's own rolls never reach a region we hold.
Within a region, the wind still differs from place to place: GetWindSpeedAt adds our local wind on top of the region's pattern, and gives it our direction (Reading the weather).
Set any other pattern with SetWindPattern or /weather setw, and we leave the region to it until its ActiveUntilTotalHours; then we take it back. Another of our own patterns counts as yours, too; only the one already blowing is renewed. Your pattern sets the wind vanilla reports in the region; our model's wind, its storms and waves, and what ISeaWeather answers go on as before (What moves our sea).
One limit: a lease lasts while vanilla keeps the region in memory, until the region unloads or the server restarts. When a region loads again, we can't tell your pattern from vanilla's random pick, and our first pass over it, within two seconds of its load, takes it whatever it carries. A pattern you mean to keep, set again after that first pass, not in the region's load event.
To freeze the regions, turn off autoChangePatterns (/weather acp). As it stops vanilla's own rolls, it stops our leases and our storms' thunder (Weather events): each region keeps the pattern it has. Our local wind and its direction still come through GetWindSpeedAt on top of it.
Getting started
The sea
Your vessel
Leaving it
Rivers and lakes
At sea