This lua script implements dynamic weather in BeamNG! It's not the prettiest, but given what's possible on Game Engine side (rain, fog), I think it's still quite good. I will be working on this in the future by adding some more features and fixing possible bugs. Current Features: weather events: sunny, cloudy, light rain, rainy, stormy, foggy, foggy rain, tornado storm dynamic wind affecting vehicles and groundcover/forest objects (if supported by the object) windbursts randomly happening from time to time, frequency and strength affected by weather event tornadoes that slowly chase the player and interact with physics objects (vehicles, concrete retaining wall, matress, ...), only one can be active at a time slippery roads during rain/snow (if roads are made out of terrain, does not work for meshes like bridges) UI for optional weather, wind, tornado and road condition control dynamic rain, clouds, fog and brightness compatible with career mode and missions/scenarios > 2500 lines of code How to use? See repo page How does it work? Basically, the script cycles through different weather events randomly, starting with sunny weather. After a certain amount of time has passed, the next event is rolled. The script then does slight changes to sunsky, clouds, rain, fog and wind speed each ~10 seconds, until the event's criteria are met. After that, the event timer starts again. When it runs out, the next event is rolled. The tornado is just a particle emitter that slowly moves towards the player. When a vehicle gets close enough, wind forces are applied to that vehicle. These wind forces are the same as those from the wind UI app. Future Plans career mode safe system multiplayer support rewrite some code to make extensions for this mod possible, so that other mods can expand upon this, eg. by adding more weather events or a JS UI app Credits @Komodor for his code to make changing road conditions possible (during Beta versions) @vouthin for his rankine vortex tornado code @MegaKnight (me) for everything else Screenshots Changelog Spoiler: Version 1.0.1 added support for Agent's Simplified Realistic Traffic Mod Yakuza Pack reduced fog density during tornado storm event Spoiler: Version 1.0 reworked tornado model, by @vouthin added tornado weather event, toggleable, off by default in career mode improved tornado particles added more control options for tornadoes to UI, some combinations may cause instabilities tornado visualization in bigmap mode new UI design with orange highlighted text elements and improved tooltips traffic vehicles using their lights based on weather events wind now applying less force to simplified traffic vehicles and player unicycle to account for their reduced weight, compatible with Agent's Simplified Realistic Traffic Mod (forgot Yakuza Pack, will be added asap) reduced speed of windbursts during stormy and rainy event reworked dynamic groundmodel code to fix bug of cars spawning/resetting (partially) underground, now requires reload of collision, which may take a few seconds on larger maps fixed bug of tornado not working correctly when weather paused Spoiler: Beta 1.6 improved sunsky and lighting during overcast weather added random start event, instead of sunny everytime a random event will be chosen upon loading added more UI settings option to instantly switch to a weather event (UI) toggle for random tornado paths (UI) toggle for message display (UI, Ctrl + Alt + W still available) control for tornado movement speed (UI) fixed bug with sunScale breaking when switching many times between stormy and sunny weather added easter egg Spoiler: Beta 1.5 added more settings to the UI: pause button, button to roll next random event immediately, rain/snow toggle, wind speed control, advanced settings (duration of event switch, time between rolls) added option for snow instead of rain added icy road condition added dynamic temperature improved fog Spoiler: Beta 1.4 added UI that displays when main menu is active weather events, tornadoes and road condition can be controlled using the UI custom button sound for UI (plays when game unpaused) Spoiler: Beta 1.3 added more weather events: light rain, foggy rain and stormy added tornadoes, but they're not part of the weather cycle yet Spoiler: Beta 1.2 reduced speed of windbursts, they were a bit too fast, especially during rainy event reduced time between events added dynamic road conditions Spoiler: Beta 1.0 initial release Download from the Repository Do not reupload anywhere!
( google translator ) You can make the road more slippery during rain. This works in real time in Lua Game Engine. A piece of my code where I take into account tire type, rain, snow... The variables need to be calculated. I don't have the ability to check your mod right now, but maybe this is the element you're looking for. It works for me, but I only do it for my map. I don't know if it will work correctly for all maps. local gm = ground_model() gm.staticFrictionCoefficient= ((1.2*mw_o)/mw_p)/mw_ice gm.slidingFrictionCoefficient=((0.8*mw_o)/mw_p)/mw_ice2 gm.hydrodynamicFriction= 0 gm.stribeckVelocity =4.5 gm.strength= 1 gm.roughnessCoefficient= 0 gm.fluidDensity=0 gm.flowConsistencyIndex= 0 gm.flowBehaviorIndex= 0 gm.dragAnisotropy= 0 gm.shearStrength= 0 gm.defaultDepth= 0 gm.collisiontype= 10--asphalt: 10 gm.skidMarks= true be:setGroundModel("groundmodel_asphalt1",gm) be:setGroundModel("concrete",gm) be:setGroundModel("concrete2",gm) be:setGroundModel("BeachSand2",gm) be:setGroundModel("grid",gm)
um i downloaded it yay --- Post updated --- hey did you add tornados also? --- Post updated --- i want tornados in the thing
Thank you very much! This works perfectly I just uploaded a new version to the original post, which changes to slippery roads when a certain amount of rain is falling. This however only applies to roads made out of terrain, not to objects such as bridges or the roads of most ported maps. I also made a few more changes, see the changelog fore more information.
Press Alt + T to enable the mod. Then you can either wait until it randomly starts to rain, or you use a console command. You can gradually switch to rainy weather with the following command: dynamicWeatherMK_weather.setWeatherEvent("rainy") To open the console, press the ~ key on your keyboard (it seems to be Ö instead on german keyboards)
what the hell well, this mod is already really good! Question: does the temperature dynamicly change along with weather events with this mod?
Beta Version 3 is out! New features: tornadoes weather events: light rain, foggy rain and stormy Tornadoes can be spawned using Alt + T, but they are not part of the weather cycle yet. Random tornadoes can be toggled using a console command. Only one tornado can be active at a time. For more information, see OP. I will also upload this version to the repo.
YOOOOO Storm chasing in beamng… this is what I wanted for a long time in beam! Looks sick on pics, gonna try the mod when I will be on pc
this tornado absolutely likes to destroy covets... pure covet lol "Beast" D-Series cant even get lift off the ground though lmao Yes, the power of beast is even high than tornado's! Really good mod, the stormy weather makes it fun to drive on slippery roads))))
I really like this mod you should add a Ui where it will tell you what kind of weather is expected, and you can customize the weather easier
Thank you for the suggestion I implemented a UI and uploaded a new version to the repo. It should be approved tomorrow. gotta fix that typo!