Weather System

Level 3
Joined
Jul 10, 2008
Messages
21
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
 
Level 5
Joined
May 31, 2009
Messages
122
  • 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.
 
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/
 
Top