• 🏆 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!

[Solved] Weather Effect

Status
Not open for further replies.
Level 10
Joined
Jun 20, 2017
Messages
333
Need help to solve this weather effect. The command isn't working!
  • Weather Effect
    • Events
      • Player - Player 1 (Red) types a chat message containing -weather as A substring
      • Player - Player 2 (Blue) types a chat message containing -weather as A substring
      • Player - Player 3 (Teal) types a chat message containing -weather as A substring
      • Player - Player 4 (Purple) types a chat message containing -weather as A substring
      • Player - Player 5 (Yellow) types a chat message containing -weather as A substring
      • Player - Player 6 (Orange) types a chat message containing -weather as A substring
      • Player - Player 7 (Green) types a chat message containing -weather as A substring
      • Player - Player 8 (Pink) types a chat message containing -weather as A substring
      • Player - Player 9 (Gray) types a chat message containing -weather as A substring
      • Player - Player 10 (Light Blue) types a chat message containing -weather as A substring
      • Player - Player 11 (Dark Green) types a chat message containing -weather as A substring
      • Player - Player 12 (Brown) types a chat message containing -weather as A substring
    • Conditions
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • String_WeatherEffect Equal to (==) -rain
        • Then - Actions
          • Environment - Create at (Playable map area) the weather effect Ashenvale Rain (Heavy)
          • Set WeatherEffect[1] = (Last created weather effect)
          • Environment - Turn WeatherEffect[1] On
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • String_WeatherEffect Equal to (==) -unrain
              • Then - Actions
                • Environment - Turn WeatherEffect[1] Off
                • Environment - Remove WeatherEffect[1]
              • Else - Actions
        • Else - Actions
      • -------- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// --------
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • String_WeatherEffect Equal to (==) -snow
          • Then - Actions
            • Environment - Create at (Playable map area) the weather effect Northrend Snow (Heavy)
            • Set WeatherEffect[2] = (Last created weather effect)
            • Environment - Turn WeatherEffect[2] On
              • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • String_WeatherEffect Equal to (==) -unsnow
                • Then - Actions
                  • Environment - Turn WeatherEffect[2] Off
                  • Environment - Remove WeatherEffect[2]
                • Else - Actions
          • Else - Actions
 

Wrda

Spell Reviewer
Level 26
Joined
Nov 18, 2012
Messages
1,888
"String_WeatherEffect" is never set, nor it is needed anyway using your approach, I made a correct "model trigger" so you can check why mine works and yours not.
  • Weather Effect
    • Events
      • Player - Player 1 (Red) types a chat message containing -weather as A substring
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Substring((Entered chat string), 10, (Length of (Entered chat string)))) Equal to -rain
        • Then - Actions
          • -------- do actions --------
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Substring((Entered chat string), 10, (Length of (Entered chat string)))) Equal to -unrain
            • Then - Actions
              • -------- do actions --------
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Substring((Entered chat string), 10, (Length of (Entered chat string)))) Equal to -snow
                • Then - Actions
                  • -------- do actions --------
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Substring((Entered chat string), 10, (Length of (Entered chat string)))) Equal to -unsnow
                    • Then - Actions
                      • -------- do actions --------
                    • Else - Actions
In yours, you have a condition "if string = -rain then", notice the next condition "if string = -unrain then" will NEVER be true because even if you typed "-unrain" it wouldn't pass the first condition, so you have to put that condition in the else part.
 

Wrda

Spell Reviewer
Level 26
Joined
Nov 18, 2012
Messages
1,888
I don't know anymore. If you want people to type something like -weather rain or unrain or whatever then use
  • Player - Player 1 (Red) types a chat message containing -weather as A substring
  • (Substring((Entered chat string), 10, (Length of (Entered chat string)))) Equal to rain
if you want -rain or -unrain or whatever INSTEAD, then use
  • Player - Player 1 (Red) types a chat message containing - as A substring
  • (Substring((Entered chat string), 1, (Length of (Entered chat string)))) Equal to -rain
Then you follow that logic for other conditions and should be
  • Weather Effect
    • Events
      • Player - Player 1 (Red) types a chat message containing - as A substring
      • Player - Player 2 (Blue) types a chat message containing - as A substring
      • Player - Player 3 (Teal) types a chat message containing - as A substring
      • Player - Player 4 (Purple) types a chat message containing - as A substring
      • Player - Player 5 (Yellow) types a chat message containing - as A substring
      • Player - Player 6 (Orange) types a chat message containing - as A substring
      • Player - Player 7 (Green) types a chat message containing - as A substring
      • Player - Player 8 (Pink) types a chat message containing - as A substring
      • Player - Player 9 (Gray) types a chat message containing - as A substring
      • Player - Player 10 (Light Blue) types a chat message containing - as A substring
      • Player - Player 11 (Dark Green) types a chat message containing - as A substring
      • Player - Player 12 (Brown) types a chat message containing - as A substring
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Substring((Entered chat string), 1, (Length of (Entered chat string)))) Equal to -rain
        • Then - Actions
          • Environment - Create at (Playable map area) the weather effect Ashenvale Rain (Heavy)
          • Set WeatherEffect[1] = (Last created weather effect)
          • Environment - Turn WeatherEffect[1] On
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Substring((Entered chat string), 1, (Length of (Entered chat string)))) Equal to -unrain
            • Then - Actions
              • Environment - Turn WeatherEffect[1] Off
              • Environment - Remove WeatherEffect[1]
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Substring((Entered chat string), 1, (Length of (Entered chat string)))) Equal to -snow
                • Then - Actions
                  • Environment - Create at (Playable map area) the weather effect Northrend Snow (Heavy)
                  • Set WeatherEffect[2] = (Last created weather effect)
                  • Environment - Turn WeatherEffect[1] On
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Substring((Entered chat string), 1, (Length of (Entered chat string)))) Equal to -unsnow
                    • Then - Actions
                      • Environment - Turn WeatherEffect[2] Off
                      • Environment - Remove WeatherEffect[2]
                    • Else - Actions
 
Status
Not open for further replies.
Top