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.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      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