WorldEditor sort off

How i can add a random rain im my map ? I mean 5 min of heavy rain and then 10 min of simple rain or even a “rainoff” cloudy weather ? and how i can switch time to time between cloudy wather and sunlight weather by my map settings ? the same as i write above (5 min rain and cloudy and 10 min of clear sky with sunlights with birds singing)
p.s now i just can create a map with selected weather, i mean if its heavy rain it is the whole time and its not what i need for my idea.
p.s i create only maps for melee, if its have a change smtg

You have to use triggers. There is a trigger action: Environment - Create Weather Effect. Note that, though, creating a trigger will most likely flag the map non-melee, so it has to be then played as a Custom Game in the Battle Net if you want to play it online.

Edit: Actually, if you want to play custom melee maps, they have to be always played as Custom Games anyway, so…

but this is how it is goes, i dont create maps for blizzard ranked (iwantobutno:D), just for play things with freands on bnet customs, just whant a map thats u rly enjoy to stay at, not just for quick play and “fkoff” u now. Map for that old good plays when we all dont now “how” to do it, dont see the pro"plays and in the end ruining the mood. Im just to old for dat :slight_smile:

Well yeah, then you have to use triggers.

if i already use map settings and have a “heavyrain” do i need to create the “remove last created wether effect” - but what i need to do to set time on this ? i mean How ?

Don’t use any Global Weather from the Map Options. Instead, make them via the triggers. Make a trigger with an event: Time - Periodic Event. Then wait a random time and put an action Environment - Create Weather Effect. Also remember to first remove the last created Weather Effect. I don’t know if they can overlap, but it’s a good practice to always destroy all unused data so they don’t pile up and take up memory.

And it might actually be better to use timers, as they are precise and don’t get messed up. Waits should be avoided is most cases.

You could do something like this:

Random Weather Timer
    Events
        Time - Elapsed game time is 0.00 seconds
    Conditions
    Actions
        Countdown Timer - Start WeatherTimer as a One-shot timer that will expire in (Random real number between 300.00 and 900.00) seconds

Random Weather
    Events
        Time - WeatherTimer expires
    Conditions
    Actions
        Set RandomWeatherInteger = (Random integer number between 1 and 3)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                RandomWeatherInteger Equal to 1
            Then - Actions
                Environment - Remove (Last created weather effect)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                RandomWeatherInteger Equal to 2
            Then - Actions
                Environment - Remove (Last created weather effect)
                Environment - Create at (Playable map area) the weather effect Ashenvale Rain (Heavy)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                RandomWeatherInteger Equal to 3
            Then - Actions
                Environment - Remove (Last created weather effect)
                Environment - Create at (Playable map area) the weather effect Wind (Heavy)
            Else - Actions
        Countdown Timer - Start WeatherTimer as a One-shot timer that will expire in (Random real number between 300.00 and 900.00) seconds

You can also move the Countdown Timer - Start WeatherTimer inside the if-blocks and change the number to make rain and wind and other “special” weathers last less than clear sunny weather.

1 Like

a lot off new info, i need time to chek it out. Tnx btw

Okay I tell you how to do it in a more efficient way. I hope you respect my huge amount of work spent with the editor, and I just drop with ya the most efficient idea baced and thousands of hours of training…

Basicially you never need to avoid wait commands unles they are inside the Map initialization triggers. This way will work most secure and efficient and simple way, (i can come up with). But also it will teach you a great amount of knowledge within how to make things work in the editor.

Map Initialization:
//Environment - Create Weather Effect
Create at (Playable map area) the weather effect Ashenvale Rain (Heavy)
Set variable (abc) = Last Created Weather effect
Create at (Playable map area) the weather effect Ashenvale Rain (Light)
Set variable (abc2) = Last Created Weather effect

Then create a new trigger:
Elapsed time is 0.00 seconds

Actions
//Environment - Enable/Disable Weather Effect
Turn (abc) On
Wait 300.00 seconds
Turn (abc) Off
Turn (abc2) On
Wait 600.00 seconds
Turn (abc2) Off
Trigger- Run this trigger again

Well, that works too, but there is no randomness. Adding the weather effects to a variable, though, it a good catch. I didn’t realize that you have to turn on the effects anyway, that’s why my triggers looks like that. And sure, waits are okay in such triggers, which don’t interfere with anything else, but mainly if you are doing something like a spell or something, waits are bad for a couple of things:

  1. They are not exact. Even a 0.00 second wait is actually somewhere around from 0.2 to even 0.5 seconds, depending on some unknown factors. Lag might have something to do with it, but that’s the not only factor, since even in a single player game you might get pretty close to a 0.1 second wait, but it still won’t be 0.00 there either.

  2. They are not compatible with other waits and variable references get lost, unless you use local variables. For example, if you have a spell trigger with an event “A unit starts the effect of an ability” the Casting unit wont work after waits. And if you use a custom variable, it will get wrong units: like if some else unit cast that spell again during that wait, that old trigger’s unit variable would refer to that new unit, though it had nothing to do with the original cast.

  3. Waits run on the background even if the game was paused or some player is lagging. If you have multiple waits and someone pauses the game, all the waits run on and when the game unpauses, all the things that should happen after the wait, happen all at once. Wait (Game-time) does pause during pauses as it uses timers, but as a function that’s even worse, because it is lazily made and it leaks. If you absolutely have to use waits, you can take the Wait (Game-Time) code and import it as a custom script and fix the leak. But it has never come to that for myself, as I can just use timers manually.

Waits are the most accurate way of following time in the world editor triggers. I have made a test map where you can use around 10 000 wait actions in one second, it means how much the cpu is capable of handing them and how fast it is. It is really unlikely that wait commands doesnt work at the exact time.

