• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Weather effects

Status
Not open for further replies.
Level 6
Joined
Aug 12, 2009
Messages
142
I am looking to make a trigger that causes random weather event that are based on lets say 3 specific weather types in a selected Reagen, like say in reagen 1 I want it to randomly snow/light snow/blizzard at random times with a calm period in between
 
Level 15
Joined
Jul 9, 2008
Messages
1,552
you would use somthing like this


  • timer
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Countdown Timer - Start random_time as a One-shot timer that will expire in 5.00 seconds
  • random weather
    • Events
      • Time - random_time expires
    • Conditions
    • Actions
      • Set Weather_Random_Integer = (Random integer number between 1 and 3)
      • Countdown Timer - Start random_time as a One-shot timer that will expire in (Random real number between 30.00 and 120.00) seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Weather_Random_Integer Equal to 1
        • Then - Actions
          • Environment - Create at Region 000 <gen> the weather effect Northrend Snow (Light)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Weather_Random_Integer Equal to 2
        • Then - Actions
          • Environment - Create at Region 000 <gen> the weather effect Northrend Snow (Heavy)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Weather_Random_Integer Equal to 3
        • Then - Actions
          • Environment - Create at Region 000 <gen> the weather effect Northrend Blizzard
        • Else - Actions
 
This is a much cleaner way to do it:

  • Random weather
    • Events
      • Map Initialization
    • Conditions
    • Actions
      • Custom script: loop
      • Set Weather_Random_Integer = (Random integer number between 1 and 3)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Weather_Random_Integer Equal to 1
        • Then - Actions
          • Environment - Create at Region 000 <gen> the weather effect Northrend Snow (Light)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Weather_Random_Integer Equal to 2
            • Then - Actions
              • Environment - Create at Region 000 <gen> the weather effect Northrend Snow (Heavy)
            • Else - Actions
              • Environment - Create at Region 000 <gen> the weather effect Northrend Blizzard
      • Set Weather_Effect = (Last created weather effect)
      • Environment - Turn on Weather_Effect
      • Wait - (Random real number between 30.00 and 120.00) seconds
      • Environment - Remove Weather_Effect
      • Custom script: endloop
 
Level 6
Joined
Aug 12, 2009
Messages
142
This is a much cleaner way to do it:

  • Random weather
    • Events
      • Map Initialization
    • Conditions
    • Actions
      • Custom script: loop
      • Set Weather_Random_Integer = (Random integer number between 1 and 3)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Weather_Random_Integer Equal to 1
        • Then - Actions
          • Environment - Create at Region 000 <gen> the weather effect Northrend Snow (Light)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Weather_Random_Integer Equal to 2
            • Then - Actions
              • Environment - Create at Region 000 <gen> the weather effect Northrend Snow (Heavy)
            • Else - Actions
              • Environment - Create at Region 000 <gen> the weather effect Northrend Blizzard
      • Set Weather_Effect = (Last created weather effect)
      • Environment - Turn on Weather_Effect
      • Wait - (Random real number between 30.00 and 120.00) seconds
      • Environment - Remove Weather_Effect
      • Custom script: endloop

So will this make it keep doing it or is it a once off?
Edit: Am going to try it now, wish me luck.
 
Level 6
Joined
Aug 12, 2009
Messages
142
  • weather
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: loop
      • Set Weather_Effect[(Random integer number between 1 and 3)] = Weather_Effect[(Random integer number between 1 and 3)]
      • If (True Equal to True) then do (Environment - Create at gen reagion <gen> the weather effect Northrend Snow (Light)) else do (If (True Equal to True) then do (Environment - Create at gen reagion <gen> the weather effect Northrend Snow (Heavy)) else do (Environment - Create at gen reagion <gen> the weather effect Northrend Blizzard))
      • Set Weather_Effect[(1 + 3)] = (Last created weather effect)
      • Environment - Turn (Last created weather effect) On
      • Wait 30.00 seconds
      • Environment - Remove Weather_Effect[0]
      • Custom script: endloop
 
Status
Not open for further replies.
Top