• 🏆 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] Where is the leaking in this trigger? :O

Status
Not open for further replies.
Level 18
Joined
Mar 13, 2009
Messages
1,411
I was working on a spell using this trigger:
  • Static
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Static
    • Actions
      • Set TempLoc = (Position of (Target unit of ability being cast))
      • Set TempGroup = (Units within ((200.00 + 100.00) x (Real((Level of Static for (Triggering unit))))) of TempLoc)
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Unit - Create 1 Dummy Unit for (Owner of (Triggering unit)) at TempLoc facing Default building facing degrees
          • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) belongs to an ally of (Owner of (Triggering unit))) Equal to True
            • Then - Actions
              • Unit - Add Static (Heal) to (Last created unit)
              • Unit - Set level of Static (Heal) for (Last created unit) to (Level of Static for (Triggering unit))
              • Unit - Order (Last created unit) to Orc Shadow Hunter - Healing Wave (Picked unit)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True
                • Then - Actions
                  • Unit - Add Static (Damage) to (Last created unit)
                  • Unit - Set level of Static (Damage) for (Last created unit) to (Level of Static for (Triggering unit))
                  • Unit - Order (Last created unit) to Orc Far Seer - Chain Lightning (Picked unit)
                • Else - Actions
      • Custom script: call RemoveLocation(udg_TempLoc)
      • Custom script: call DestroyGroup (udg_TempGroup)
The added spells are based on Healing Wave and Chain Lightning, but hit only 1 unit each. The base spell is based off Storm Bolt and gives the target unit a 3 seconds stun.

When I use this spell a few times it gets extremely laggy, but I can't see where it would create the lag. :confused:
 
Level 18
Joined
Mar 13, 2009
Messages
1,411
Ye, it looked like it was leakless to me, but still (especially when using the spell or link a few times on the same unit) I get a lot of lag when using it on bigger groups multiple times, not when I use it only once.
 
i think the "Units within ((xxx)) x (xxx) of TempLoc"
might leak.

you might want to set it in a separate variable, then set the units within that variable.

yeah do that, also put everything into variables, each integer/real/(Owner of (Triggering unit)/Abilities..., well not all but as much as you can, it makes the whole thing much faster.

But it isn't leaking. ;D
 
Level 18
Joined
Mar 13, 2009
Messages
1,411
Is it some leak we don't know of? Like a chain effect leak? :O

Edit: Even after changing everything into variables the lag created is HUGE. I have seen spells with an enormous amounts of leaks lag a lot less and I had to restart my pc after casting this spell 5 times, since it crashed.
 
Status
Not open for further replies.
Top