Random Weather Event

Started by WinterVisage, April 09, 2011, 10:14:17 pm

Previous topic - Next topic

WinterVisage

April 09, 2011, 10:14:17 pm Last Edit: April 10, 2011, 08:47:20 pm by game_guy
Random Weather Generator
Version: 0.1
Type: Additional Features




Features


  • Random Weather Effects
  • Possible Thunder/Lightning Effects



Screenshots
None


Demo

I don't have a demo per say...


Instructions
This 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.



Credits
Me... I guess?


Author's Notes

The 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.




Click on my eggs and I can make all of your wildest dreams come true >.>

G_G

Apply the rest of the template and I'll move it.

WinterVisage

Sorry, seems like I missed a few pieces.




Click on my eggs and I can make all of your wildest dreams come true >.>

G_G

Alright you still messed it up a slight bit but I fixed it. *moves*

zane203

Im working on a random weather system as well. it's similar to this but calls a common event inside of a common event.

basically the second event sets up a range of variables to change the conditions of the weather to and a bit more randomness, like for instance, snow and lightning (since my game is very mystical lol)

another thing is that i use a system i call "Overlord v2" that gives every map a unique setting that ties into every other system. so every map has a chance for a set of random weather, not just every single one.

in the icy mountains, you'll never see rain is what i mean. =]

I do like this set-up though. I hope you dont mind if i learn a thing a two to incorporate into my system ^^
--ZenOokami--

WinterVisage

Truthfully, mine is a very simple version of a weather system for people who don't want to spend hours trying to figure out how to do it themselves. If you were really into eventing, you could customize this to decide what type of weather to use (such as on a snow capped mountain), all that'd require is a single variable. The caller can either be an event or a common event. I chose to set it up at the beginning as a common event for the reason that you don't want it to be accidentally called while inside a building. Another way is to set up your teleport events to have the main controls. Eventually I plan on expanding this, but first I've got to work on other common events that I'll be using like  foraging/herblore/smithing.




Click on my eggs and I can make all of your wildest dreams come true >.>