Major Leak Problem!

IceWarrior98

New Member
Reaction score
12
Nevermind, the major lag caused by my ability was caused by the abilities duration being 6 seconds (which is why the lag always lasted a few seconds only) and by making it 0.01 (because I fear 0 will make it forever) I have fixed it and the spell no longer causes lag.

Me again, this time i'm having a problem with leaks. I've made my first custom trigger enhanced ability but i'm having a major leak problem and I can't seem to solve it. The Leak checker tells me to add this
Code:
Custom script:   call DestroyGroup (udg_AT)
but the editor wont allow the ability to stay enabled once that is added.

Here is the full trigger:

Code:
Arcane Divinity
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Arcane Divinity 
    Actions
        Special Effect - Create a special effect at (Target point of ability being cast) using Abilities\Spells\Other\Charm\CharmTarget.mdl
        Special Effect - Destroy (Last created special effect)
        Set ag[1] = (Units within 300.00 of (Target point of ability being cast) matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) is A ground unit) Equal to True)))
        Unit - Cause (Triggering unit) to damage circular area after 0.00 seconds of radius 300.00 at (Target point of ability being cast), dealing 100.00 damage of attack type Magic and damage type Death
        Unit Group - Pick every unit in ag[1] and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        And - All (Conditions) are true
                            Conditions
                                (Number of units in ag[1]) Less than or equal to 1
                    Then - Actions
                        Unit Group - Pick every unit in ag[1] and do (Actions)
                            Loop - Actions
                                Set AT = (Picked unit)
                                Set AL = (Position of AT)
                                Special Effect - Create a special effect at (Position of AT) using war3mapImported\doombolttarget.mdx
                                Special Effect - Destroy (Last created special effect)
                                Custom script:   call RemoveLocation (udg_AL)
                                Unit - Cause (Triggering unit) to damage AT, dealing (50.00 x (Real((Level of Arcane Divinity  for (Triggering unit))))) damage of attack type Magic and damage type Death
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                And - All (Conditions) are true
                                    Conditions
                                        (Number of units in ag[1]) Greater than or equal to 2
                            Then - Actions
                                Unit Group - Pick every unit in ag[1] and do (Actions)
                                    Loop - Actions
                                        Set AT = (Picked unit)
                                        Set AL = (Position of AT)
                                        Special Effect - Create a special effect at (Position of AT) using war3mapImported\doombolttarget.mdx
                                        Special Effect - Destroy (Last created special effect)
                                        Custom script:   call RemoveLocation (udg_AL)
                                        Unit - Cause (Triggering unit) to damage AT, dealing (50.00 x ((Real((Level of Arcane Divinity  for (Triggering unit)))) / (Real((Number of units in ag[1]))))) damage of attack type Magic and damage type Death
                            Else - Actions
                                Do nothing
        Custom script:   call DestroyGroup (udg_AT)

I'm certain that whatever is causing the problem is simple and only unseen to my blind eye but i'd appreaciate your help.

And I think i'll start tossing out +reps since so many people are helping me here.

EDIT: Also the lag only seems to come after the effects are destroyed (sometimes as they are being used) but usually after everything is done and the damage has been dealt and doesn't happen when I use it on a small group of units (say, 4 or less).

UPDATED CODE:
Code:
Arcane Divinity
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Arcane Divinity 
    Actions
        Set ep = (Target point of ability being cast)
        Special Effect - Create a special effect at ep using Abilities\Spells\Other\Charm\CharmTarget.mdl
        Special Effect - Destroy (Last created special effect)
        Set ag[1] = (Units within 300.00 of ep matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) is A ground unit) Equal to True)))
        Unit - Cause (Triggering unit) to damage circular area after 0.00 seconds of radius 300.00 at ep, dealing 100.00 damage of attack type Magic and damage type Fire
        Custom script:   call RemoveLocation (udg_ep)
        Unit Group - Pick every unit in ag[1] and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Number of units in ag[1]) Equal to 1
                    Then - Actions
                        Unit Group - Pick every unit in ag[1] and do (Actions)
                            Loop - Actions
                                Set AT = (Picked unit)
                                Custom script:   call DestroyGroup(udg_ag[1])
                                Special Effect - Create a special effect at (Position of AT) using war3mapImported\doombolttarget.mdx
                                Special Effect - Destroy (Last created special effect)
                                Unit - Cause (Triggering unit) to damage AT, dealing (50.00 x (Real((Level of Arcane Divinity  for (Triggering unit))))) damage of attack type Magic and damage type Fire
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Number of units in ag[1]) Greater than or equal to 2
                            Then - Actions
                                Unit Group - Pick every unit in ag[1] and do (Actions)
                                    Loop - Actions
                                        Set AT = (Picked unit)
                                        Custom script:   call DestroyGroup(udg_ag[1])
                                        Special Effect - Create a special effect at (Position of AT) using war3mapImported\doombolttarget.mdx
                                        Special Effect - Destroy (Last created special effect)
                                        Unit - Cause (Triggering unit) to damage AT, dealing (50.00 x ((Real((Level of Arcane Divinity  for (Triggering unit)))) / (Real((Number of units in ag[1]))))) damage of attack type Magic and damage type Fire
                            Else - Actions
 
