Leaks?

San-D

New Member
Reaction score
15
I know that adding special effects to position of unit or at point with coordinates leaks and I know how to avoid it but does attaching a special effect leak like in :
Code:
Untitled Trigger 001
    Events
        Map initialization
    Conditions
    Actions
        Special Effect - Create a special effect attached to the overhead of Footman 0000 <gen> using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
        Special Effect - Destroy (Last created special effect)

And also, if u prperly use the leak prevent method on a frequent periodic event like in:
Code:
Whirpool Spin
    Events
        Time - Every 0.01 seconds of game time
    Conditions
    Actions
        Set Temp_Point = (Position of Caster)
        Set Point = (Position of Target)
        Unit - Move Target instantly to (Temp_Point offset by Distance towards Angle degrees)
        Unit - Create 1 Dummy for Player 1 (Red) at Point facing Default building facing degrees
        Unit - Add a 0.01 second Generic expiration timer to (Last created unit)
        Set Angle = (Angle + 1.00)
        Set Distance = (Distance - 1.00)
        Custom Script: call RemoveLocation(udg_Temp_Point)
        Custom Script: call RemoveLocation(udg_Point)
It shouldnt leak if its just one time, but it happens around 900 times in 9 seconds, does it leak, and if so how to prevent it?
 

Evoroth

New Member
Reaction score
11
Trigger 1 has no leaks.

However, (Temp_Point offset by Distance towards Angle) leaks, because it's a new location. You need another variable to deal with this.
 

Romek

Super Moderator
Reaction score
964
Except the leak already posted, neither of them leak.

I also suggest using a longer periodic timer (0.03?)
0.01 could cause lag, and... Nobody would notice the difference :D
 

San-D

New Member
Reaction score
15
But, if i use 0.01 the total time for the spell is 9 seconds, If I use 0.03 that will tahe 24 second, Its boring enough with 9 seconds, let alone 24!
 

San-D

New Member
Reaction score
15
K, I spend a lot of time reading about leaks here and leaks there an I have a request. Can someone tell me for this chain of triggers :

Code:
Begin
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Forst Gift 
    Actions
        Set Caster = (Casting unit)
        Set Temp_Point1 = (Position of Caster)
        Destructible - Pick every destructible within 3500.00 of Temp_Point1 and do (Actions)
            Loop - Actions
                Set Temp_Point2 = (Position of (Matching destructible))
                Unit - Create 1 Forest Dummy for Player 1 (Red) at Temp_Point2 facing Default building facing degrees
                Set SpiritUnit = (Last created unit)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Random integer number between 1 and 2) Equal to 1
                    Then - Actions
                        Unit Group - Add SpiritUnit to SpiritGroup1
                    Else - Actions
                        Unit Group - Add SpiritUnit to SpiritGroup2
        Trigger - Turn on Movement 90 to 270 <gen>
        Trigger - Turn on Movement 270 to 90 <gen>

Code:
Movement 90 to 270
    Events
        Time - Every 0.01 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in SpiritGroup1 and do (Actions)
            Loop - Actions
                Set Temp_Point2 = (Position of (Picked unit))
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Distance between Temp_Point1 and Temp_Point2) Greater than or equal to 1.00
                    Then - Actions
                        Set Distance = (Distance between Temp_Point1 and Temp_Point2)
                        Unit - Move (Picked unit) instantly to (Temp_Point1 offset by (Distance - 1.00) towards ((Angle from Temp_Point1 to Temp_Point2) + 1.00) degrees)
                        Animation - Change (Picked unit) flying height to ((Current flying height of (Picked unit)) - 1.00) at 30000.00
                    Else - Actions
                        Unit - Kill (Picked unit)
                        Unit - Remove (Picked unit) from the game

Code:
Movement 270 to 90
    Events
        Time - Every 0.01 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in SpiritGroup2 and do (Actions)
            Loop - Actions
                Set Temp_Point2 = (Position of (Picked unit))
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Distance between Temp_Point1 and Temp_Point2) Greater than or equal to 1.00
                    Then - Actions
                        Set Distance = (Distance between Temp_Point1 and Temp_Point2)
                        Unit - Move (Picked unit) instantly to (Temp_Point1 offset by (Distance - 1.00) towards ((Angle from Temp_Point1 to Temp_Point2) - 1.00) degrees)
                        Animation - Change (Picked unit) flying height to ((Current flying height of (Picked unit)) - 1.00) at 30000.00
                    Else - Actions
                        Unit - Kill (Picked unit)
                        Unit - Remove (Picked unit) from the game

Where am I supposed to call the Destroy point command (call RemoveLocation(udg_Temp_Point1(2)), so that it doesnt disturb the the flow of events? I tried to make a different trigger to call them when there are no more dummies left, but I dont know how to check that!
 

Larcenist

REP: Respect, Envy, Prosperity?
Reaction score
211
I tried to make a different trigger to call them when there are no more dummies left, but I dont know how to check that!

Add the dummy units to a unit group only for the dummy units, then use the "Count units in unit group" function to check if there is more than 0 units in your dummy-unit group.
 

San-D

New Member
Reaction score
15
On what event?

Code:
Movement end
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Number of units in Spirit_Group_Total) Equal to 0
            Then - Actions
                Custom script:   call RemoveLocation(udg_Temp_Point1)
                Custom script:   call RemoveLocation(udg_Temp_Point2)
            Else - Actions
                Do nothing


