• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Weather System Malfunctioning

Status
Not open for further replies.
Weather System Malfunctioning [Solved]

Solved.



Hey guys, indomitable1319 here; and now, I need some help with my weather system. The effects that are supposedly applied to the player's unit isn't affecting the unit.
There are two core abilities.
The first one's called Curse [Weather: Rains]; based off Curse. (Banshee)

Level 1 gives you a 5% chance to miss, and Level 2 gives you a 10% chance to miss. When Light Rain happens, Level 1 will be cast on PlayerUnit. When Heavy Rain happens, Level 2 will be cast on PlayerUnit.

The second one's called Impede [Weather: Windy]; based off Endurance Aura.

Level 1 has no effects, so it's like an off switch. Level 2 has a -10% movespeed aura and it activates when the weather is Windy.

Now, there's a fourth type of weather, Normal. Nothing will happen.

Now, Windy weather works, but neither of the Rains work; and when Normal happens, the Light Rain effects still play on the map. Please check my triggers for errors. If you need more information, I'll be happy to PM you the test map.

  • Setting Weather Types
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Environment - Create at (Playable map area) the weather effect Ashenvale Rain (Light)
      • Set Weather[1] = (Last created weather effect)
      • Environment - Turn Weather[1] Off
      • Environment - Create at (Playable map area) the weather effect Ashenvale Rain (Heavy)
      • Set Weather[2] = (Last created weather effect)
      • Environment - Turn Weather[2] Off
      • Environment - Create at (Playable map area) the weather effect Outland Wind (Heavy)
      • Set Weather[3] = (Last created weather effect)
      • Environment - Turn Weather[3] Off
  • Weather
    • Events
      • Time - Every 300.00 seconds of game time
    • Conditions
    • Events
      • Environment - Turn Weather[Weather_Int] Off
      • Unit - Set level of Impede [Weather: Windy] for Dummy [Weather] 041 to 1
      • Set Weather_Int = (Random integer between 0 to 5)
      • Environment - Turn Weather[Weather_Int] On
      • If (All Conditions) are True, Then (Then Actions), Else (Else Actions)
        • If - Conditions
          • Weather_Int Equal to 1
        • Then - Actions
          • Game - Show a text message to (All Players): |c007EBEE1Today's Weather: Light Rain - Your hands get wet and slippery, causing you to have a chance to miss your attacks. (You now have a 5% chance to miss)
          • Unit - Set level of Curse [Weather: Rains] for Dummy [Weather] 041 <gen> to 1
          • Unit - Order Dummy [Weather] 041 <gen> to Undead Banshee - Curse PlayerUnit
        • Else - Actions
          • If (All Conditions) are True, Then (Then Actions), Else (Else Actions)
            • If - Conditions
              • Weather_Int Equal to 2
            • Then - Actions
              • Game - Show a text message to (All Players): |c007EBEE1Today's Weather: Heavy Rain - Your hands get wet and slippery, water seeps into your helmet and gets into your eyes, causing you to have a chance to miss your attacks. (You now have a 10% chance to miss)
              • Unit - Set level of Curse [Weather: Rains] for Dummy [Weather] 041 <gen> to 2
              • Unit - Order Dummy [Weather] 041 <gen> to Undead Banshee - Curse PlayerUnit
              • Else - Actions
                • If (All Conditions) are True, Then (Then Actions), Else (Else Actions)
                  • If - Conditions
                    • Weather_Int Equal to 3
                  • Then - Actions
                    • Game - Show a text message to (All Players): |c007EBEE1Today's Weather: Windy - Your steps are impeded by the strength of the gusts of wind. (Your movement speed is reduced by 10%)
                    • Unit - Set level of Impede [Weather:Windy] for Dummy [Weather] 041 <gen> to 2
                    • If (All Conditions) are True, Then (Then Actions), Else (Else Actions)
                      • If - Conditions
                        • Weather_Int Equal to 4
                      • Then - Actions
                        • Game - Show a text message to (All Players): |c007EBEE1Today's Weather: Normal - You will not experience anything out of the ordinary.
                      • Else - Actions
