WeatherRecord.stormDirection should be mutable like other weather parameters
Consider the following Lua player script snippet
local core = require('openmw.core')
local ashstorm = core.weather.records["Ashstorm"]
print(tostring(ashstorm.stormDirection))The stormDirection https://openmw.readthedocs.io/en/latest/reference/lua-scripting/openmw_core.html##(WeatherRecord).stormDirection output is always (0, 1, 0) despite the ingame ashstorms being programmed to always blow from the Red Mountain (more on that later).
You can modify most weather record parameters and see them being applied to the weather in real-time. But not stormDirection -- if you try changing the value for example like this:
local core = require('openmw.core')
local ashstorm = core.weather.records["Ashstorm"]
ashstorm.stormDirection = util.vector3(1, 0, 0)you then only see the result in the record - when you print it. But the ingame storm direction doesn't change.
I think it's because the weather code never really uses the MWWorld::Weather's mStormDirection, because that value is always overwritten by the calculateStormDirection function https://gitlab.com/OpenMW/openmw/-/blob/master/apps/openmw/mwworld/weather.cpp?ref_type=heads#L46. That function always returns a new value and it starts with the default (1, 0, 0). Only if the particleEffect model is blight or ashstorm, then it changes this 0,1,0 to something else.
This means that if you try making a custom weather in Lua and replace the particleEffect (for instance with TamrielData's meshes/td/td_tropical_cloud.nif)
local ashstorm = core.weather.records["Ashstorm"]
ashstorm.particleEffect = "meshes/td/td_tropical_cloud.nif"
ashstorm.stormDirection = util.vector3(1, 0, 0) --omw overrides it anywaythen the direction stays at (0, 1, 0).
I suppose the eventual endgoal would be to dehardcode that direction-calculating function completely, or make the Lua API display the actual value calculated by that function, but since my interest are in maintaining the WeatherRecords mutable, then this item's request is to just make it so that calculateStormDirection overwrites mStormDirection only if it has calculated anything worth overwriting. I think the weather record already starts with a default value, so that function could only replace it if it has to apply this Red Mountain stuff. Not ideal, but could at least allow for Lua editing the direction for custom replacements.