• 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] how to remove this leak?

Status
Not open for further replies.
Level 4
Joined
Aug 3, 2011
Messages
222
There's a Effect Spamming...

  • Bloody Wolf skill 1
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Wolf Clap
    • Actions
      • For each (Integer A) from 1 to 360, do (Actions)
        • Loop - Actions
          • Set Wolf_Clap[(Integer A)] = ((Position of (Triggering unit)) offset by 150.00 towards (Real((Integer A))) degrees)
      • For each (Integer B) from 1 to 360, do (Actions)
        • Loop - Actions
          • Special Effect - Create a special effect at Wolf_Clap[(Integer B)] using Objects\Spawnmodels\Human\HumanLargeDeathExplode\HumanLargeDeathExplode.mdl
          • Special Effect - Destroy (Last created special effect)
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
1) You're not fixing all location leaks (you're creating 360 of them each time the ability is cast, as you do not remove "Position of (Triggering Unit)").
2) Do not use an array to fix this, you can all combine it into 1 loop.
3) Do not loop to 360. That's an overabundance of effects.

  • Actions
    • Set tempLoc1 = (Position of (Triggering unit))
    • For each (Integer A) from 1 to 12, do (Actions)
      • Loop - Actions
        • Set tempLoc2 = (tempLoc1 offset by 150.00 towards (30.00 x (Real((Integer A)))) degrees)
        • Special Effect - Create a special effect at tempLoc2 using Objects\Spawnmodels\Human\HumanLargeDeathExplode\HumanLargeDeathExplode.mdl
        • Special Effect - Destroy (Last created special effect)
        • Custom script: call RemoveLocation( udg_tempLoc2 )
    • Custom script: call RemoveLocation( udg_tempLoc1 )
This fixes the leaks + shows a reasonable amount of effects (12 instead of 360).
 
Status
Not open for further replies.
Top