Creating a Weather System

Manofdusk

Veteran
Veteran
Joined
Apr 26, 2014
Messages
211
Reaction score
39
First Language
English
Primarily Uses
 I've finally fixed the bugs in my game that have been giving me fits, so it's time to take on a new one (and maybe learn a little more about some of the functions I haven't used yet).

 Much of the magic in my game relies heavily on environmental effects (vegetation, stone, sand, heat level, amount of snow, above/below ground, humidity, ect.) These are all handled by variables that determine the strength of the spell and whether or not it's available.

 THAT part is more or less done :p

----------------------------------------------

 What I need now are weather events (possibly several common events, based on the climate in the area). This will be primarily for the Bolt spells (which will deal more damage during a storm).

 What I THINK I'd like to do is use a timer. Every 10 minutes, it will set a variable to a number between 1 and 100. If that number is between c & d, it will be sunny. If it's between e & f, it will be rainy (with variations on intensity based on how high the number is).

 Problem is, I have no idea how to use the timer properly, nor have I figured out how to get it to loop.

 Some ideas would be appreciated.
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
First Language
English
Primarily Uses
RMVXA
I never use the built-in Timer for timed events, and maybe someone could give you a good reason why you'd want to use it unless you need to show a countdown onscreen, but I've yet to find any.

What I think you'll want to do is to create a Parallel Process event (Common Events are probably the better way to go than Map-based Events; you can use variables to track what climate the player is in if you want to).  Its condition switch should be whatever switch is used to make time go by in your game (if time is ALWAYS moving, just use an "Always ON" switch that you set to ON at the beginning of the game and never touch again).

The simplest event code to do this would simply Wait for 36000 frames (the number of frames in 10 minutes), then choose the random variable and set the weather accordingly.  Because it's a parallel process, it will keep looping automatically, resetting the weather every 10 minutes.

I've created a weather system in my game before, so if you need any further help with having it interpret the random variable (or a "climate tracker" variable) and setting the weather accordingly, let me know.
 

Perversewolf

Villager
Member
Joined
Jul 18, 2014
Messages
40
Reaction score
8
First Language
English
Primarily Uses
Check the Conditional branch i am positive i saw a timer related option on it yesterday night as i was setting up my game's tutorial.
 

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,643
Reaction score
420
First Language
Portuguese
Primarily Uses
RMMV
you could also add 1 to a variable every frame and activate the event when the variable reaches 36000, this way you don't lose the timing when changing maps yet keeps the chronometer free.
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
First Language
English
Primarily Uses
RMVXA
you could also add 1 to a variable every frame and activate the event when the variable reaches 36000, this way you don't lose the timing when changing maps yet keeps the chronometer free.
Does this really happen when you change maps even if the whole thing is being processed in a (Parallel Process) Common Event?
 

Manofdusk

Veteran
Veteran
Joined
Apr 26, 2014
Messages
211
Reaction score
39
First Language
English
Primarily Uses
 I used a variable with a parallel process event.

 is there a difference between heavy rain and storms? I can't really see one.

is there a way to make lightning flash occasionally when it storms?

also, is there any way to make it so that there is a rain effect on battle maps?

 if not, I'm thinking of using Yanfly's State Animations in conjunction with Field Effects and an alternate version of Ice All 1 to get a similar effect. Would that work?
 

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,643
Reaction score
420
First Language
Portuguese
Primarily Uses
RMMV
Does this really happen when you change maps even if the whole thing is being processed in a (Parallel Process) Common Event?
Yes. I tested. The event begins from the start when you change maps, so the wait would also begin from he start.
 

Manofdusk

Veteran
Veteran
Joined
Apr 26, 2014
Messages
211
Reaction score
39
First Language
English
Primarily Uses
**Going to repost this one so my reply doesn't get lost**

 I used a variable with a parallel process event.

 is there a difference between heavy rain and storms? I can't really see one.

is there a way to make lightning flash occasionally when it storms?

also, is there any way to make it so that there is a rain effect on battle maps?

 if not, I'm thinking of using Yanfly's State Animations in conjunction with Field Effects and an alternate version of Ice All 1 to get a similar effect. Would that work?
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
First Language
English
Primarily Uses
RMVXA
**Going to repost this one so my reply doesn't get lost**

 I used a variable with a parallel process event.

 is there a difference between heavy rain and storms? I can't really see one.

is there a way to make lightning flash occasionally when it storms?

also, is there any way to make it so that there is a rain effect on battle maps?

 if not, I'm thinking of using Yanfly's State Animations in conjunction with Field Effects and an alternate version of Ice All 1 to get a similar effect. Would that work?
The difference between rain and storms is the direction of the rain (more angled during "Storm").  The screen tone is also a little different.

You can event thunder and lightning to happen.  Create a parallel process event (preferably a common event but map-based events work if you only want it on certain maps) with the condition switch "Storms Active" (which will need to be set ON and OFF when you do weather changes).  Set your event up something like this:

* Loop

* Wait 20 frames

* Add Random Number between 1 and 10 to Variable #15

* If Variable #15 is >= 250

* Break Loop

* End Branch

* End Loop

* Play Sound Effect: Thunder

* Flash Screen (short and intense)

* Wait 5 frames

* Flash Screen again (short and intense)

* Set Variable #15 to 0

* Wait 60 frames

No idea about whether it's easy to show Weather Effects during battle in VX Ace.  I believe that weather DOES show in XP, even by default, during battle.  So maybe you can look at the default scripts and see what's different between the two.

Yes. I tested. The event begins from the start when you change maps, so the wait would also begin from he start.
Thanks!  I had no idea.  This is good to know.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,847
Messages
1,016,968
Members
137,561
Latest member
JaCrispy85
Top