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
 
Reaction score
65
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.
 
C

cheerioslayr

Guest
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!
 

Trollvottel

never aging title
Reaction score
262
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
 

IceWarrior98

New Member
Reaction score
12
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.
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
889
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.)
 

IceWarrior98

New Member
Reaction score
12
>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?
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
889
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])
 

IceWarrior98

New Member
Reaction score
12
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
 
C

cheerioslayr

Guest
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.
 

IceWarrior98

New Member
Reaction score
12
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.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top