• 🏆 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] Integer loop problem

Status
Not open for further replies.
Level 6
Joined
May 31, 2008
Messages
218
I solved the inital problem but now i got another one, all the regions get weather except the first one. I post the changed triggers aswell.
(I have never ever used integer loop stuff, and maybe i shouldn't have from the beginning xD
  • Imperial Land
    • Events
    • Time - Every 10.00 seconds of game time
    • Time - Elapsed game time is 2.00 seconds
    • Conditions
    • Actions
      • Set weather_rects[0] = Imperial Land <gen>
      • Set weather_rects[1] = Imperial Land2 <gen>
      • Set weather_rects[2] = Imperial Land3 <gen>
      • Set weather_rects[3] = Imperial Land4 <gen>
      • Set weather_rects[4] = Imperial Land5 <gen>
      • Set weather_rects[5] = Imperial Land6 <gen>
      • Set weather_rects[6] = Imperial Land7 <gen>
      • Set weather_rects[7] = Imperial Land8 <gen>
      • Set weather_rects[8] = Imperial Land9 <gen>
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Random integer number between 1 and 20) Equal to (==) 10
          • Then - Actions
            • Multiboard - Set the text for Weather_multiboard item in column 3, row 2 to Heavy Rain
            • Multiboard - Set the icon for Weather_multiboard item in column 3, row 2 to ReplaceableTextures\CommandButtons\BTNBlizzard.blp
              • Do Multiple ActionsFor each (Integer A) from 0 to 8, do (Actions)
                • Loop - Actions
                  • Environment - Remove weather[(Integer A)]
              • Do Multiple ActionsFor each (Integer A) from 0 to 8, do (Actions)
                • Loop - Actions
                  • Environment - Create at weather_rects[(Integer A)] the weather effect Lordaeron Rain (Heavy)
                  • Set weather[(Integer A)] = (Last created weather effect)
          • Else - Actions
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Random integer number between 1 and 14) Equal to (==) 7
              • Then - Actions
                • Multiboard - Set the text for Weather_multiboard item in column 3, row 2 to Heavy Wind
                • Multiboard - Set the icon for Weather_multiboard item in column 3, row 2 to ReplaceableTextures\CommandButtons\BTNTornado.blp
                  • Do Multiple ActionsFor each (Integer A) from 0 to 8, do (Actions)
                    • Loop - Actions
                      • Environment - Remove weather[(Integer A)]
                  • Do Multiple ActionsFor each (Integer A) from 0 to 8, do (Actions)
                    • Loop - Actions
                      • Environment - Create at weather_rects[(Integer A)] the weather effect Wind (Heavy)
                      • Set weather[(Integer A)] = (Last created weather effect)
              • Else - Actions
                • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (Random integer number between 1 and 8) Equal to (==) 4
                  • Then - Actions
                    • Multiboard - Set the text for Weather_multiboard item in column 3, row 2 to Light Rain
                    • Multiboard - Set the icon for Weather_multiboard item in column 3, row 2 to ReplaceableTextures\CommandButtons\BTNTranquility.blp
                      • Do Multiple ActionsFor each (Integer A) from 0 to 8, do (Actions)
                        • Loop - Actions
                          • Environment - Remove weather[(Integer A)]
                      • Do Multiple ActionsFor each (Integer A) from 0 to 8, do (Actions)
                        • Loop - Actions
                          • Environment - Create at weather_rects[(Integer A)] the weather effect Lordaeron Rain (Light)
                          • Set weather[(Integer A)] = (Last created weather effect)
                  • Else - Actions
                    • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • (Random integer number between 1 and 4) Equal to (==) 2
                      • Then - Actions
                        • Multiboard - Set the text for Weather_multiboard item in column 3, row 2 to Light Wind
                        • Multiboard - Set the icon for Weather_multiboard item in column 3, row 2 to ReplaceableTextures\CommandButtons\BTNCyclone.blp
                          • Do Multiple ActionsFor each (Integer A) from 0 to 8, do (Actions)
                            • Loop - Actions
                              • Environment - Remove weather[(Integer A)]
                          • Do Multiple ActionsFor each (Integer A) from 0 to 8, do (Actions)
                            • Loop - Actions
                              • Environment - Create at weather_rects[(Integer A)] the weather effect Outland Wind (Light)
                              • Set weather[(Integer A)] = (Last created weather effect)
                      • Else - Actions
                        • Multiboard - Set the text for Weather_multiboard item in column 3, row 2 to Sunny
                        • Multiboard - Set the icon for Weather_multiboard item in column 3, row 2 to ReplaceableTextures\CommandButtons\BTNFarSight.blp
                          • Do Multiple ActionsFor each (Integer A) from 0 to 8, do (Actions)
                            • Loop - Actions
                              • Environment - Remove weather[(Integer A)]
      • Trigger - Run Northern Forest <gen> (checking conditions)
  • Northern Forest
    • Events
    • Conditions
    • Actions
      • Set weather_rects[9] = Northern Forest <gen>
      • Set weather_rects[10] = Northern Forest2 <gen>
      • Set weather_rects[11] = Northern Forest3 <gen>
      • Set weather_rects[12] = Northern Forest4 <gen>
      • Set weather_rects[13] = Northern Forest5 <gen>
      • Set weather_rects[14] = Northern Forest6 <gen>
      • Set weather_rects[15] = Northern Forest7 <gen>
      • Set weather_rects[16] = Northern Forest8 <gen>
      • Set weather_rects[17] = Northern Forest9 <gen>
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Random integer number between 1 and 20) Equal to (==) 10
          • Then - Actions
            • Multiboard - Set the text for Weather_multiboard item in column 3, row 5 to Heavy Wind
            • Multiboard - Set the icon for Weather_multiboard item in column 3, row 5 to ReplaceableTextures\CommandButtons\BTNTornado.blp
              • Do Multiple ActionsFor each (Integer A) from 9 to 17, do (Actions)
                • Loop - Actions
                  • Environment - Remove weather[(Integer A)]
              • Do Multiple ActionsFor each (Integer A) from 9 to 17, do (Actions)
                • Loop - Actions
                  • Environment - Create at weather_rects[(Integer A)] the weather effect Wind (Heavy)
                  • Set weather[(Integer A)] = (Last created weather effect)
          • Else - Actions
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Random integer number between 1 and 12) Equal to (==) 6
              • Then - Actions
                • Multiboard - Set the text for Weather_multiboard item in column 3, row 5 to Heavy Rain
                • Multiboard - Set the icon for Weather_multiboard item in column 3, row 5 to ReplaceableTextures\CommandButtons\BTNBlizzard.blp
                  • Do Multiple ActionsFor each (Integer A) from 9 to 17, do (Actions)
                    • Loop - Actions
                      • Environment - Remove weather[(Integer A)]
                  • Do Multiple ActionsFor each (Integer A) from 9 to 17, do (Actions)
                    • Loop - Actions
                      • Environment - Create at weather_rects[(Integer A)] the weather effect Lordaeron Rain (Heavy)
                      • Set weather[(Integer A)] = (Last created weather effect)
              • Else - Actions
                • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (Random integer number between 1 and 10) Equal to (==) 5
                  • Then - Actions
                    • Multiboard - Set the text for Weather_multiboard item in column 3, row 5 to Light Wind
                    • Multiboard - Set the icon for Weather_multiboard item in column 3, row 5 to ReplaceableTextures\CommandButtons\BTNCyclone.blp
                      • Do Multiple ActionsFor each (Integer A) from 9 to 17, do (Actions)
                        • Loop - Actions
                          • Environment - Remove weather[(Integer A)]
                      • Do Multiple ActionsFor each (Integer A) from 9 to 17, do (Actions)
                        • Loop - Actions
                          • Environment - Create at weather_rects[(Integer A)] the weather effect Outland Wind (Light)
                          • Set weather[(Integer A)] = (Last created weather effect)
                  • Else - Actions
                    • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • (Random integer number between 1 and 3) Equal to (==) 2
                      • Then - Actions
                        • Multiboard - Set the text for Weather_multiboard item in column 3, row 5 to Light Rain
                        • Multiboard - Set the icon for Weather_multiboard item in column 3, row 5 to ReplaceableTextures\CommandButtons\BTNTranquility.blp
                          • Do Multiple ActionsFor each (Integer A) from 9 to 17, do (Actions)
                            • Loop - Actions
                              • Environment - Remove weather[(Integer A)]
                          • Do Multiple ActionsFor each (Integer A) from 9 to 17, do (Actions)
                            • Loop - Actions
                              • Environment - Create at weather_rects[(Integer A)] the weather effect Outland Wind (Light)
                              • Set weather[(Integer A)] = (Last created weather effect)
                      • Else - Actions
                        • Multiboard - Set the text for Weather_multiboard item in column 3, row 5 to Sunny
                        • Multiboard - Set the icon for Weather_multiboard item in column 3, row 5 to ReplaceableTextures\CommandButtons\BTNFarSight.blp
                          • Do Multiple ActionsFor each (Integer A) from 9 to 17, do (Actions)
                            • Loop - Actions
                              • Environment - Remove weather[(Integer A)]
        • Do Multiple ActionsFor each (Integer A) from 0 to 17, do (Actions)
          • Loop - Actions
            • Environment - Turn weather[(Integer A)] On
 