Code:
Arcane Divinity
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Arcane Divinity 
    Actions
        Special Effect - Create a special effect at [COLOR="Red"](Target point of ability being cast)[/COLOR] using Abilities\Spells\Other\Charm\CharmTarget.mdl
        Special Effect - Destroy (Last created special effect)
        Set ag[1] = (Units within 300.00 of [COLOR="#ff0000"](Target point of ability being cast)[/COLOR] matching [COLOR="DarkOrange"]((((Matching unit) is alive) Equal to True)[/COLOR] and [COLOR="#ff8c00"](((Matching unit) is A ground unit) Equal to True)))[/COLOR]
        Unit - Cause (Triggering unit) to damage circular area after 0.00 seconds of radius 300.00 at [COLOR="Red"](Target point of ability being cast)[/COLOR], dealing 100.00 damage of attack type Magic and damage type Death
        Unit Group - Pick every unit in ag[1] and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        And - All (Conditions) are true
                            Conditions
                                (Number of units in ag[1]) Less than or equal to 1
                    Then - Actions
                        Unit Group - Pick every unit in ag[1] and do (Actions)
                            Loop - Actions
                                Set AT = (Picked unit)
                                Set AL = (Position of AT)
                                Special Effect - Create a special effect at [COLOR="#ff0000"](Position of AT)[/COLOR] using war3mapImported\doombolttarget.mdx
                                Special Effect - Destroy (Last created special effect)
                                Custom script:   call RemoveLocation (udg_AL)
                                Unit - Cause (Triggering unit) to damage AT, dealing (50.00 x (Real((Level of Arcane Divinity  for (Triggering unit))))) damage of attack type Magic and damage type Death
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                And - All (Conditions) are true
                                    Conditions
                                        (Number of units in ag[1]) Greater than or equal to 2
                            Then - Actions
                                Unit Group - Pick every unit in ag[1] and do (Actions)
                                    Loop - Actions
                                        Set AT = (Picked unit)
                                        Set AL = (Position of AT)
                                        Special Effect - Create a special effect at [COLOR="#ff0000"](Position of AT)[/COLOR] using war3mapImported\doombolttarget.mdx
                                        Special Effect - Destroy (Last created special effect)
                                        Custom script:   call RemoveLocation (udg_AL)
                                        Unit - Cause (Triggering unit) to damage AT, dealing (50.00 x ((Real((Level of Arcane Divinity  for (Triggering unit)))) / (Real((Number of units in ag[1]))))) damage of attack type Magic and damage type Death
                            Else - Actions
                                Do nothing
        Custom script:   call DestroyGroup (udg_AT)

The red ones are leaks, the orange ones MIGHT be leaks, but only if I remember correctly.
 
For your special effect and damage, you need to set that point as a variable, use that variable for the special effect location and damage, then destroy it.
Code:
Actions
        Set Point = (Target point of ability being cast)
        Special Effect - Create a special effect at (Point) using Abilities\Spells\Other\Charm\CharmTarget.mdl
        Special Effect - Destroy (Last created special effect)
        Unit - Cause (Triggering unit) to damage circular area after 0.00 seconds of radius 300.00 at (Point), dealing 100.00 damage of attack type Magic and damage type Death
        Custom script: call RemoveLocation(udg_Point)
Where is says "Special Effect - Create a special effect at (Position of AT) using war3mapImported\doombolttarget.mdx" you might want to use the same concept making a point variable, using it for your special effect, then destroying it as shown above.

I think the reason that your DestroyGroup custom script isn't working is because of the space. just do Custom script: call DestroyGroup(udg_AT). But the space could not be relevant. It could be since you have so many loops that it is going to the DestroyGroup before it is finished with the group disabling the spell. If that is the case, you could add the custom script right after "If (All Conditions are True) then do (Then Actions) else do (Else Actions)" in your first loop.

