• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Random Weather

Status
Not open for further replies.
Level 7
Joined
May 8, 2009
Messages
102
Hello again Hivelets! Long time no see...

So I've been working on a random weather system that I'm gonna implement on a farming simulation (LOL) and I've been experiencing problems that no one I've asked have been able to answer. so, I'm asking you guys for help! so anyway here's the triggers:

  • Weather Initialization
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Environment - Create at (Playable map area) the weather effect Northrend Snow (Light)
      • Set WeatherEffect[1] = (Last created weather effect)
      • Environment - Turn (Last created weather effect) Off
      • Environment - Create at (Playable map area) the weather effect Northrend Snow (Heavy)
      • Set WeatherEffect[2] = (Last created weather effect)
      • Environment - Turn (Last created weather effect) Off
      • Environment - Create at (Playable map area) the weather effect Northrend Blizzard
      • Set WeatherEffect[3] = (Last created weather effect)
      • Environment - Turn (Last created weather effect) Off
      • Set WeatherString[1] = Light Snow
      • Set WeatherString[2] = Heavy Snow
      • Set WeatherString[3] = Blizzard
and...

  • Weather Start
    • Events
      • Time - Every 4.00 seconds of game time
    • Conditions
    • Actions
      • Environment - Turn WeatherEffect[WeatherIndex] Off
      • Set WeatherIndex = (Random integer number between 1 and 3)
      • Environment - Turn WeatherEffect[WeatherIndex] On
      • Game - Display to (All players) the text: WeatherString[WeatherIndex]
Hope someone helps.. rep and credits!
 
Level 7
Joined
May 8, 2009
Messages
102
Only light snow works so I made strings to detect if the others were actually working and well the strings were showing that the others did work but the weather doesn't show.
_______________________________________________________________________
UGH i suck at explaining pls do yourself a favor and download the sample map below.
and yeah sry for not explaining too well. -_-
 

Attachments

  • Weathermap.w3x
    16.7 KB · Views: 75
Level 9
Joined
Oct 11, 2009
Messages
477
Hello again Hivelets! Long time no see...

So I've been working on a random weather system that I'm gonna implement on a farming simulation (LOL) and I've been experiencing problems that no one I've asked have been able to answer. so, I'm asking you guys for help! so anyway here's the triggers:

  • Weather Initialization
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Environment - Create at (Playable map area) the weather effect Northrend Snow (Light)
      • Set WeatherEffect[1] = (Last created weather effect)
      • Environment - Turn (Last created weather effect) Off
      • Environment - Create at (Playable map area) the weather effect Northrend Snow (Heavy)
      • Set WeatherEffect[2] = (Last created weather effect)
      • Environment - Turn (Last created weather effect) Off
      • Environment - Create at (Playable map area) the weather effect Northrend Blizzard
      • Set WeatherEffect[3] = (Last created weather effect)
      • Environment - Turn (Last created weather effect) Off
      • Set WeatherString[1] = Light Snow
      • Set WeatherString[2] = Heavy Snow
      • Set WeatherString[3] = Blizzard
and...

  • Weather Start
    • Events
      • Time - Every 4.00 seconds of game time
    • Conditions
    • Actions
      • Environment - Turn WeatherEffect[WeatherIndex] Off
      • Set WeatherIndex = (Random integer number between 1 and 3)
      • Environment - Turn WeatherEffect[WeatherIndex] On
      • Game - Display to (All players) the text: WeatherString[WeatherIndex]
Hope someone helps.. rep and credits!

Here, I will provide you a GUI version of the random weather effect trigger.:cute: Don't use strings in setting the weather, because some string functions are useless in setting a random weather. So here's the trigger:

  • <Name of Trigger>
    • Events
      • Map Initialization
    • Conditions
    • Actions
      • Environment - Create at (Entire Map) the weather effect Northrend Snow(Light)
      • Set Weather_Variable[1] = (Last created weather effect)
      • Environment - Create at (Entire Map) the weather effect Northrend Snow(Heavy)
      • Set Weather_Variable[2] = (Last created weather effect)
      • Environment - Create at (Entire Map) the weather effect Northrend Blizzard
      • Set Weather_Variable[3] = (Last created weather effect)
      • Environment - Create at (Entire Map) the weather effect Ashenvale Rain(Light)
      • Set Weather_Variable[4] = (Last created weather effect)
      • Environment - Create at (Entire Map) the weather effect Ashenvale Rain(Heavy)
      • Set Weather_Variable[5] = (Last created weather effect)
      • Environment - Create at (Entire Map) the weather effect Wind(Light)
      • Set Weather_Variable[6] = (Last created weather effect)
      • Environment - Create at (Entire Map) the weather effect Wind(Heavy)
      • Set Weather_Variable[7] = (Last created weather effect)
      • Environment - Create at (Entire Map) the weather effect Outland Wind
      • Set Weather_Variable[8] = (Last created weather effect)
      • Environment - Create at (Entire Map) the weather effect Azeroth Winter
      • Set Weather_Variable[9] = (Last created weather effect)
      • Environment - Create at (Entire Map) the weather effect Lordaeron Rain(Light)
      • Set Weather_Variable[10] = (Last created weather effect)
      • Environment - Create at (Entire Map) the weather effect Lordaeron Rain(Heavy)
      • Set Weather_Variable[11] = (Last created weather effect)
      • Environment - Create at (Entire Map) the weather effect Rays of Light
      • Set Weather_Variable[12] = (Last created weather effect)
      • Environment - Create at (Entire Map) the weather effect Moonlight
      • Set Weather_Variable[13] = Last Created Weather Effect
      • Environment - Turn Weather_Variable[Random integer between 1 and 13] On
