• 🏆 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!
  • ✅ Time to vote for the top 3 models! The POLL for Hive's 6th HD Modeling Contest: Mechanical is now open! 📅 Poll close on July 16, 2024! 🔗 Cast your vote now!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

[Trigger] Swapping weather conditions

Status
Not open for further replies.
Level 21
Joined
Nov 20, 2005
Messages
1,184
I have 2 variables going together with 2 different rain styles(heavy and light). My goal is to use them to swap rain conditions gradually over time, so that at elapsed x seconds of game time, light rain starts, and later, at elapsed y seconds of game time, heavy rain starts and light rain turns off(right after heavy one starts). Triggering light rain is easy.

Actions:
- Environment - Create at (Playable map area) the weather effect Ashenvale Rain (Light)
- Set lightrain = (Last created weather effect)
- Environment - Turn lightrain On

Then, later on, in another trigger:

Actions:
- Environment - Create at (Playable map area) the weather effect Ashenvale Rain (Heavy)
- Set heavyrain = (Last created weather effect)
- Environment - Turn lightrain Off
- Environment - Turn heavyrain On

Later on i wanna turn it back to light, so i use:

Actions:
- Environment - Turn heavyrain Off
- Environment - Turn lightrain On

However, nothing happens. Everything just works fine when i start light rain in the first place, but then heavy rain won't replace light rain. Am i doing something wrong?
 
Level 5
Joined
Jan 17, 2014
Messages
131
Instead of time elapsed, try using time periodic. Switching between the two should be easier.
 
The problem is that you can only have one rain effect created in each region at the same time.

You must destroy the old weather effect and create a new one. Turning the old one off is not sufficient. This will create a significant lag, though. No way around that except if you create the weather effect via a special effect instead of an actual weather effect.
 
Level 21
Joined
Nov 20, 2005
Messages
1,184
The problem is that you can only have one rain effect created in each region at the same time.

You must destroy the old weather effect and create a new one. Turning the old one off is not sufficient. This will create a significant lag, though. No way around that except if you create the weather effect via a special effect instead of an actual weather effect.

i see, but what if i draw a region the size of the entire map and add another region on top of it where i use the effect on?
 
Level 5
Joined
Jan 17, 2014
Messages
131
Here are 2 example triggers + attached test map. I hope it is what you wanted.

  • Trigger 1
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • Environment - Create at (Playable map area) the weather effect Ashenvale Rain (Light)
      • Environment - Turn (Last created weather effect) On
      • Set WS_1 = (Last created weather effect)
      • Set WS = 1
      • Trigger - Turn on Trigger 2 <gen>
  • Trigger 2
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WS Equal to 1
        • Then - Actions
          • Environment - Turn WS_1 Off
          • Wait 1.00 seconds
          • Environment - Remove WS_1
          • Environment - Create at (Playable map area) the weather effect Ashenvale Rain (Heavy)
          • Environment - Turn (Last created weather effect) On
          • Set WS_2 = (Last created weather effect)
          • Set WS = 2
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • WS Equal to 2
            • Then - Actions
              • Environment - Turn WS_2 Off
              • Wait 1.00 seconds
              • Environment - Remove WS_2
              • Environment - Create at (Playable map area) the weather effect Ashenvale Rain (Light)
              • Environment - Turn (Last created weather effect) On
              • Set WS_1 = (Last created weather effect)
              • Set WS = 1
            • Else - Actions
              • Do nothing
 

Attachments

  • Test Map for LordPerenoldeII.w3x
    11.8 KB · Views: 40
Level 21
Joined
Nov 20, 2005
Messages
1,184
So you said this works to you, right? I'd swear i saw something like this regarding variables on another thread, and the problem was solved by simply putting a Wait x.xx seconds in between the variables activation. Perhaps that's what i missed! I'll let you know, in the mean time +rep.
 
Level 5
Joined
Jan 17, 2014
Messages
131
So you said this works to you, right? I'd swear i saw something like this regarding variables on another thread, and the problem was solved by simply putting a Wait x.xx seconds in between the variables activation. Perhaps that's what i missed! I'll let you know, in the mean time +rep.

NNNNNNNNNNOOOOOOOOOOOOOOOOooooooooooooo!!!!!!!!!!! Didn't you read my signature?! Oh well, thank you. :)

P.S. It works without the waits as well. I just added them to let the 1st effect finish before removing it and starting the 2nd.

Edit: Final Update:

  • Trigger 1
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • Set WS = 2
      • Trigger - Turn on Trigger 2 <gen>
  • Trigger 2
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WS Equal to 1
        • Then - Actions
          • Environment - Turn WS_1 Off
          • Environment - Remove WS_1
          • Environment - Create at (Playable map area) the weather effect Ashenvale Rain (Heavy)
          • Environment - Turn (Last created weather effect) On
          • Set WS_2 = (Last created weather effect)
          • Set WS = 2
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • WS Equal to 2
            • Then - Actions
              • Environment - Turn WS_2 Off
              • Environment - Remove WS_2
              • Environment - Create at (Playable map area) the weather effect Ashenvale Rain (Light)
              • Environment - Turn (Last created weather effect) On
              • Set WS_1 = (Last created weather effect)
              • Set WS = 1
            • Else - Actions
              • Do nothing
 

Attachments

  • Test Map for LordPerenoldeII.w3x
    11.7 KB · Views: 37
Level 21
Joined
Nov 20, 2005
Messages
1,184
NNNNNNNNNNOOOOOOOOOOOOOOOOooooooooooooo!!!!!!!!!!! Didn't you read my signature?! Oh well, thank you. :)

P.S. It works without the waits as well. I just added them to let the 1st effect finish before removing it and starting the 2nd.

Edit: Final Update:

  • Trigger 1
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • Set WS = 2
      • Trigger - Turn on Trigger 2 <gen>
  • Trigger 2
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WS Equal to 1
        • Then - Actions
          • Environment - Turn WS_1 Off
          • Environment - Remove WS_1
          • Environment - Create at (Playable map area) the weather effect Ashenvale Rain (Heavy)
          • Environment - Turn (Last created weather effect) On
          • Set WS_2 = (Last created weather effect)
          • Set WS = 2
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • WS Equal to 2
            • Then - Actions
              • Environment - Turn WS_2 Off
              • Environment - Remove WS_2
              • Environment - Create at (Playable map area) the weather effect Ashenvale Rain (Light)
              • Environment - Turn (Last created weather effect) On
              • Set WS_1 = (Last created weather effect)
              • Set WS = 1
            • Else - Actions
              • Do nothing

OH NOOOO!! -_- i saw that before but wasn't paying attention the moment i gave you. sorry. Who knows how many people could have given you and didn't because of that, and here am i. -_- kill me
 
Status
Not open for further replies.
Top