WEATHER TUTORIAL (DAY/NIGHT/RAIN/THUNDER/SNOW)
How to setup weather effects for your game
- drxeno02
- 12/22/2011 04:59 PM
- 16347 views
Greetings everyone! This is DRXeno, developer of JAOD Project, and I am presenting a Day/Night feature to you. This Day/Night feature is most suitable for overworlds where there exists a trigger switch that can be activated when the gamer is on the overworld, and then deactivated once they enter a scene i.e. town, forest, cave, ect. So lets get to it!
Start by creating one switch. The switch is (0001:DayNight).
-==Setup==-
** Go to Common Events and begin a new event with Parallel Process and trigger switch (0001:DayNight0
** Add the cycle event-command (Note: Keep in mind that the cycle event-command is completely unnecessary when you have an event with Parallel Process properties. Try this tutorial using the cycle event-command and then without using the cycle event-command to see the differences. There should be no discernible variations)
-==Configure Loop and Tint Screen Settings==- (Follow the following instructions inside the cycle loop)
** Add a wait 15.0 Sec command
** Add a tint screen command, you can use these settings (R080,G080,B080,S080), 1.0
** Add a wait 15.0 Sec command
** Add a tint screen command, you can use these settings (R060,G060,B060,S060), 1.0
** Add a wait 15.0 Sec command
** Add a tint screen command, you can use these settings (R040,G040,B040,S040), 1.0
Note: The time and the tint screen settings can be changed to your own discretion. The main idea to keep in mind is that over time your tint screen settings should gradually get darker.
The exclamation above should resemble the below coding:
Day/Night
Cycle
Wait 10.0s
SetScreenTone:(R080,G080,B080,S080), 1.0
Wait 10.0
SetScreenTone:(R060,G060,B060,S060), 1.0
Wait 10.0
SetScreenTone:(R040,G040,B040,S040), 1.0
End Cycle
-==DRXeno’s Challenge==-
Can you think of a way to script a Day/Night/Rain/Thunder event? What about a Day/Night/Snow event? Keep in mind that answers will vary.
Answer:
Day/Night/Rain/Thunder
Cycle
Wait 10.0s
Call Weather Effect: None
SetScreenTone:(R080,G080,B080,S080), 1.0
Wait 10.0s
SetScreenTone:(R060,G060,B060,S060), 1.0
Wait 10.0s
SetScreenTone:(R040,G040,B040,S040), 1.0
Wait 10.0s
SetScreenTone:(R080,G080,B080,S080), 1.0
Wait 10.0s
SetScreenTone:(R060,G060,B060,S060), 1.0
Play Sound: (Rain 1)
Call Weather Effect: Ra, Lo
Wait 10.0s
SetScreenTone:(R040,G040,B040,S040), 1.0
Flash Screen: (R31,G31,B00,V31), 0.5sec
Play Sound: (Thunder 9). Optional: Set thunder 9 to a slower tempo
Wait 5.0s
Play Sound: (Rain 2)
Call Weather Effect: Ra, Hi
End Cycle
Day/Night/Snow
Cycle
Wait 10.0s
Call Weather Effect: None
SetScreenTone:(R080,G080,B080,S080), 1.0
Wait 10.0s
SetScreenTone:(R060,G060,B060,S060), 1.0
Wait 10.0s
SetScreenTone:(R040,G040,B040,S040), 1.0
Wait 10.0s
SetScreenTone:(R080,G080,B080,S080), 1.0
Wait 10.0s
SetScreenTone:(R060,G060,B060,S060), 1.0
Call Weather Effect: Sn, Lo
Wait 10.0s
SetScreenTone:(R040,G040,B040,S040), 1.0
Call Weather Effect: Sn, Hi
End Cycle
Start by creating one switch. The switch is (0001:DayNight).
-==Setup==-
** Go to Common Events and begin a new event with Parallel Process and trigger switch (0001:DayNight0
** Add the cycle event-command (Note: Keep in mind that the cycle event-command is completely unnecessary when you have an event with Parallel Process properties. Try this tutorial using the cycle event-command and then without using the cycle event-command to see the differences. There should be no discernible variations)
-==Configure Loop and Tint Screen Settings==- (Follow the following instructions inside the cycle loop)
** Add a wait 15.0 Sec command
** Add a tint screen command, you can use these settings (R080,G080,B080,S080), 1.0
** Add a wait 15.0 Sec command
** Add a tint screen command, you can use these settings (R060,G060,B060,S060), 1.0
** Add a wait 15.0 Sec command
** Add a tint screen command, you can use these settings (R040,G040,B040,S040), 1.0
Note: The time and the tint screen settings can be changed to your own discretion. The main idea to keep in mind is that over time your tint screen settings should gradually get darker.
The exclamation above should resemble the below coding:
Day/Night
Cycle
Wait 10.0s
SetScreenTone:(R080,G080,B080,S080), 1.0
Wait 10.0
SetScreenTone:(R060,G060,B060,S060), 1.0
Wait 10.0
SetScreenTone:(R040,G040,B040,S040), 1.0
End Cycle
-==DRXeno’s Challenge==-
Can you think of a way to script a Day/Night/Rain/Thunder event? What about a Day/Night/Snow event? Keep in mind that answers will vary.
Answer:
Day/Night/Rain/Thunder
Cycle
Wait 10.0s
Call Weather Effect: None
SetScreenTone:(R080,G080,B080,S080), 1.0
Wait 10.0s
SetScreenTone:(R060,G060,B060,S060), 1.0
Wait 10.0s
SetScreenTone:(R040,G040,B040,S040), 1.0
Wait 10.0s
SetScreenTone:(R080,G080,B080,S080), 1.0
Wait 10.0s
SetScreenTone:(R060,G060,B060,S060), 1.0
Play Sound: (Rain 1)
Call Weather Effect: Ra, Lo
Wait 10.0s
SetScreenTone:(R040,G040,B040,S040), 1.0
Flash Screen: (R31,G31,B00,V31), 0.5sec
Play Sound: (Thunder 9). Optional: Set thunder 9 to a slower tempo
Wait 5.0s
Play Sound: (Rain 2)
Call Weather Effect: Ra, Hi
End Cycle
Day/Night/Snow
Cycle
Wait 10.0s
Call Weather Effect: None
SetScreenTone:(R080,G080,B080,S080), 1.0
Wait 10.0s
SetScreenTone:(R060,G060,B060,S060), 1.0
Wait 10.0s
SetScreenTone:(R040,G040,B040,S040), 1.0
Wait 10.0s
SetScreenTone:(R080,G080,B080,S080), 1.0
Wait 10.0s
SetScreenTone:(R060,G060,B060,S060), 1.0
Call Weather Effect: Sn, Lo
Wait 10.0s
SetScreenTone:(R040,G040,B040,S040), 1.0
Call Weather Effect: Sn, Hi
End Cycle
For any questions or concerns contact me, I’m around here somewhere!
Name: Leonard Tatum A.K.A DRXeno
Email: LJTatum@hotmail.com
AIM: jaquio123
Official Webpage: http://leonardtatum.blogspot.com/
Gamepage: http://rpgmaker.net/games/3708/
Name: Leonard Tatum A.K.A DRXeno
Email: LJTatum@hotmail.com
AIM: jaquio123
Official Webpage: http://leonardtatum.blogspot.com/
Gamepage: http://rpgmaker.net/games/3708/
Posts
Pages:
1
The exclamation above should resemble the below coding:
Maybe it's not a typo? I wouldn't call that an exclamation, but w/e.
I don't really see how this tutorial is complete. It's got a single cycle of screen tints but you don't specify how to make it remain in one state for a given amount of time then gradually change(other than an absurdly long wait event). Is this day/night switch supposed to stay on forever? I wouldn't put any weather effect in the same cycle, because it would be raining every day at the same exact time.
I would suggest giving more instruction on how to alter this instead of just a code dump. It doesn't explain how to achieve any kind of realistic effect; only a static (therefore boring) cycle of tint and 8:00 rain.
I wouldn't use the cycle function, either. (I hear it's glitchy?) Labels might be a better choice, but that's just a preference. They both get the job done. Wait, what am I saying? You don't need to force a cycle inside a parallel process, that's the point of a parallel process. It cycles itself.
If I were to create a day/night system, I would have separate switches for day and night and separate processes. It should remain in one state for a while before switching and it's not a good idea to have parallel processes running for no reason. One process for keeping track of time that is constant throughout the entire game, so that when it's dusk it turns on the night switch to activate the night parallel process(which shuts itself off when it's done tinting). Then the event keeping track of time will turn on the day switch at dawn to tint it back to normal.
Same with rain, have a switch for rain and using that time tracking event, create randomized times to have the switch turn on to start the rain. That way it can rain any time of day without interrupting the main day/night cycle. Or even during a quest or cutscene; instant rain effects with the flick of a switch.
It's nice that your writing tutorials, but I don't agree with this one in it's current state.
@Link_2112 This tutorial is for beginner scripters. "Realistic weather" as you mentioned is discretionary. I purposely used a generic 10.0 sec wait interval for most of the coding because everyone will have to insert a different wait command interval that suits their own personal desire. Reading your response, it sounds like what you speak of is more of a real time weather effect, whereas this tutorial is more meant for overworlds. For overworlds, 10 seconds can represent an entire day/night cycle and would repeat until the trigger switch is turned OFF.
And as far as using labels, you can also use conditional branches and a few other options for creating loops but my choice was to use the cycle event-command. I would argue that the cycle event-command is no more buggy than any other command in RM2K3, so it's ok to use.
Although you know (and I know) that even without the cycle command this coding will loop so long that the event is set to parallel process (as explained in this tutorial), that isn't the point of this tutorial. This tutorial is to help beginners bring a little spice to their games, more specifically their overworlds. And to challenge the beginner coders to not just copy/paste what they read in a tutorial but to take the overall meaning and create their own scripts.
I appreciate your critism and will make an edit to mention that the cycle event-command is unnecessary, although the programming works perfectly fine with it.
And as far as using labels, you can also use conditional branches and a few other options for creating loops but my choice was to use the cycle event-command. I would argue that the cycle event-command is no more buggy than any other command in RM2K3, so it's ok to use.
Although you know (and I know) that even without the cycle command this coding will loop so long that the event is set to parallel process (as explained in this tutorial), that isn't the point of this tutorial. This tutorial is to help beginners bring a little spice to their games, more specifically their overworlds. And to challenge the beginner coders to not just copy/paste what they read in a tutorial but to take the overall meaning and create their own scripts.
I appreciate your critism and will make an edit to mention that the cycle event-command is unnecessary, although the programming works perfectly fine with it.
Fair enough. I still think this would benefit with a bit more explanation, but it serves it's purpose.
Sure it works fine without the loop, but it's not a good practice to add useless redundant coding. Especially if beginner's are picking up the habits :)
Sure it works fine without the loop, but it's not a good practice to add useless redundant coding. Especially if beginner's are picking up the habits :)
Pages:
1