That may, however, not even be possible though. Just throwing out suggestions.

Also, adding Custom scrpt: call DestroyGroup(udg_ag[1]) at the end couldn't hurt either.

For what Geelottaja said, the first and third red he pointed out are leaks like stated, but the second is being put into a variable so does not cause a leak to the best of my knowledge. Hope that helps!
 
in each loop you should add a call removelocation at the end of the loop if you use it, not only at the end of the trigger



Set AT = (Picked unit)
Set AL = (Position of AT)
Special Effect - Create a special effect at (Position of AT)(why not at AL using war3mapImported\doombolttarget.mdx
 
I've been trying to make
Code:
Custom script:   call DestroyGroup (udg_AT)
work but no matter where i put it, it continues to bring errors that wont allow WE to save with it enabled.

It comes up with numerous errors such as:
"Invalid argument type (unit)"
"Expected a code statement (unit)"

And when placed after the cause damage part, which is the last time it is used it brings up about 20 errors expecting endifs, names, and function names.

I had this code working perfectly before I added the multiple units part (which deals damage based on number of units, level of skill, and skills base damage as explained in the first post.) so could something in that be causing all the mayhem in the script?

Damage calculation script:
Code:
Unit - Cause (Triggering unit) to damage AT, dealing (50.00 x ((Real((Level of Arcane Divinity  for (Triggering unit)))) / (Real((Number of units in ag[1]))))) damage of attack type Magic and damage type Death
So here is an example of how it works. 50 Damage x (Level of Ability(3 for example) / Number of units (5 for example)) = 3 / 5 = 0.6 x 50 = 30.
 
AT is a single unit, so DestroyGroup doesn't work with it. In fact, single units don't leak. (Unless they're being used as locals, but that's different.)
 
>AT is a single unit, so DestroyGroup doesn't work with it. In fact, single units don't leak. (Unless they're being used as locals, but that's different.)

Oh I see. Can anyone explain to me something I just discovered. Level 1 and 2 of the spell lag like hell yet level 3 runs smoothly, and I mean SMOOTH. Could this be the calculations fault? Perhaps doing some mathimatical equations it wasnt meant for?
 
Code:
Unit Group - Pick every unit in ag[1] and do (Actions)

This is the leak you need to get rid of. When you're done with the unit group, use this:

Code:
Custom Script: call DestroyGroup(udg_ag[1])
 
No...that didn't fix it. I am going to modify it a bit and see if it is the multiple unit portion thats causing the trouble, if it is then I will probably have to toss it.

After a few tests I have determind that whatever is causing it is at the beginning and has to do with the units, maybe the group, maybe the range checking conditions I dont know, i'll update the first post with the current trigger as of now.

And Leak Check tells me this:

Code:
 Total lines: 43

 (Line: 25 ) (Word: 9 )  Position Leak
 Special  Effect  -  Create  a  special  effect  at  (Position  of  AT)  using  war3mapImported\doombolttarget.mdx    
 Special  Effect  -  Create  a  special  effect  at  ^Leak
 (Suggested fix) Set L =  (Position  of  AT)  using  war3mapImported\doombolttarget.mdx    
 (Suggested fix) Custom Script: Call RemoveLocation(udg_L) 
 
 (Line: 39 ) (Word: 9 )  Position Leak
 Special  Effect  -  Create  a  special  effect  at  (Position  of  AT)  using  war3mapImported\doombolttarget.mdx    
 Special  Effect  -  Create  a  special  effect  at  ^Leak
 (Suggested fix) Set L =  (Position  of  AT)  using  war3mapImported\doombolttarget.mdx    
 (Suggested fix) Custom Script: Call RemoveLocation(udg_L) 
 
 
 Completed
 Total amount of leaks: 2
 Leak Rating: Good
 
That is because it is a point that is not being removed. You have a variable that is "(position of AT)" already. AL. Just replace "(position of AT)" with AL, then destroy it after you are done using it with
Code:
call RemoveLocation(udg_AL)
Problem solved.
 
Actually, wrong. I just fixed the entire thing and it had nothing to do with the trigger. The dummy spell (flame strike) was using a buff (originally modified it to have no visual effects what so ever) I then noticed that the buff had a duration, by changing the duration to 0.01 (because i heard 0 will make it last forever) it completely ended the lag!
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top