NIFE: Weather Plugin
Posted: Posted August 12th by Xhin
This plugin adds Weather to NIFE. Weather is generated automatically depending on your settings and gets shown as a widget at the top of the screen. Weather also ties into the Conditions system so you can for example hide a room relationship if it's raining or make the "Lightning Sword" item usable only if there's a thunderstorm.
Let's take a look at the plugin:
Weather can be set on a global, room category and/or a room-specific basis. The first part of the panel lets you choose the specific weather type you want.
Should be straightforward. Add weather names with lines separating them.
There's kind of a lot of functionality here. I'll try to outline it:
Chance -- The chance of the weather event happening (0-100). I'll cover what makes weather generate in a minute.
Min / Max Duration -- A time set in hours:minutes to indicate how long the weather event can happen. In the above example, when Rain generates, it can last between 1 and 2 hours. Meanwhile snow can last between 1 hour 30 minutes and 3 hours.
Make Active -- Lets you create weather manually:
Here you set a start time and an end time for the weather event. The system is smart so if it's 11:00pm and you set weather to end at 5:20am, it'll know that you mean 5:20am the next day.
The start and end time don't have to follow the min/max durations, it can be whatever you want.
Once you've made weather active (or once it's automatically activated by NIFE), you can click this checkbox to deactivate it.
Subweather -- Weather events can have weather events of their own, recursively:
In the above example, I'm making it so that if it's already raining, there's a chance for there to be a thunderstorm and/or hail.
Here I'm setting up the conditions for subweather. Note that subweather can have its own subweather, and this goes as deep as you want it to.
You can click "Show subweather" to show individual subweathers or you can click the "Show all subweather" button to show a big list of the entire weather tree.
How weather is generated
Before I continue, I want to point out how weather actually works.
Weather isn't truly generated automatically; it only generates when someone is playing the NIFE game to save resources. When they do, if there hasn't been a "weather check" within the last minute, NIFE will do a weather check and then won't do another one for a full minute.
During a weather check, NIFE will deactivate all weather that has gone past its duration. It will then evaluate all potential weather via the Chance to see if it should generate. It will not generate subweather events immediately.. there will be at least 1 minute of rain before there's a thunderstorm for example.
Anyway, carrying on:
The weather widget appears at the top of the player interface. It indicates all weather that applies to the room (room-specific weather, weather for its category, global weather).
The format of everything you see here is changeable, which is where the widget settings panel comes in:
Weather Format -- The weather widget uses GTX0's post parser (without the extra space at the top and bottom). You can make this format whatever you want, using $W to represent all the weather entries.
Weather Delimiter -- this is what separates each weather entry. If you're doing more of a multi-line list-like format you might want to leave this blank.
Entry Format -- This is what each weather entry looks like. $W represents the actual entry, and you can format it according to the post parser. You could for example use ** [b]$W[/b] which would make each entry have a bullet and be bolded.
Below, you can adjust each individual weather entry's format, changing the background image, text color, and GTX0 format of each entry individually.
Changing the background image and color will make the name at the left change automatically, while you have to wait until after you click submit to see GTX0 parser changes come through.
After I've changed some things, here's what the widget looks like now.
I've added some new Conditions for Weather. They're in the Game object:
Game Has Weather -- Tells whether or not a global weather event is happening
Room Category has weather -- Tells whether or not a room category event is happening
Room has weather -- same thing for room-specific weather.
Each of these conditions will have a select box full of the names of that specific type of weather.
I've added new Events as well:
These should all be self-explanatory.. you pick the weather name you want in whatever the category is and when the event fires, it'll make the weather activate or deactivate.
You could for example make a "Rain Staff" item that makes it rain in the world. This would be useful if you had a Lightning Sword but Rain was relatively rare.
There are 1 Replies
Reply to: NIFE: Weather Plugin