Requires GZDoom 4.11.1 or newer
Download
Wanna make your own weather effects for your own maps? Check out this thread for the standalone library.
Weather effects have long been difficult to achieve in Doom. Maps that have them often use it sparingly because of the performance cost. In the pursuit of moodier atmosphere, I decided to make a more universal solution so that you can make any map rainy or more cozy with snow.
Spoiler: ClipsIt's also more efficient than other solutions have been so far allowing for more rain and snow on the screen at once. Works great with Hexen and modern Doom maps.
Snowstorm
Rain hitting deep water
Thunderstorm
Blood Rain
Spoiler: Credits
- JonnyFive - Inspiration and rain/snow sprites
- Raven Software - Rain splash sprites
- Unknown - Rain, wind, and thunder sounds
Spoiler: Adding New Weather Types
This section is for those who want to modify this mod and add their own weather types and intensities. This section will make use of only the WTHRINFO lump which you can find located inside the pk3 file. To open the pk3, any standard ZIP file browser will work. You can use any text editor to modify WTHRINFO itself.
Adding New Weather Types
Each precipitation type follows a standard format: [intensity][name]. For instance, the Rain type has MinRain, MedRain, and MaxRain. The first 3 characters denote the intensity. "Min" for light, "Med" for normal, and "Max" for heavy. The name is the actual name of the weather type. The name must be the same across all intensities for it to recognize it as the same weather type. Currently only the above listed intensities are allowed. While these must be the first 3 characters of your precipitation type, the following name can be whatever length you'd like. Note that any new types you add will not be added to the options menu and must be manually toggled to.
Modifying Precipitation Types
If you look in the WTHRINFO lump, you'll notice a plethora of options available for each precipitation type. While I won't detail every option here (see the documentation in the standalone release for more information), you can take a look through and see a good chunk of them. You may notice certain toggles like "FogIndoors" or "FogOnlyIndoors". These are the new options for tweaking where the weather can occur. "Indoors" lets it happen both inside and outside, while "OnlyIndoors" inverses the default behavior and makes it so they can only occur inside. These can be set for fog, wind, thunder, lightning, and precipitation (e.g. LightningIndoors, WindOnlyIndoors, etc.). In order to enable fog you must set the Foggy toggle and to enable thunder and lightning you must set the Stormy toggle. All of the Time properties are listed in seconds e.g. a PrecipitationRateTime of 0.02 means spawn precipitation every 0.02 seconds. The Color values only accept hex color codes e.g. 0xFFFF0000 for pure red.
You might also notice the PrecipitationTag accepts LANGUAGE lump values. This is not required, but it is an option if you wish. The tag is what will get displayed when switching (if none is provided, the precipitation type name is used instead.
Do the intensities and properties have to be listed like the order above?
No, that was done purely for organizational reasons. You can place anything in whatever order you prefer. Where you put your first instance of the new weather type will affect the toggle order, however. I'd recommend putting any new weather types at the end of the lump.
Do I have to include all three intensities for each weather type?
No. If an intensity is missing, it'll grab the next previous intensity available (looping back around). For instance, if only the light intensity is available then it'll be cycled to even if the current intensity is set to heavy.
Is there a way to make my weather types standalone instead of modifying the base file?
Yes! If you want to release your add-on by itself, you can put your own weather types and intensities in a separate WTHRINFO file and place your ZScript/DECORATE precipitation Actors, textures, text, and sounds in their own respective file types and folders. Then archive them in a zip file (and optionally rename the extension to pk3) and load it like you would any other mod. Make sure add-ons are loaded after the base file to prevent any load order issues from occurring.
Spoiler: Creating Weather Patterns
The WTHRPTRN lump is a powerful lump that allows for custom weather scripting behaviors to be defined globally, within specific maps, or across an entire hub. Like WTHRINFO, this will accept custom extensions e.g. WTHRPTRN.rain. Patterns will persist between level changes which allows them to feel continuous in nature. The scripting interface is similar to that of the DECORATE States block. It has the following syntax:Code: Select all
[map name]/[cluster index] { Start: [precipitation name] [duration] [A_Jump([chance], [label], ...)]; [Goto label]/[Stop]/[Loop]/[Wait]; }
Example:
- Before defining the states, the keyword map or cluster must be used to denote whether it's map specific or hub specific respectively. For maps, the non-nice name should be used e.g. MAP01. For hubs, the index as defined in MAPINFO should be used. If no starting keyword is given at all i.e. it's left blank, this is assumed to be the default weather pattern that all maps will fall back on if nothing more precise is present. Maps take priority over hubs and hubs take priority over the global pattern.
- The Start label should always be present as this is similar to Spawn. Custom labels can be defined similar to DECORATE for improved state flow control.
- The precipitation name is the precipitation type name as defined in WTHRINFO. If #### is used, it will use the same precipitation type as the previous state. If TNT1 is used, this is read as no precipitation type and will clear it.
- The duration is measured in seconds. Random([min time], [max time]) can be used to randomize a duration period. If # is used, it'll use the same duration as the previous state (and will re-randomize if the previous state is random). A negative time value will cause the execution to stop at the current state. A duration of 0 will immediately go to the next state.
- A_Jump is an optional command that works the same as the DECORATE version. Numbered offsets are not supported, only labels. Note that encapsulating labels in double quotes is only needed if the label itself uses double quotes.
- Goto, Loop, Wait, and Stop work the same as they do in DECORATE. For Goto, numbered offsets are not supported.
Code: Select all
map MAP01 // On the first map { Start: TNT1 5; // Sunny for 5 seconds MinRain 20 A_Jump(51, Snow); // Light rain for 20 seconds with an initial 20% chance to snow instead RainLoop: MedRain Random(30, 50); // Regular rain for anywhere from 30 to 50 seconds MaxRain Random(15, 30); // Thunderstorm for anywhere from 15 to 30 seconds Loop; // Repeat rain process for the rest of the map Snow: MinSnow 20; SnowLoop: MedSnow Random(30, 50); MaxSnow Random(15, 30); Loop; }