• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Weather System

Status
Not open for further replies.
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/
 
Level 39
Joined
Feb 27, 2007
Messages
4,994
Note: weather-type variables don't exist and never have (lol @ 2010 solution). You'll have to use weather variables directly.

Yes. I don't see any reason to store any information in a hashtable like these fellas were doing here. You could just use an integer variable or a weather variable to store the 'current' weather.
 
Last edited:
Status
Not open for further replies.
Top