Back to NxLabs

NxLabs / Vintage Story

Pelagus: Simple Wind Direction

RBy Rhoun

Simple mod that randomizes wind direction based on location and time.

Description

EDIT: This mod was still not enough for my liking, so feel free to check my wind direction randomizer.

 

Fork of https://mods.vintagestory.at/simplewinddirection

It just adds a config to change how often wind direction changes time and area-wise.

It works with Joy Of Sailing and any mod that relies on vanilla wind calculation.

Config, it's a bit of a guess because I'm not the author:

<pre class="language-javascript">{

"areaScale": 3.0, //affects size of areas with same wind. Bigger number mean bigger areas with same wind direction "timeScale": 2.0 //affect how fast wind speed (or how often wind changes, not sure) changes with passage of time, bigger number means slower changes "timeScaleConstant": 25.0, //Similar to timeScale, but bigger number here means faster changes

}</pre>

Here's the code for how mod calculates wind, so you can try to make your better guess:

<pre class="language-csharp">private void OnGetWindSpeed(Vec3d pos, ref Vec3d windSpeed) { double windMagnitude = windSpeed.X;

windSpeed.X = Math.Abs((xNoise.Noise(pos.X / areaScale, api.World.Calendar.TotalHours timeScaleConstant / timeScale, pos.Z / areaScale) wrapTimes) % 2d - 1) 2d - 1d; windSpeed.Z = Math.Abs((zNoise.Noise(pos.X / areaScale, api.World.Calendar.TotalHours timeScaleConstant / timeScale, pos.Z / areaScale) wrapTimes) % 2d - 1) 2d - 1d;

windSpeed.Normalize(); windSpeed *= windMagnitude; }</pre>

Ratings & reviews

No ratings yet

Sign in to leave a rating or comment.