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

GUI Loop problem

Status
Not open for further replies.
Level 10
Joined
Apr 13, 2005
Messages
630
So i have this ability.. Works great but for some reason it wont shut off. Im using the indexing system to loop it for MUI.

  • TW loop Copy
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer TW_index3) from 1 to TW_index_size, do (Actions)
        • Loop - Actions
          • Set TW_index2 = TW_index1[TW_index3]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (TW_targetrect[TW_index2] contains TW_dummy[TW_index2]) Equal to False
            • Then - Actions
              • Game - Display to (All players) the text: error 2
              • -------- ----- storing the position of the wave to move the wave later ------ --------
              • Set TW_dummypoint = (Position of TW_dummy[TW_index2])
              • -------- ----- set the offset point by using the current wave's position to make the wave move ----- --------
              • Set TW_offsetpoint = (TW_dummypoint offset by 15.00 towards TW_facing[TW_index2] degrees)
              • -------- ----- move the wave ----- --------
              • Unit - Move TW_dummy[TW_index2] instantly to TW_offsetpoint
              • -------- ----- picking all the enemies around the wave ----- --------
              • Custom script: set bj_wantDestroyGroup = true
              • -------- ----- note that the following trigger runs to each unit, one-by-one in a very quick time, instead of all together ----- --------
              • -------- ----- thus, it cause the "damage reduction trigger" to runs to each unit one-by-one, causing the damage to reduce each time it meets a new enemy --------
              • Unit Group - Pick every unit in (Units within 240.00 of TW_offsetpoint matching (((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Mechanical) Equal to False) and (((Matching unit) is Magic Immune) Equal to False))) and ((((Matching unit) is alive) Equal to True) and do (Actions)
                • Loop - Actions
                  • -------- ----- storing all the picked enemies into variable ----- --------
                  • Set TW_pickedunit = (Picked unit)
                  • -------- ----- storing the position of all the picked enemies to knockback/drag the enemies and create the effects ----- --------
                  • Set TW_picked_point = (Position of TW_pickedunit)
                  • -------- ----- set the damage ----- --------
                  • -------- ----- reduce the damage each time the wave meets a new enemy ----- --------
                  • -------- ----- also check whether the damage above 50% ----- --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • TW_damage[TW_index2] Greater than TW_damagecheck[TW_index2]
                    • Then - Actions
                      • Set TW_damage[TW_index2] = (TW_damage[TW_index2] - TW_damagereduced[TW_index2])
                      • Set TW_damagereduced[TW_index2] = (TW_damage[TW_index2] / 20.00)
                    • Else - Actions
                  • -------- ----- set the speed to decrease each time the wave meets an enemy ----- --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • TW_dragspeed[TW_index2] Greater than 1.00
                    • Then - Actions
                      • Set TW_dragspeed[TW_index2] = (TW_dragspeed[TW_index2] - 0.15)
                    • Else - Actions
                  • -------- ----- set the offset point to move the enemies so that it looks like the wave drag along the enemies ----- --------
                  • Set TW_picked_offsetpoint = (TW_picked_point offset by TW_dragspeed[TW_index2] towards TW_facing[TW_index2] degrees)
                  • -------- ----- move the enemies ----- --------
                  • Unit - Move TW_pickedunit instantly to TW_picked_offsetpoint
                  • -------- ----- create some effects on the knockback/drag ----- --------
                  • Special Effect - Create a special effect at TW_picked_point using Abilities\Spells\Human\FlakCannons\FlakTarget.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • -------- ----- check whether the enemy is in DT_hitgroup so that the wave damages only once ----- --------
                  • -------- ----- enemies that has been hit by the wave will be added to the unit group ----- --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (TW_pickedunit is in TW_hitgroup[TW_index2]) Equal to False
                    • Then - Actions
                      • Unit - Cause TW_caster[TW_index2] to damage TW_pickedunit, dealing TW_damage[TW_index2] damage of attack type Spells and damage type Normal
                      • Unit Group - Add TW_pickedunit to TW_hitgroup[TW_index2]
                    • Else - Actions
                  • -------- ----- clearing leaks ----- --------
                  • Custom script: call RemoveLocation (udg_TW_picked_offsetpoint)
                  • Custom script: call RemoveLocation (udg_TW_picked_point)
              • -------- ----- clearing leaks ----- --------
              • Custom script: call RemoveLocation (udg_TW_offsetpoint)
              • Custom script: call RemoveLocation (udg_TW_dummypoint)
            • Else - Actions
              • -------- ----- kill the wave as soon as the wave reaches the target point ----- --------
              • Unit - Explode TW_dummy[TW_index2]
              • -------- ----- clearing leaks ----- --------
              • Custom script: call RemoveRect (udg_TW_targetrect[udg_TW_index2])
              • Custom script: call DestroyGroup (udg_TW_hitgroup[udg_TW_index2])
              • -------- ======================================================== --------
              • Set TW_index1[TW_index3] = TW_index1[TW_index_size]
              • Set TW_index1[TW_index_size] = TW_index2
              • Set TW_index_size = (TW_index_size - 1)
              • Set TW_index3 = (TW_index3 - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • TW_index_size Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
 
Last edited by a moderator:
Status
Not open for further replies.
Top