Note:Random integer function is found in the Math functions in the integer section.
I hope you understand!:grin::grin::grin: Reply to this post or PM me if you have questions about the trigger I provided or another set of triggers.
 
Last edited:
Level 7
Joined
May 8, 2009
Messages
102
Here, I will provide you a GUI version of the random weather effect trigger.:cute: Don't use strings in setting the weather, because some string functions are useless in setting a random weather. So here's the trigger:

  • <Name of Trigger>
    • Events
      • Map Initialization
    • Conditions
    • Actions
      • Environment - Create at (Entire Map) the weather effect Northrend Snow(Light)
      • Set Weather_Variable[1] = (Last created weather effect)
      • Environment - Create at (Entire Map) the weather effect Northrend Snow(Heavy)
      • Set Weather_Variable[2] = (Last created weather effect)
      • Environment - Create at (Entire Map) the weather effect Northrend Blizzard
      • Set Weather_Variable[3] = (Last created weather effect)
      • Environment - Create at (Entire Map) the weather effect Ashenvale Rain(Light)
      • Set Weather_Variable[4] = (Last created weather effect)
      • Environment - Create at (Entire Map) the weather effect Ashenvale Rain(Heavy)
      • Set Weather_Variable[5] = (Last created weather effect)
      • Environment - Create at (Entire Map) the weather effect Wind(Light)
      • Set Weather_Variable[6] = (Last created weather effect)
      • Environment - Create at (Entire Map) the weather effect Wind(Heavy)
      • Set Weather_Variable[7] = (Last created weather effect)
      • Environment - Create at (Entire Map) the weather effect Outland Wind
      • Set Weather_Variable[8] = (Last created weather effect)
      • Environment - Create at (Entire Map) the weather effect Azeroth Winter
      • Set Weather_Variable[9] = (Last created weather effect)
      • Environment - Create at (Entire Map) the weather effect Lordaeron Rain(Light)
      • Set Weather_Variable[10] = (Last created weather effect)
      • Environment - Create at (Entire Map) the weather effect Lordaeron Rain(Heavy)
      • Set Weather_Variable[11] = (Last created weather effect)
      • Environment - Create at (Entire Map) the weather effect Rays of Light
      • Set Weather_Variable[12] = (Last created weather effect)
      • Environment - Create at (Entire Map) the weather effect Moonlight
      • Set Weather_Variable[13] = Last Created Weather Effect
      • Environment - Turn Weather_Variable[Random integer between 1 and 13] On
Note:Random integer function is found in the Math functions in the integer section.
I hope you understand!:grin::grin::grin: Reply to this post or PM me if you have questions about the trigger I provided or another set of triggers.


Well this works but I still have a major problem. I need the weather to change periodically. Example: 30 seconds into the game, the weather changes to light snow. after 30 seconds, weather changes randomly to either heavy snow, a blizzard or remains as light snow, then after another 30 seconds, weather changes again. We do this over and over again until someone ends the game. So, can you tweak the trigger so that the weather changes periodically and not just at initialization?

lol sry I'm asking too much -_- +rep for attempt(s) though :grin:
 
Ok, here is how you are going to do it. I tested it and it works.

  • Globals Setting
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: set udg_WeatherTypes[1] = 'FDrl'
      • Custom script: set udg_WeatherTypes[2] = 'SNbs'
      • Custom script: set udg_WeatherTypes[3] = 'WOcw'
  • Weather Generation
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Custom script: call RemoveWeatherEffect (udg_Weather)
      • Set Integer = (Random integer number between 1 and 3)
      • Custom script: set udg_Weather = AddWeatherEffectSaveLast (GetPlayableMapRect(), udg_WeatherTypes[udg_Integer])
      • Custom script: call EnableWeatherEffect (udg_Weather, true)