If you want random in the map, after you have learned basic way of doing it. You can use for example time of day to turn second trigger on, and so forth.

You can also set wait times for random, for example 60.00-600.00 seconds. And so forth.

Also in this specific mission, when it comes to making rain, it doesnt matter if it doenst come at the exact time.

Well, that’s just not true. Ap0calypse on Hive explains the inaccuracy of waits pretty well. And it’s not that the game couldn’t handle a lot of waits, it’s that the time the wait says to wait is not exactly that time in reality. Unlike with the timed events or timers.

Here, download and run this test map of mine and you’ll see, what I mean. Just press Esc to switch between wait and timer mode.

I made two modes: both count numbers from 1 to 25 on the screen. The other is made with 0.00 second waits and the other with a timer that expires in 0.00 seconds. Just watch the difference! That is the problem with the waits’ inaccuracy. If what you say was true, that waits indeed were the most accurate way to measure time, then both modes should look equal - or even the other way around.

And this all is just only one point of why waits are bad (in most cases). There’s still the two other points I pointed that indeed make waits insufficient in most situations.

I did this in my trigger, so I know how to do that. My point was that if you want more than one weather effect, all of them would always happen in the same order, thus they would not be random, even if the duration between them was.

I dont want to test you map because it said that level info missing data or invalid. When I test your file accuracy.

Ur map can cause bug into my system.

I made my own map wish simple commands wait and countdown trigger and they performed the exactly same result.

You probably don’t have the newest 1.31 version then.

Post your triggers, because that’s not possible.

Waits are extremely flawed: 25 times 0.00 second wait takes about 2 seconds in reality.

Seriously, just test anything and put a 0.00 second wait between them and you see that it indeed is more than 0.00 seconds (i.e. not instant; 0.00 seconds shouldn’t take any time at all)


If you don’t want to download the map, then make your own and make triggers like this:

Increase Duration
    Events
        Time - Every 0.01 seconds of game time
    Conditions
    Actions
        Set Duration = (Duration + 0.01)

Timer test 2
    Events
        Time - Elapsed game time is 0.00 seconds
    Conditions
    Actions
        Countdown Timer - Start Timer2 as a One-shot timer that will expire in 5.00 seconds

Timer2 expire
    Events
        Time - Timer2 expires
    Conditions
    Actions
        Game - Display to (All players) the text: (Duration Timer:  + (String(Duration)))

Wait test 2
    Events
        Time - Elapsed game time is 0.00 seconds
    Conditions
    Actions
        Wait 5.00 seconds
        Game - Display to (All players) the text: (Duration Wait:  + (String(Duration)))

I guarantee that the wait will be longer than the timer. And the timer will indeed be exactly 5.000 seconds.

Hold on… this was the triggers that I used:
Trigger 1:
Player 1 (red) types a chat message containing count to ten as An exact match
Countdown Timer- Start timer as a One-shot timer that will expire in 10.00 seconds

Trigger 2
Time- timer expires

actions:
Game- Display to (player 1) for 30.00 second th text : 10 seconds count down timer has expired

Trigger 3:
Player 1(red) types a chat message containing count to ten as An exact match

Actions
Wait 10.00 seconds
Game -Display to (player 1 ) the text: 10 seconds passed

It will result that the text are printed at the exaxtly same time.

I made ur test but without the increase duration trigger.

and they resulted exactly the same speed… i dont understand where u had problems.

That’s the whole point of it. Of course it does work. But my point is that waits are not as precise and accurate as timers. Do the duration and you see what I mean.

I start to feel like ure really messy at making maps with the editor , and you want to look into your messy map and solve ur error or problem for you.

It is really bad coded.

Propably ure just a troll… Just look at your shi*ty triggers. Like starting coundown timer that will expire in 0 seconds ect… ure huge troll.

Also nobody claimed that wait 0.00 seconds work flawlessy. it is a really stypid command, because computer needs to do algorith in 0 second which is virtually impossible.

That mess doesnt have anything to do with the thing that wait command or work accurately or not.

Heh, well think whatever you want. I’ve had my share with the Editor to know what works and what doesn’t.

It’s a lot better than yours, because it actually gives the ability to do changes and adjustments with little tweaks. You’re trigger would require basically making the whole trigger again if you suddenly wanted to make something different (like adding more weather effects or adding randomness to them).

Actually, you did. You said, quote: “Waits are the most accurate way of following time in the world editor triggers.” Don’t get fooled by the 0.00 seconds thingies: the point was that waits drag behind 0.1 to 0.7 seconds. Every time, it’s not restricted to 0.00 second waits. Even after 1000 second wait, wait will have taken roughly one second longer than 1000 second timer. And it just adds up if you do multiple waits in a row.

That’s not even remotely impossible, because the functions are not called “in 0 second” (at least, I think you mean that they would all be called simultaneously), the coding is still ran line by line under the hood. It’s almost the same as running a loop or running many triggers with the same event. They aren’t really ran at the same time, but right after each other. Like if you put two chat commands right after each other: they appear exactly at the same time on the screen, but in reality it takes like .0000something seconds for the computer to run the code.

And yes, it is stupid to actually use a repeating timer that expires in 0.00 seconds, but I just made that to prove a point.

Yes it has. It proves, that waits are not accurate. And I think that’s why you are lashing out now, because you realized you were wrong. And thus, I conclude this debate and even if it wasn’t, I don’t think there is much to talk about anymore, since I’m not interested to have a yet another futile conversion with troll-callers.

But anyway, I hope you learned something, and keep up working with the Editor - I’d love to see some of your maps. Seriously. Until then, take care!

Dont talk to me butcher. Youre type of person who creates mess instead of order.

The pompous attitude must really be encouraging to see for anyone that maybe wants to help you.