Random Weather Generator
Version: 0.1
Type: Additional Features
Features
- Random Weather Effects
- Possible Thunder/Lightning Effects
ScreenshotsNone
DemoI don't have a demo per say...
InstructionsThis is a simple but effective Random Weather Generator. First you need an event (or common event that is called by an event) with the following:
@>Control Variables: [Your_Variable_Number_Here: Weather_Generator] = Random No. (0...1000)
*Note: While you probably won't make it to 1000, this makes it more simple to control the numbers and add more randomness.
@>Call Common Event: Weather System
@>Wait:900 frame(s) *Repeat this command 10 times, or how ever many minutes you want it to elapse before repeating the number generation (You could use another variable to make the elapse time be randomized as well)
That initiates the weather chain of events. It's the foundation of the entire system and MUST be parallel processed. If it is not, you'll either get 1 of 2 things: A) Nothing happening or B) The game being unresponsive. Why? Because either you left it as an action triggered event, OR you accidentally set it as an Autorun event. This event is important because it paces the entire process of choosing the weather and that 900 frame wait will literally wait without it being a parallel process.
Now, we can configure out fancy-pants weather effects!
Weather System:
@>Conditional Branch: Variable[Your_Variable_Number_Here: Weather_Generator] >= 0
*This sets the Variables first range extent, the lowest value, of equal to or granter than 0
@>Conditional Branch: Variable[Your_Variable_Number_Here: Weather_Generator] < 50
*This sets the Variables second range extent, the greatest value, of less than 50
@>Set Weather Effects: Rain, 9, @30
@>Change Screen Color Tone: (-102, -85, -51, 136), @30
*This makes the screen tone turn to a nice bluish-gray for our rain.
@>Control Switches: [Your_Switch_Number_Here: Lightning] = ON
*This will cause the parallel Common Event, Lightning System, to Activate.
Else
@>
Branch End
Else
@>
Branch End
*Repeat this branch as many times as you'd like, modifying the required variable range as need be. Be sure to have your Clear Day Weather Effect to be the largest range of numbers!
This is what causes the magic to happen. As you can see, I've dumbed it down an extreme amount by leaving out a majority of the "Weather Effects" to let them be filled in by you, the user.
Next we go onto the not entirely needed, but still cool, third (Or second if you didn't set up your weather counter as a Common Event) Common Event. This is the Lightning Controller. It Semi-Randomly causes the screen to flash (sometimes insanely, sometimes not). It should only be called when a thunder storm is provoked (Variable Range 0-49). Note: This system is much larger and more picky than the previous common event. The more range you have on your random variable for this one, the better! That means the amount of time in between your start of the lighting to the start of the next flash of lightning is more random. If you wanted, you could even change the duration of the lightning flash to be randomized, but for simplicity's sake, we're taking the short route out of that one.
Lightning Controller
Label: Beginning *This is a CRUCIAL part of the common event. If it is omitted, your entire Lightning system will die.
Conditional Branch: Variable[Your_Variable_Number_Here: Weather_Generator] >= 0
Conditional Branch: Variable[Your_Variable_Number_Here: Weather_Generator] < 50
*You're probably wondering why we have this test again. Well, it's because of the fact that this should only run while it's thunder storm. If either of these statements aren't true, this conditional branch will cause the common event to jump down to the "Stop" label.
Screen Flash: (255,255,255,255), @4
Wait: 4 frame(s)
*I tried it without this and the lightning affect wasn't nearly as cool.
Change Screen Color Tone: (255,238,221,0), @0
@>Change Screen Color Tone: (-102, -85, -51, 136), @30
Else
Jump to Label: Stop
Branch End
Else
Jump to Label: Stop
Branch End
Control Variables: [Insert_New_Variable_Here: Lightning Wait Time] = Random No. (1...6)
*Works just like a Dice Roll in a board game.
Conditional Branch: Variable [Insert_New_Variable_Here: Lightning Wait Time] == 1
Wait: <Your Own Personal Preference on the First Rolls Wait Time> frame(s)
Else
Conditional Branch: Variable [Insert_New_Variable_Here: Lightning Wait Time] == 2
Wait: <Your Own Personal Preference on the First Rolls Wait Time> frame(s)
Else
Conditional Branch: Variable [Insert_New_Variable_Here: Lightning Wait Time] == 3
Wait: <Your Own Personal Preference on the First Rolls Wait Time> frame(s)
Else
Conditional Branch: Variable [Insert_New_Variable_Here: Lightning Wait Time] == 4
Wait: <Your Own Personal Preference on the First Rolls Wait Time> frame(s)
Else
Conditional Branch: Variable [Insert_New_Variable_Here: Lightning Wait Time] == 5
Wait: <Your Own Personal Preference on the First Rolls Wait Time> frame(s)
Else
Conditional Branch: Variable [Insert_New_Variable_Here: Lightning Wait Time] == 6
Wait: <Your Own Personal Preference on the First Rolls Wait Time> frame(s)
Else
Branch End
Branch End
Branch End
Branch End
Branch End
Branch End
*It takes up a lot of space, but it works. This tells the game how long to wait between flashes of Lightning.
Conditional Branch: Variable[Your_Variable_Number_Here: Weather_Generator] >= 0
Conditional Branch: Variable[Your_Variable_Number_Here: Weather_Generator] < 50
*Yes, we take this check once more before the 'End'
Jump to Label: Beginning
Else
Control Switches: [Insert_Lightning_Switch_Here: Lightning] = OFF
Branch End
Else
Label: Stop
Control Switches: [Insert_Lightning_Switch_Here: Lightning] = OFF
Branch End
As you can see, a simple random weather system can easily be done in Common event.
CreditsMe... I guess?
Author's NotesThe randomness will depend on how much time you put and how random your variables are (example: You have a thunderstorm set up to run from values 0-50 AND 700-860, giving them more randomocity. You could use more variables to generate a more random system etc). The effects, such as dimming etc, should be changed to fit your games personal tone, otherwise it might look cheesy.