Thanks for reading, and hopefully, answering! If you need to inspect the map's triggers, PM me and I'll PM back with the map itself.
 
Last edited:

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,197
You need to add the abilities before setting their level if the unit does not have them already.

The level of an ability a unit does not have is 0.
The level of an ability a unit does have is greater than 0.
Trying to set the level of an ability a unit has to 0 via triggers will not remove the ability.
Trying to set the level of an ability a unit does not have to greater than 0 via triggers will not give the unit the ability.
 
The unit already has those abilities. :S
9a8niu.png
 
-be sure that the caster can see the target unit

OMG. That could be it!

-be sure that the caster can cast the ability (possible errors would be regarding mana, range and techtree requirements)

Done. :)

So the only problem left is:
When the weather is Normal, the Light Rain weather still appears.
 
my theory was that the default setting for weather vars is light rain... ^_^

Question: Why is the IF-then-else for the normal weather inside the Then block of the Weather_Int = 3??? and why is there no settings for 0,5? because as far as my experience is concerned, even if it says Random blahblah between... it still includes the bounds...
 
Hmm... I think you could try to create/destroy the weather effect everytime the weather changes. I myself have had previous problems with creating every weather effect right at the start and saving them to variables (so I settled with create then destroy)... It really doesn't seem to work that way, maybe the engine doesn't allow the creation of several weather effects...

are you sure the curse doesn't have a techtree requirement? and also check the allowed targets...

as for the multiboard, it depends on the components of your map...
 
  • Weather
    • Events
      • Time - Every 300.00 seconds of game time
      • Player - Player 2 (Blue) types a chat message containing runtrigweath as A substring
    • Conditions
    • Actions
      • Environment - Remove Weather[Weather_Integer]
      • Unit - Set level of Impede [Weather: Windy] (Neutral Hostile) for Dummy [Weather] 0041 <gen> to 1
      • Set Weather_Integer = (Random integer number between 1 and 4)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Weather_Integer Equal to 1
        • Then - Actions
          • Environment - Create at (Playable map area) the weather effect Ashenvale Rain (Light)
          • Set Weather[1] = (Last created weather effect)
          • Environment - Turn Weather[1] On
          • Game - Display to (All players) the text: |c007EBEE1Today's W...
          • Unit - Set level of Curse [Weather: Rains] for Dummy [Weather] 0041 <gen> to 1
          • Unit - Order Dummy [Weather] 0041 <gen> to Undead Banshee - Curse PlayerUnit
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Weather_Integer Equal to 2
            • Then - Actions
              • Environment - Create at (Playable map area) the weather effect Ashenvale Rain (Heavy)
              • Set Weather[2] = (Last created weather effect)
              • Environment - Turn Weather[2] On
              • Game - Display to (All players) the text: |c007EBEE1Today's W...
              • Unit - Set level of Curse [Weather: Rains] for Dummy [Weather] 0041 <gen> to 2
              • Unit - Order Dummy [Weather] 0041 <gen> to Undead Banshee - Curse PlayerUnit
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Weather_Integer Equal to 3
                • Then - Actions
                  • Environment - Create at (Playable map area) the weather effect Outland Wind (Light)
                  • Set Weather[3] = (Last created weather effect)
                  • Environment - Turn Weather[3] On
                  • Game - Display to (All players) the text: |c007EBEE1Today's W...
                  • Unit - Set level of Impede [Weather: Windy] (Neutral Hostile) for Dummy [Weather] 0041 <gen> to 2
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Weather_Integer Equal to 4
                    • Then - Actions
                      • Game - Display to (All players) the text: |c007EBEE1Today's W...
                    • Else - Actions
[EDIT]
The trigger perfectly works now! Problem solved. +Rep to Adiktuz.
 
Status
Not open for further replies.
Top