# Weather System

#### marcin3

Level 3
Hey.
Can someone help me with make Weather System?
I want to weather change every 2 mins to diffrent one .
But totaly i dont know how to do this.
Hope you understand me .
Regards

#### VestriDeus

Level 5
• Events
• Time - Every 120.00 seconds of game time
• Conditions
• Actions
• Set - Weather = Random Integer (1 to 10)
• If Weather = 1
• Environment - Create at (Playable Map Area) the weather effect (Ashenvale Rain)
• Else If Weather = 2
• Environment - Create at (Playable Map Area) the weather effect (Outland fog)
For each integer, make it create a different weather effect.

sorry about how sloppy the trigger is; im in a rush.

#### marcin3

Level 3
Can someone explain it better? but thanks anyway xD

Last edited:

#### Pharaoh_

Level 40
Hm, ok let's see. Start by creating a Weather-type variable.
• Trigger
• Events
• Map Initialization
• Conditions
• Hashtable - Create a hashtable
• Set Hashtable = (Last created hashtable)
• Set Weather[1] = Snow
• Set Weather[2] = Rain
• Set Weather[3] = Wind (Heavy)
• Set ...
• Set RandomInteger = (Random integer from 1 to X) //X is the maximum array, for this specific example, it's "3", because I created 3 arrays for the "Weather" variable.
• Environment - Create at (Playable map area) the weather effect Weather[(RandomInteger)]
• Environment - Turn (Last created weather effect) On
• Hashtable - Save (RandomInteger) as (Key(number)) of (Key(Playable Map Area)) in Hashtable
• Trigger2
• Events
• Time - Every 120.00 seconds of game-time
• Conditions
• Actions
• Set RandomInteger = (Random integer from 1 to X)
• If (All conditions are true) then do (Actions) else do (Actions)
• If - Conditions
• (RandomInteger) Not Equal to (Load (Key(number)) of (Key(Playable Map Area)) from Hashtable)
• Then - Actions
• Hashtable - Clear all child hashtables of child (Key (Playable map area)) in (Hashtable)
• Environment - Create at (Playable map area) the weather effect Weather[(RandomInteger)]
• Environment - Turn (Last created weather effect) On
• Hashtable - Save (RandomInteger) as (Key(number)) of (Key(Playable Map Area)) in Hashtable
RandomInteger is an Integer variable.
Weather is a Weather-type variable.
Hashtable is a hashtable variable.

References:
[•] http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/array-tutorial-17789/
[•] http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/basic-triggering-5885/
[•] http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/variables-5896/

#### marcin3

Level 3
Aall fine but Weather variable can be only set to "Last created wather effect"

Replies
6
Views
392
Replies
2
Views
146
Replies
0
Views
446
Replies
7
Views
806
Replies
1
Views
487