Last edited:
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • Else - Actions
    • Multiboard - Set the text for Weather_multiboard item in column 3, row 2 to Sunny
    • Multiboard - Set the icon for Weather_multiboard item in column 3, row 2 to ReplaceableTextures\CommandButtons\BTNFarSight.blp
      • Do Multiple ActionsFor each (Integer A) from 0 to 8, do (Actions)
        • Loop - Actions
          • Environment - Remove weather[(Integer A)]
          • Set weather[(Integer A)] = (Last created weather effect)
  • Trigger - Run Northern Forest <gen> (checking conditions)
In the last ELSE branch, you have not created a sunny weather, so it picks the weather type of whatever was created for the previous area. Could this be it?
 
Level 6
Joined
May 31, 2008
Messages
218
In the last ELSE branch, you have not created a sunny weather, so it picks the weather type of whatever was created for the previous area. Could this be it?
Doubt it, since there is no previous weather created, and only one weather can be created in the trigger.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
If the Imperial Land creates heavy rain, and then the Northern Forest goes to the last ELSE, it picks up heavy rain for those regions too. You can do someting like:

  • Environment - Create at weather_rects[(Integer A)] the weather effect Outland Wind (Light)
  • Set weather[(Integer A)] = (Last created weather effect)
  • Environment - Turn (Last created weather effect) Off
 
Level 6
Joined
May 31, 2008
Messages
218
Now the weather dissapear totally from the first regions, not all at once. Sometimes just 70% of the regions stop working but next time weather should change they stop working totally. I have no idea what so ever what the problem is.
 
Status
Not open for further replies.
Top