Is this good, where Spirit_Group_Totak is Spirt Group 1 + Spirit Group 2
 

ManyTimes

I'm so lonesome I could cry...
Reaction score
293
Code:
egin
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Forst Gift 
    Actions
        Set Caster = (Casting unit)
        Set Temp_Point1 = (Position of Caster)
        Destructible - Pick every destructible within 3500.00 of Temp_Point1 and do (Actions)
            Loop - Actions
                [COLOR="RoyalBlue"]Set Temp_Point2 = (Position of (Matching destructible))[/COLOR]
               [COLOR="Red"] Set Temp_Point2 = (Position of (Picked destructible))[/COLOR]
                Unit - Create 1 Forest Dummy for Player 1 (Red) at Temp_Point2 facing Default building facing degrees
                [COLOR="RoyalBlue"]Set SpiritUnit = (Last created unit)[/COLOR]
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Random integer number between 1 and 2) Equal to 1
                    Then - Actions
[COLOR="Blue"]                        Unit Group - Add SpiritUnit to SpiritGroup1[/COLOR]
                        [COLOR="Red"]Unit Group - Add (Last Created Unit) to SpiritGroup1[/COLOR]
                    Else - Actions
[COLOR="Blue"]                        Unit Group - Add SpiritUnit to SpiritGroup2[/COLOR]
[COLOR="Red"]                        Unit Group - Add last Created Unit to SpiritGroup2[/COLOR]
               [COLOR="Red"] Custom Script: call RemoveLocation(udg_Temp_Point2)[/COLOR]
        Trigger - Turn on Movement 90 to 270 <gen>

Code:
Movement 90 to 270
    Events
        Time - Every [COLOR="Yellow"]0.03 [/COLOR]seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in SpiritGroup1 and do (Actions)
            Loop - Actions
                Set Temp_Point2 = (Position of (Picked unit))
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Distance between Temp_Point1 and Temp_Point2) Greater than or equal to 1.00
                    Then - Actions
                        Set Distance = (Distance between Temp_Point1 and Temp_Point2)
                        Unit - Move (Picked unit) instantly to (Temp_Point1 offset by (Distance - 1.00) towards ((Angle from Temp_Point1 to Temp_Point2) + 1.00) degrees)
                        Animation - Change (Picked unit) flying height to ((Current flying height of (Picked unit)) - 1.00) at 30000.00
                    Else - Actions
                        Unit - Kill (Picked unit)
                        Unit - Remove (Picked unit) from the game
                        [COLOR="Red"]Custom Script: call RemoveLocation(udg_Temp_Point1)[/COLOR]
           [COLOR="Red"]    Custom Script: call RemoveLocation(udg_Temp_Point2)[/COLOR]
Remove Blue Lines
Add red lines
Yellow lines should be changed.

Last trigger, same thing there as the second.

Edit: what happend?! I changed all three triggers..oh, doing it again :p

Edit2: your movement is a bit...odd, dont you think? It also creates a leak.

edit3: Here:
Code:
Untitled Trigger 009
    Events
        Time - Every 0.03 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in snowmangroup and do (Actions)
            Loop - Actions
                Set p[2] = (Position of (Picked unit))
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Distance between p[2] and p[1]) Greater than or equal to 100.00
                    Then - Actions
                        Set p[3] = (p[2] offset by 12.00 towards (Facing of (Picked unit)) degrees)
                        Unit - Move (Picked unit) instantly to p[3]
                        Custom script:   call RemoveLocation(udg_p[3])
                    Else - Actions
                        Unit Group - Remove (Picked unit) from snowmangroup
                        Unit - Kill (Picked unit)
                        Custom script:   call RemoveLocation(udg_p[1)
                Custom script:   call RemoveLocation(udg_p[2)

See the difference?
I use another point, p[3], it sets p[2] offset by X. You order your unit to just move to "p[2] offset by X", which causes leak.
 

San-D

New Member
Reaction score
15
What about my upper reply, the trigger there works, right? and That way, it doesnt matter if its 0.01 sec or 0.03 because it removes the anyway?
 

ManyTimes

I'm so lonesome I could cry...
Reaction score
293
You can do that (but remember, if you cast the spell again, within the leak is cleaned up...but)
event : every 1 sec
cond: if 0 units in group
actions: call RemoveLocation(udg_TempPoint1)

But, you cannot remove temppoint2 that way, it needs to be cleaned up inside the loop.

>>its 0.01 sec or 0.03 because it removes the anyway?
You as a human being, do not notice the difference of 0.01 or 0.03, but your computer does. Think about it, running that trigger 100 times per second, or 33...

Which trigger are you? huh? still need help? :)
 

San-D

New Member
Reaction score
15
Sorry ManyTimes, ur suggestion destriys the Position of the target too early, and after the first dummy reaches the caster, all other redirect to another location!

Does moving a unit to a player's start location leak?
 
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
    +1
  • V-SNES V-SNES:
    Happy Friday!
    +1

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top