• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Loop Malfunction

Status
Not open for further replies.
Level 7
Joined
Apr 12, 2011
Messages
124
SOLVED

Ok, here's the deal.
I got a problem with my loop where the loop only preforms the first 11 actions and then ignores the rest.
I located the problem, though i have no idea WHY it causes this to happen.
Anyone know why? :vw_wtf:


(About the event it's a variable you set in another trigger, starting with 0.03 seconds of game time)


  • Hellfire Loop
    • Events
    • Conditions
    • Actions
      • Unit Group - Pick every unit in ER_LoopGroup and do (Actions)
        • Loop - Actions
          • Game - Display to (All players) the text: (Loop Count: + (String(ER_Index)))
          • Set ER_Caster = (Load 0 of (Key (Picked unit)) in ER_Hashtable)
          • Set ER_ActualArea = (Load 1 of (Key (Picked unit)) from ER_Hashtable)
          • Set ER_ActualDamage = (Load 2 of (Key (Picked unit)) from ER_Hashtable)
          • Set ER_ActualDuration = (Load 3 of (Key (Picked unit)) from ER_Hashtable)
          • Set ER_ActualProjectiles = (Load 6 of (Key (Picked unit)) from ER_Hashtable)
          • Set ER_Owner = (Load 4 of (Key (Picked unit)) in ER_Hashtable)
          • Set ER_Index = (Load 5 of (Key (Picked unit)) from ER_Hashtable)
          • Set ER_Real2 = (Load 7 of (Key (Picked unit)) from ER_Hashtable)
          • Set ER_Index = (ER_Index + 1)
          • Hashtable - Save ER_Index as 5 of (Key (Picked unit)) in ER_Hashtable
          • -------- This line right here cause the trigger to malfunction (DOWN) --------
          • -------- No idea why. --------
          • -------- ER_IndexMax is an Integer. --------
          • -------- ER_ActualDuration is an Integer. --------
          • -------- ER_LoopInterval is a real. --------
          • Set ER_IndexMax = (ER_ActualDuration / (Integer(ER_LoopIntervalReal)))
          • -------- This line right here cause the trigger to malfunction (UP) --------
          • Set ER_Point = (Position of ER_Caster)
          • Set ER_Real = 0.00
          • Set ER_Real2 = (ER_Real2 + ER_Speed)
          • Hashtable - Save ER_Real2 as 7 of (Key (Picked unit)) in ER_Hashtable
          • Special Effect - Create a special effect at ER_Point using Abilities\Spells\Demon\DarkPortal\DarkPortalTarget.mdl
          • Special Effect - Destroy (Last created special effect)
          • For each (Integer ER_Integer) from 1 to ER_ActualProjectiles, do (Actions)
            • Loop - Actions
              • Set ER_Point2 = (ER_Point offset by ER_Real2 towards ER_Real degrees)
              • Set ER_Real = (ER_Real + (360.00 / 15.00))
              • Special Effect - Create a special effect at ER_Point2 using Abilities\Spells\Other\Doom\DoomDeath.mdl
              • Special Effect - Destroy (Last created special effect)
              • Custom script: set bj_wantDestroyGroup = true
              • Unit Group - Pick every unit in (Units within 100.00 of ER_Point2 matching ((((Matching unit) is A flying unit) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an enemy of ER_Owner) Equ and do (Actions)
                • Loop - Actions
                  • Unit - Cause ER_Caster to damage (Picked unit), dealing (ER_ActualDamage / (Real(ER_IndexMax))) damage of attack type Spells and damage type Normal
              • Custom script: call RemoveLocation(udg_ER_Point2)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ER_Index Greater than or equal to ER_IndexMax
            • Then - Actions
              • Game - Display to (All players) the text: FUUUUUUUUUUUUUUUUUU...
              • Unit Group - Remove ER_Caster from ER_LoopGroup
              • Set ER_Index = 0
              • Set ER_Integer = 1
              • Set ER_Real = 0.00
              • Set ER_Real2 = 0.00
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ER_Real2 Greater than or equal to ER_ActualArea
            • Then - Actions
              • Game - Display to (All players) the text: FUUUUUUUUUUUUUUUUUU...
              • Set ER_Real2 = 0.00
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in ER_LoopGroup) Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
 
Last edited:
Status
Not open for further replies.
Top