• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[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