Does this leak?

Knocksious

Sweet, I got 2 little green bars!
Reaction score
46
Could someone please tell me if this type of setup is going to leak on me?

Code:
Bloody Spear 1
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to The Bloody Spear 
    Actions
        Unit Group - Add (Target unit of ability being cast) to Bloody_Spear_Group

Code:
Bloody Spear 2
    Events
        Time - Every 3.00 seconds of game time
    Conditions
    Actions
        Custom script:   local location Target
        Unit Group - Pick every unit in Bloody_Spear_Group and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked unit) has buff Bloody Spear ) Equal to True
                    Then - Actions
                        Unit - Cause The Castle Redemption 0131 <gen> to damage (Picked unit), dealing 50.00 damage of attack type Spells and damage type Normal
                        Set Target = (Position of (Picked unit))
                        Special Effect - Create a special effect at Target using Objects\Spawnmodels\Human\HumanBlood\HeroBloodElfBlood.mdl
                    Else - Actions
        Custom script:   call RemoveLocation (Target)
 
T

tuck

Guest
I'm not very good with leaks, although I do know that you'll need to destroy the special effect you're using.
 

Rheias

New Helper (I got over 2000 posts)
Reaction score
232
> Custom script: local location Target

What? Why do you need that? And you got it wrong, it needs to be:

Custom script: local location udg_Target

Also you never set udg_Target to anything...

You got there a unit group leak, but nothing major, and maybe some effects leaks there.
 

Doomhammer

Bob Kotick - Gamers' corporate spoilsport No. 1
Reaction score
67
way1)
add another
Code:
  Custom script:   set Target=null

and replace this action:

Special Effect - Create a special effect at Target using Objects\Spawnmodels\Human\HumanBlood\HeroBloodElfBlood.mdl

with
Code:
  Custom script:   call DestroyEffect(AddSpecialEffectLoc("Objects\\Spawnmodels\\Human\\HumanBlood\\HeroBloodElfBlood.mdl",Target)

way2)
the ideal solution with GUI: scrap the target location unless you need it for other things, and attach the effect directly to the targeted unit, e.g. to its chest:

Code:
  Custom script:   call DestroyEffect(AddSpecialEffectTarget("Objects\\Spawnmodels\\Human\\HumanBlood\\HeroBloodElfBlood.mdl",GetEnumUnit(),"chest"))

won't leak anymore ;)
 

Knocksious

Sweet, I got 2 little green bars!
Reaction score
46
Rheias; said:
> Custom script: local location Target

What? Why do you need that? And you got it wrong, it needs to be:

Custom script: local location udg_Target

Because I like using locals as opposed to a billion arrays
and that isn't wrong, I don't think, because it isn't a "udg" it's a local
 

Rheias

New Helper (I got over 2000 posts)
Reaction score
232
> and that isn't wrong, I don't think, because it isn't a "udg" it's a local

But you never refer to that local...

> Doomhammer (way1)

Well he never sets Target to nothing in his trigger, so it is a null already.

As for the effect line, this will work only if the effect has a birth animation.
 

Knocksious

Sweet, I got 2 little green bars!
Reaction score
46
>But you never refer to that local...

:eek: really? setting it (set Target = x) doesn't refer to the local?

I may have some reprogramming to do

how do you set a local then? via custom script?
 

Doomhammer

Bob Kotick - Gamers' corporate spoilsport No. 1
Reaction score
67
> Well he never sets Target to nothing in his trigger, so it is a null already.

hmm, I was wondering what this line was doing...

Set Target = (Position of (Picked unit))

> As for the effect line, this will work only if the effect has a birth animation.

Good you mention it. I did a check before pasting my solution. In this case it has.

Edit:
Knocksious, it's fine the way you're doing it. Thing is, that the blood effect will be placed to that target location. So if the unit moves around, you got the floor at the target location shoot out blood spills, whereas the unit walks around just as it is. Hence I recommend to attach the effect to the unit, as suggested in way2)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top