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

[Trigger] Random Weather Changes

Status
Not open for further replies.
Level 5
Joined
Oct 5, 2012
Messages
67
Hey, I wanted to involve a "weather-change" in my new map. But because I don't want to make it to predictable it should be random. It also should change 2-3 times (for example from Rain to Snow to Wind). Is that possible? I tried with 3 "elapsed game time is..." -> "enviroment - create weather effect". But it didn't seem to work. Hope you can help me :)
 
Level 12
Joined
Nov 20, 2007
Messages
660
Hey, I wanted to involve a "weather-change" in my new map. But because I don't want to make it to predictable it should be random. It also should change 2-3 times (for example from Rain to Snow to Wind). Is that possible? I tried with 3 "elapsed game time is..." -> "enviroment - create weather effect". But it didn't seem to work. Hope you can help me :)

There you go.
It changes weather every 8 seconds.
 

Attachments

  • Weather Change.w3x
    16.6 KB · Views: 58
Level 5
Joined
Oct 5, 2012
Messages
67
wow thanks, is there also the possibility that there will be no weather effect (so the last created weather effect will be deleted)?
edit: I also would like to have random intervalls (between for example 1 and 30 seconds). How do I achieve that?
 
Last edited:
Level 10
Joined
Dec 17, 2011
Messages
355
So here it is ,its very like the previous one ,but the weather changeing trigger now triggers in random between 3 and 7 second .There are now 6 weather effects and if the Weather_Random becomes more than 6 it means there will be no effect in the map . :ogre_haosis:
 

Attachments

  • Weather Change.w3x
    16.6 KB · Views: 48
Level 5
Joined
Oct 5, 2012
Messages
67
Mhm... It still changes every 8 seconds, as far as I see... Also there are 7 weather effects, and thre isn't the possibility that there will be no one. Maybe you uploaded the wrong one?
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Mhm... It still changes every 8 seconds
I don't download his map yet, but I'm guessing he only randomize it once per game, whereas it should be randomize after each weather change or event occur.

This is how it should be;
  • Setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set RandomTime = (Real((Random integer number between 5 and 10)))
      • Trigger - Add to Weather Change <gen> the event (Time - Every RandomTime seconds of game time)
  • Weather Change
    • Events
    • Conditions
    • Actions
      • Game - Display to (All players) the text: (String(RandomTime))
      • Set RandomTime = (Real((Random integer number between 5 and 10)))
This is how it should be.

Instead of getting static value per game, the time is randomized for each time the Event occur.

Additional Notes
Trigger - Add New Event
RandomTime is in Real, but converted to Integer to randomize time for more accurate variation.


EDIT:
On second thought, I think it's just randomize the same thing, gonna experiment more.
 
Level 5
Joined
Oct 5, 2012
Messages
67
good, that problem is sovled. The last open question is: how can I also grant the possibility, that the last created weather effect will be deleted (so there is NO weather).
 
Level 10
Joined
Dec 17, 2011
Messages
355
Use a timer instead of a periodic event.
  • Countdown Timer - Start hai as a One-shot timer that will expire in (Random real number between 3.00 and 7.00) seconds
and for event
  • Time - hai expires
Run the timer each time it expires so it keeps repeating.

Hey ,isnt just simpler to use this event ?
  • Time - Every (Random real number between 3.00 and 7.00) seconds of game time
 
Level 20
Joined
Jul 6, 2009
Messages
1,885
Hey ,isnt just simpler to use this event ?
  • Time - Every (Random real number between 3.00 and 7.00) seconds of game time

It doesn't do the same thing. The event is initialized while the map is loading which means the event will fire at equal intervals, different each game (depending on the random number).
 
Level 5
Joined
Oct 5, 2012
Messages
67
Hey ,isnt just simpler to use this event ?
  • Time - Every (Random real number between 3.00 and 7.00) seconds of game time

no, that's the one mistake you made. The random real number will stay the same for the whole game. But my problem is solved, I just have to take youre map and combine it with the trigger above. Thanks!
 
Status
Not open for further replies.
Top