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

frost cast trigger

Status
Not open for further replies.
Level 26
Joined
Dec 3, 2018
Messages
873
  • Event: Wait 1200 seconds
  • Action: Set Obeliscfrost = (Random integer number between 1 and 7)
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Obeliscfrost Equal to 1
    • Then - Actions
      • Unit - Order Obelisc 0091 <gen> to Human Archmage - Blizzard (Center of P1 Base <gen>)
      • Environment - Change terrain type at (Center of P1 Base <gen>) to Icecrown Glacier - Snow using variation -1 in an area of size 20 and shape Circle
    • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Obeliscfrost Equal to 2
        • Then - Actions
          • Unit - Order Obelisc 0091 <gen> to Human Archmage - Blizzard (Center of P2 Arrival <gen>)
          • Environment - Change terrain type at (Center of P2 Arrival <gen>) to Icecrown Glacier - Snow using variation -1 in an area of size 20 and shape Circle
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Obeliscfrost Equal to 3
            • Then - Actions
              • Unit - Order Obelisc 0091 <gen> to Human Archmage - Blizzard (Center of P3 Arrival <gen>)
              • Environment - Change terrain type at (Center of P3 Arrival <gen>) to Icecrown Glacier - Snow using variation -1 in an area of size 20 and shape Circle
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Obeliscfrost Equal to 4
                • Then - Actions
                  • Unit - Order Obelisc 0091 <gen> to Human Archmage - Blizzard (Center of P4 Arrival <gen>)
                  • Environment - Change terrain type at (Center of P4 Arrival <gen>) to Icecrown Glacier - Snow using variation -1 in an area of size 20 and shape Circle
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Obeliscfrost Equal to 5
                    • Then - Actions
                      • Unit - Order Obelisc 0091 <gen> to Human Archmage - Blizzard (Center of P5 Arrival <gen>)
                      • Environment - Change terrain type at (Center of P5 Arrival <gen>) to Icecrown Glacier - Snow using variation -1 in an area of size 20 and shape Circle
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Obeliscfrost Equal to 6
                        • Then - Actions
                          • Unit - Order Obelisc 0091 <gen> to Human Archmage - Blizzard (Center of P6 Arrival <gen>)
                          • Environment - Change terrain type at (Center of P6 Arrival <gen>) to Icecrown Glacier - Snow using variation -1 in an area of size 20 and shape Circle
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • Obeliscfrost Equal to 7
                            • Then - Actions
                              • Unit - Order Obelisc 0091 <gen> to Human Archmage - Blizzard (Center of P7 Arrival <gen>)
                              • Environment - Change terrain type at (Center of P7 Arrival <gen>) to Icecrown Glacier - Snow using variation -1 in an area of size 20 and shape Circle
                            • Else - Actions
                              • Unit - Order Obelisc 0091 <gen> to Human Archmage - Blizzard (Center of P6 Arrival <gen>)
                              • Environment - Change terrain type at (Center of P6 Arrival <gen>) to Icecrown Glacier - Snow using variation -1 in an area of size 20 and shape Circle

Why doesn't it work ?? PLEASE HELP ME!
 
Last edited:
Level 8
Joined
May 21, 2019
Messages
435
  • Event: Wait 1200 seconds
  • Action: Set Obeliscfrost = (Random integer number between 1 and 7)
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Obeliscfrost Equal to 1
    • Then - Actions
      • Unit - Order Obelisc 0091 <gen> to Human Archmage - Blizzard (Center of P1 Base <gen>)
      • Environment - Change terrain type at (Center of P1 Base <gen>) to Icecrown Glacier - Snow using variation -1 in an area of size 20 and shape Circle
    • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Obeliscfrost Equal to 2
        • Then - Actions
          • Unit - Order Obelisc 0091 <gen> to Human Archmage - Blizzard (Center of P2 Arrival <gen>)
          • Environment - Change terrain type at (Center of P2 Arrival <gen>) to Icecrown Glacier - Snow using variation -1 in an area of size 20 and shape Circle
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Obeliscfrost Equal to 3
            • Then - Actions
              • Unit - Order Obelisc 0091 <gen> to Human Archmage - Blizzard (Center of P3 Arrival <gen>)
              • Environment - Change terrain type at (Center of P3 Arrival <gen>) to Icecrown Glacier - Snow using variation -1 in an area of size 20 and shape Circle
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Obeliscfrost Equal to 4
                • Then - Actions
                  • Unit - Order Obelisc 0091 <gen> to Human Archmage - Blizzard (Center of P4 Arrival <gen>)
                  • Environment - Change terrain type at (Center of P4 Arrival <gen>) to Icecrown Glacier - Snow using variation -1 in an area of size 20 and shape Circle
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Obeliscfrost Equal to 5
                    • Then - Actions
                      • Unit - Order Obelisc 0091 <gen> to Human Archmage - Blizzard (Center of P5 Arrival <gen>)
                      • Environment - Change terrain type at (Center of P5 Arrival <gen>) to Icecrown Glacier - Snow using variation -1 in an area of size 20 and shape Circle
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Obeliscfrost Equal to 6
                        • Then - Actions
                          • Unit - Order Obelisc 0091 <gen> to Human Archmage - Blizzard (Center of P6 Arrival <gen>)
                          • Environment - Change terrain type at (Center of P6 Arrival <gen>) to Icecrown Glacier - Snow using variation -1 in an area of size 20 and shape Circle
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • Obeliscfrost Equal to 7
                            • Then - Actions
                              • Unit - Order Obelisc 0091 <gen> to Human Archmage - Blizzard (Center of P7 Arrival <gen>)
                              • Environment - Change terrain type at (Center of P7 Arrival <gen>) to Icecrown Glacier - Snow using variation -1 in an area of size 20 and shape Circle
                            • Else - Actions
                              • Unit - Order Obelisc 0091 <gen> to Human Archmage - Blizzard (Center of P6 Arrival <gen>)
                              • Environment - Change terrain type at (Center of P6 Arrival <gen>) to Icecrown Glacier - Snow using variation -1 in an area of size 20 and shape Circle

Why doesn't it work ?? PLEASE HELP ME!

I don't see why it wouldn't work. On a side note, this is far clunkier than it needs to be, and leaks points. One thing you could do, is put the 7 points into an array in a separate trigger, and then just have the 2 actions point towards the array. The whole trigger could essentially boil down to this:

  • Event: Wait 1200 seconds
  • Action: Set Obeliscfrost = (Random integer number between 1 and 7)
  • Unit - Order Obelisc 0091 <gen> to Human Archmage - Blizzard (Point[Obeliscfrost])
  • Environment - Change terrain type at (Point[Obeliscfrost]) to Icecrown Glacier - Snow using variation -1 in an area of size 20 and shape Circle
The trigger may be easier to bugfix if you boil it down to this simpler format, there's just less code to read, and maintaining/changing it will be much faster and easier. It also fixes your memory leak issue, as the points are saved statically in the game's memory. Sure, this takes up a tiny chunk of memory, but it doesn't leak more than needed, and saves a bit of computation in return.
 
Status
Not open for further replies.
Top