HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Random Weather Cycle Trigger not Working

11-10-2003, 10:58 PM#1
Dragon
Weather Cycle
Events
Time - Every 30.00 seconds of game time
Conditions
Actions
Set WeatherCycle = (Random integer number between 1 and 4)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
WeatherCycle Equal to 1
Then - Actions
Environment - Turn (Last created weather effect) Off
Environment - Remove (Last created weather effect)
Wait 3.00 seconds
Environment - Create at (Entire map) the weather effect Ashenvale Rain (Heavy)
Environment - Turn (Last created weather effect) On
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
WeatherCycle Equal to 2
Then - Actions
Environment - Turn (Last created weather effect) Off
Environment - Remove (Last created weather effect)
Wait 3.00 seconds
Environment - Create at (Entire map) the weather effect Lordaeron Rain (Light)
Environment - Turn (Last created weather effect) On
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
WeatherCycle Equal to 3
Then - Actions
Environment - Turn (Last created weather effect) Off
Environment - Remove (Last created weather effect)
Wait 3.00 seconds
Environment - Create at (Entire map) the weather effect Northrend Snow (Light)
Environment - Turn (Last created weather effect) On
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
WeatherCycle Equal to 1
Then - Actions
Environment - Turn (Last created weather effect) Off
Environment - Remove (Last created weather effect)
Else - Actions
Do nothing

This is my overly long trigger. But it doesn't work, why not?

It is supposed to randomly change weather conditions between No Weather, Northrend Snow (light), Lordaeron Rain (Light), and Ashenvale Rain (Heavy).
11-11-2003, 04:21 AM#2
wcil
It does seem big... Though I'm AFK from my WC3 computer, towards the end, you have a code that does this
Quote:
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
WeatherCycle Equal to 1
Then - Actions
Environment - Turn (Last created weather effect) Off
Environment - Remove (Last created weather effect)
Else - Actions
Do nothing

I believe it it not required. You also have a lot of redundant code that could be put at the top. This is the cleaned up code, though you'll have to test it first. (Reduce the timing from 30 secs to 10 secs to check it out)
Weather Cycle
Events
Time - Every 30.00 seconds of game time
Conditions
Actions
Set WeatherCycle = (Random integer number between 1 and 4)
Environment - Turn (Last created weather effect) Off
Environment - Remove (Last created weather effect)
Wait 3.00 seconds

If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
WeatherCycle Equal to 1
Then - Actions
Environment - Create at (Entire map) the weather effect Ashenvale Rain (Heavy)
Environment - Turn (Last created weather effect) On
Else - Actions
Do nothing

If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
WeatherCycle Equal to 2
Then - Actions
Environment - Create at (Entire map) the weather effect Lordaeron Rain (Light)
Environment - Turn (Last created weather effect) On
Else - Actions
Do nothing

If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
WeatherCycle Equal to 3
Then - Actions
Environment - Create at (Entire map) the weather effect Northrend Snow (Light)
Environment - Turn (Last created weather effect) On
Else - Actions
Do nothing
11-11-2003, 02:00 PM#3
wcil
Ok, attached here is a weather cycle demonstration map which works...

Don't forget to turn on your graphics settings medium-high to enjoy the rain...

Also, you might not want "No Rain" It looks odd that a sudden Ashenvale downpour suddenly becomes a nice sunny day :ggani:

- Wcil
11-11-2003, 02:40 PM#4
Dragon
It would also be odd if it always rained/snowed...
11-12-2003, 02:57 AM#5
wcil
Instead, have 3 states;
Heavy Rain
Snow
No Rain.

To switch from one stage to the next, put in about 30 secs of Light Rain as transition. That would make the change less drastic.