• 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.

Triggering Weather

Status
Not open for further replies.
Level 4
Joined
Jul 8, 2009
Messages
84
Ok, let's skip the intros and cut to the chase, shall we?

For a map i'm making, i'm trying to create a trigger system (prefferably with GUI) that will allow the game to randomly change the weather effects on the map every six minutes.

Anyways, i happen to know that wha ti want to do involves variables, however, i am unsure how to execute the trigger, while making sure the the previous weather effect is not repeated.

I hope to have three weather effects:

Rain (Light)
Rain (Heavy)
Mist (Heavy)

In addition to Rays of Light during the day, and Rays of Moonlight during the night.

If you can help, i would be most greatful.

-MLH
 
Do this to set-up the variables

  • Event
    • Time - Elapsed game time is 0.00 seconds
  • Condition
  • Action
    • Set Weather[1] =
    • Set Weather[2] =
    • //And so on...
    • Set WeatherCount = (how many weather's you defined)
    • Set Weathers = null
then to change weather create a trigger like this

JASS:
function Weather takes nothing returns nothing
       local integer Random = GetRandomInt(1, udg_WeatherCount)
       loop //This will check if the weather to be used is the same as the current one
           exitwhen Weathers != Weather[Random]
           set Random = GetRandomInt(1, udg_WeatherCount)
       endloop
       //Here disable the existing weather effec
       //I'm not sure of the function so hopefully you have TESH
       call DisableWeather(Weathers) //Again I'm not sure of this function
       call EnableWeather(Weather[Random])
       set Weathers = Weather[Random]
endfunction

//===================

function InitTrig_Weather takes nothing returns nothing
   call TimerStart(CreateTimer(), 720, true, function Weather)
 
Level 4
Joined
Jul 8, 2009
Messages
84
K, Variables YAY!

... Is that JASS? :Shock:

Here's hoping i can use what you've given me.. thanks BTW.

Uh... would there be any way to change that other part... no JASS? i have absolutly NO idea how to use that... shows you how novice a triggerer i am :p
 
Last edited:
K, Variables YAY!

... Is that JASS? :Shock:

Here's hoping i can use what you've given me.. thanks BTW.

Uh... would there be any way to change that other part... no JASS? i have absolutly NO idea how to use that... shows you how novice a triggerer i am :p

you can just copy paste the JASS code... (If the weather functions are right) I'll check that later.. sorry.. I used JASS because we can only use integer loops in GUI (For Loop Integer A, blah blah)...
 
Level 4
Joined
Jul 8, 2009
Messages
84
Oh, that's no problem... i just have no experience using GUI, and even so, very little of that. I just want to have the easiest time posible polishing my uh... melee map, the one that's going to use this anyways...

+Rep for the help, BTW
 
Status
Not open for further replies.
Top