HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Setting up a random weather cycle

10-31-2003, 10:10 PM#1
evilwolf
Ok for this RPG of mine, i want it to be somewhat realistic, so i want to set up a random weather cycle. How would i go about doing this?

Heres how i THINK it might work:

Event: every ### of seconds (maybe 3-4 minuets per weather effect)
Action: pick a random number (how ever that would work)
All of them would be if then else.
If # = 1 then do actions else do nothing
the action would be enabling a trigger with my weather effect all set up and ready

Example

Trigger initially off
Actions: set sky to fogged
Actions: set fog to grey color 50% density # value for start/stop
Actions: Set weather effect ashenvale rain heavy
Actions: enable "lightning flash trigger" (whatever)

Lightning flash would just be a trigger fade in/out pure white screen over like .25 seconds with some thunder noise.

So, tell me how the trigger would ACTUALLY be set up, because if it was this easy everyone would be able to make a map :ggani:
10-31-2003, 10:43 PM#2
MarSara
Let me warn you first, this causes a lot of lag, but here it is:

Code:
[b]Setup Effects[/b]
Events:
    - Map Init
Conditons:
    - None
Actions:
    - CreateWeatherEffect(...)
    - set Effect[0] = (Last Created Weather Effect)
    - CreateWeatherEffect(...)
    - set Effect[1] = (Last Created Weather Effect)
    ....
    ....
    //repeat for all effects 

[b]Randomize Effects[/b]
Events:
    - Every Y seconds
Conditions:
    - None (unless needed)
Actions:
    - for (Integer A) = 0 to X
        - DisableWeatherEffect[(Integer A)]

    - EnableWeatherEffect Effect[(RandomNumber from 0 to X)]

    // X is the highest index used in first trigger
10-31-2003, 10:49 PM#3
evilwolf
emote_sweat ...what?

does it have to be in code? i dont know anything about JASS or coding.

Could you post the trigger how it should look in the normal trigger editor thing. the code stuff just looks like jibberish to me.
10-31-2003, 10:50 PM#4
IDISacredIDI
Sounds good to me, you need a variable that can be linked to the weather. But i think what you have wrote would work (of course it will need some tweaking).

You could always use regions and have if unit A enters region X then set weather effect to *whatever* it's not as good as a totally random weather pattern but can make the game seem more realistic.

Ill explain what I mean, if your map has mountains and a village surrounded by farms, suddenly it starts to snow (one of the weather effects you have set) now the snow wont settle on the ground around the village making the map look sort of weird. It would be the same if you suddenly got heavy rain on snowy mountains as the snow would melt.

IMO a region based weather system would be just as effective if not better, yeah it won't have the randomization (sp?) that your weather system would have but it would be much more realistic.

Of course a mix of the 2 would be the best, like Unit B enters region Mountains, Turn Trigger random weather for mountains on. This way you are limiting the weather effects that can be activated while in the mountains while still creating a random weather effect (this would change every time they entered the region).

I cant open WE right now or I could have wrote some variables to help you with the trigger, when I can ill either post the variables and triggers or make a map with everything in place. But I'm busy all day tomorrow so might not get much of a chance.

IDISacredIDI
10-31-2003, 10:53 PM#5
IDISacredIDI
Quote:
Originally posted by evilwolf
emote_sweat ...what?

does it have to be in code? i dont know anything about JASS or coding.

Could you post the trigger how it should look in the normal trigger editor thing. the code stuff just looks like jibberish to me.


Its not code at all (well it sort of is but you know...) thats exactly how to write the trigger so it will work and do what you have asked. No JASS needed!

IDISacredIDI