StormFox - Environment mod

StormFox is a free environment mod that will freshen your GMod experience with weather, light, effects and textures!

It is made to support as many people as possible. This means SF runs mostly on the client, will adjust its quality to each individual machine and even try to adjust itself to most maps for the best outcome.



Known Isues:

  • Dynamic lights aren’t casting shadows!
    The Gmod engine only support 8 lights with shadows at all times. Careful not to place too many lightentities near each other.

  • I’m lagging!
    Be sure the weather quality is at 0, if the problem still persists, try set it manually at 1. Dynamic shadows can also be expensive on big maps.

  • There are snow at the wrong places!
    Some maps use outdoor textures indoors, you can fix this by setting sf_replacment_dirtgrassonly to 1.

  • Some of the effects are missing.
    Check if the map got all entities supported. You can find missing entities displayed on the weather controller.

This is a beta, there might be unknown bugs or missing features.

Post any errors or bugs and I’ll see what I can do.


Last update:

Looks awesome - having trouble connecting to my server but once it’s fixed I will be trying this out!

this is literally sex

and the best kind of sex too

Yes, finally it’s here! Thank you for this Nak. Awesome work! ^^

holy fuck this is cool

So I’m getting these green cubes in game.[/t]

[editline]11th September 2017[/editline]

And red cubes too. [t]

[editline]11th September 2017[/editline]

Also maybe round the temperatures to 1 or 2 decimal places?

[editline]11th September 2017[/editline]

Also maybe make the 3d2d for the weekly display ignoreZ or move it forward a tiny bit so theres no z fighting.

Ups, the green/red cubes is a debug script that gets activated when developer convar is 1.
Pushed a new update out:

  • Fixed errors when maplights got deleted.
  • Removed leftover debugoverlays.
  • Fixed the weather-generator ignoring weather changes and rounded the variables.
  • Moved the screen a bit forward for weekly_weather entity.

Checked it out yesterday. Really neat. I really like what you did with the sounds as well. It took me a while to realize I had to press the title ‘Set Weather’ on the weather controller entity to change it. The rain looks good. Two things I found a little bit off-putting though was the glowing snow particles (perhaps use the existing things you know about the weather - like day/night cycle, time/fog etc to adjust their color accordingly) and the slightly weird fog artifacts (I could quite clearly tell where it ended or that it was used to cover up where it wasn’t raining etc).

Looking forward to see how this evolves!

10x Better than Atmos

[editline]11th September 2017[/editline]

btw can I have permission to see how you did the changing ground texture of the map?

What’s Ups? There’s blue ones too I guess they are part of it too.

No need for permission to look at my stuff, however its easier if I just show you an example:

local oldTextures = {}
function ReplaceMaterial(iMat,texture)
	if not oldTextures[iMat] then
		-- Save the old texture
		oldTextures[iMat] = iMat:GetTexture("$basetexture")
function UndoMaterial(iMat)
	if not oldTextures[iMat] then return end

Ups as in it was a mistake.
They changed colors depending on what they hit. Should be removed now.

Could you put the code on a repo somewhere so we can submit PRs?

Going to git it at some point. Maybe later today.

Would it be possible to add out of the box support for different gamemodes, such as TTT. Take for example on round start a random time and weather is activated (Going to do this myself but for others they might like it)
Edit: Also, what is the client cvar for “Ultra High Quality”

Should be doable. I’ve been thinking about making an addon for extreme weather and a gamemode that uses SF.
I’ll repost the functions here;
This is what I’ve written so far. There are more functions but its mostly internal stuff.

	-- Time
		StormFox.GetTime(pure) -- Returns 0-1440. Pure will make it ignore the 6 decimals synchronization attempt.
		StormFox.GetDaylightAmount() -- Easy function that returns 1 doing the day and 0 doing the night. Between 0-1 at sunset/sunrise
		StormFox.GetRealTime(Use_12clock) -- Returns the time in a 24clock or 12clock format
	-- Data
		StormFox.SetData(str,var[, timestamp]) -- Sets and syncs the data with clients(if server). Setting a timestamp (0-1339) will make the variable leap smoothly towards the given time (Without sending more data)
		StormFox.GetData(str,default) -- Returns the data
	-- Basic
		StormFox.GetBeaufort(ms) -- Retuns the windspeed in a beaufort scale and description.
		StormFox.CelsiusToFahrenheit(cel) -- Returns degrees in freedom unit.
		StormFox.GetWeatherName() -- Tries to descripe the current weather.

	-- Skybox (This is for cloud stuff later)

	-- Time
		StormFox.SetTime(24clock-str or 0-1440) -- StormFox might get confused for a few seconds tho.
	-- Data
		StormFox.SetGhostData(str,var[,timestamp]) -- Sets the data without sharing
	-- Weather
		StormFox.GetWeathers() -- Returns a list of valid 'weathers'.
		StormFox.AddWeather(name,weatherdata) -- Weatherdata is a table of data that descripe it.
		StormFox.SetWeather(name,procent) -- Procent goes from 0-1. Allows you to set the 'amount'.
	-- Weather-logic
		StormFox.AddWeatherCondition(name,{min-clock,max-clock},[min-procent,max-procent},{min-length,max-length},func canPick) -- Allows the weather-generator to pick the weather.
		StormFox.GenerateNewDay(dont_update_clients) -- Creates a new day. Useful for skipping a day if rain.

		StormFox.GetExspensive() -- Returns the weather-quality (0-7 or 0-20 for ultra).
		StormFox.Env.IsOutside() -- Returns true if standing under open sky.
		StormFox.Env.IsInRain() -- Returns true if standing in the rain/wind direction.
		StormFox.Env.NearOutside() -- Returns true if standing near the outside.
		StormFox.Env.FadeDistanceToWindow() -- Returns a number between 0-1. Where 1 is when you stand next to a window.
		StormFox.Env.FadeDistanceToRoof() -- Returns a number between 0-1. Where 1 is when you stand against the roof.

		StormFox.GetWeatherSymbol() -- Returns the material for the current weather

P.S. Don’t use StormFox.SetTime regularly, SF can get confused and turn the sky into a disco-floor if you do it at a bad point.

The cbox for “Ultra High Quality” is not a cvar, but rather stored as a cookie. Its only there to allow users (And the automatic system) to get sf_exspensive (The quality convar) up to 20.
The cookie is stored as: cookie.GetNumber(“StormFox_ultraqt”,0)

Ah so using that to set the time randomly on round start probably wouldn’t be the best of ideas. Can it just happen at random or does it only bug out if you do it while SF is already transitioning to another time (So say the time is 9am, I then set it to 3PM but before it lerps to 3PM I change it again to 11PM, I assume that would disco-ize the sky?)

Ahhhh, well in that case I’m just going to set my slider max to 7, most players aren’t going to have a machine good enough for much higher than that; Im already getting reports of some bad performance but Im looking into that. I’ve also made it so that you can change all the options in its own tab in the F1 menu so the players don’t have to use console commands.

Yep, it uses the time to lerp between the values, so setting it at the wrong time will mess it up.

If you set the slider at 0, it will auto adjust to your FPS.

Yeah I know, still getting reports of bad FPS even when they’re on that setting, I’ve advised them to put it to 1 and see if that helps

Does the wind react with finned props or other props?

You means things like grenades ? or small items ?
I want to know as well !