Reminder: The WeatherTypes[] variable is an Integer variable.

And this is the list of the available weather effects. Follow the Globals's trigger pattern to get what you need from the following list:
JASS:
WEATHER_ASHENVALE_HEAVY_RAIN = 'RAhr'
WEATHER_ASHENVALE_LIGHT_RAIN = 'RAlr'
WEATHER_DALARAN_SHIELD = 'MEds'
WEATHER_DUNGEON_HEAVY_BLUE_FOG = 'FDbh'
WEATHER_DUNGEON_LIGHT_BLUE_FOG = 'FDbl'
WEATHER_DUNGEON_HEAVY_GREEN_FOG = 'FDgh'
WEATHER_DUNGEON_LIGHT_GREEN_FOG = 'FDgl'
WEATHER_DUNGEON_HEAVY_RED_FOG = 'FDrh'
WEATHER_DUNGEON_LIGHT_RED_FOG = 'FDrl'
WEATHER_DUNGEON_HEAVY_WHITE_FOG = 'FDwh'
WEATHER_DUNGEON_LIGHT_WHITE_FOG = 'FDwl'
WEATHER_LORDAERON_HEAVY_RAIN = 'RLhr'
WEATHER_LORDARON_LIGHT_RAIN = 'RLlr'
WEATHER_NORTHREND_BLIZZARD = 'SNbs'
WEATHER_NORTHREND_HEAVY_SNOW = 'SNhs'
WEATHER_NORTHREND_LIGHT_SNOW = 'SNls'
WEATHER_OUTLAND_HEAVY_WIND = 'WOcw'
WEATHER_OUTLAND_LIGHT_WIND = 'WOlw'
WEATHER_RAY_OF_LIGHT = 'LRaa'
WEATHER_RAY_OF_MOONLIGHT = 'LRma'
WEATHER_HEAVY_WIND = 'WNcw'
 
Level 7
Joined
May 8, 2009
Messages
102
Ok, here is how you are going to do it. I tested it and it works.

  • Globals Setting
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: set udg_WeatherTypes[1] = 'FDrl'
      • Custom script: set udg_WeatherTypes[2] = 'SNbs'
      • Custom script: set udg_WeatherTypes[3] = 'WOcw'
  • Weather Generation
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Custom script: call RemoveWeatherEffect (udg_Weather)
      • Set Integer = (Random integer number between 1 and 3)
      • Custom script: set udg_Weather = AddWeatherEffectSaveLast (GetPlayableMapRect(), udg_WeatherTypes[udg_Integer])
      • Custom script: call EnableWeatherEffect (udg_Weather, true)

Reminder: The WeatherTypes[] variable is an Integer variable.

And this is the list of the available weather effects. Follow the Globals's trigger pattern to get what you need from the following list:
JASS:
WEATHER_ASHENVALE_HEAVY_RAIN = 'RAhr'
WEATHER_ASHENVALE_LIGHT_RAIN = 'RAlr'
WEATHER_DALARAN_SHIELD = 'MEds'
WEATHER_DUNGEON_HEAVY_BLUE_FOG = 'FDbh'
WEATHER_DUNGEON_LIGHT_BLUE_FOG = 'FDbl'
WEATHER_DUNGEON_HEAVY_GREEN_FOG = 'FDgh'
WEATHER_DUNGEON_LIGHT_GREEN_FOG = 'FDgl'
WEATHER_DUNGEON_HEAVY_RED_FOG = 'FDrh'
WEATHER_DUNGEON_LIGHT_RED_FOG = 'FDrl'
WEATHER_DUNGEON_HEAVY_WHITE_FOG = 'FDwh'
WEATHER_DUNGEON_LIGHT_WHITE_FOG = 'FDwl'
WEATHER_LORDAERON_HEAVY_RAIN = 'RLhr'
WEATHER_LORDARON_LIGHT_RAIN = 'RLlr'
WEATHER_NORTHREND_BLIZZARD = 'SNbs'
WEATHER_NORTHREND_HEAVY_SNOW = 'SNhs'
WEATHER_NORTHREND_LIGHT_SNOW = 'SNls'
WEATHER_OUTLAND_HEAVY_WIND = 'WOcw'
WEATHER_OUTLAND_LIGHT_WIND = 'WOlw'
WEATHER_RAY_OF_LIGHT = 'LRaa'
WEATHER_RAY_OF_MOONLIGHT = 'LRma'
WEATHER_HEAVY_WIND = 'WNcw'


This. Thanks+rep+credits+<3
 
Status
Not open for further replies.
Top