Leak ???

Kyzerdrood

New Member
Reaction score
3
Code:
Rez
    Events
        Time - Every 5.00 seconds of game time
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Lvl2 Equal to True
            Then - Actions
                Unit Group - Pick every unit in (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Demon Hunter)) and do (Actions)
                    Loop - Actions
                        Hero - Instantly revive (Picked unit) at (Center of Radius <gen>), Show revival graphics
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Lvl3 Equal to True
                    Then - Actions
                        Unit Group - Pick every unit in (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Demon Hunter)) and do (Actions)
                            Loop - Actions
                                Hero - Instantly revive (Picked unit) at (Center of Region 008 <gen>), Show revival graphics
                    Else - Actions
                        Unit Group - Pick every unit in (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Demon Hunter)) and do (Actions)
                            Loop - Actions
                                Hero - Instantly revive (Picked unit) at (Center of Region 007 <gen>), Show revival graphics

Does This leak? i really suck with leaks, so, please tell me if it does, cuz later in the game, it really starts to lag bad.
 

trb92

Throwing science at the wall to see what sticks
Reaction score
142
Sure does leak. I'll bold all the leaking parts.
Code:
Rez
    Events
        Time - Every 5.00 seconds of game time
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Lvl2 Equal to True
            Then - Actions
                Unit Group - Pick every unit in [B](Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Demon Hunter))[/B] and do (Actions)
                    Loop - Actions
                        Hero - Instantly revive (Picked unit) at [B](Center of Radius <gen>), [/B]Show revival graphics
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Lvl3 Equal to True
                    Then - Actions
                        Unit Group - Pick every unit in [B](Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Demon Hunter))[/B] and do (Actions)
                            Loop - Actions
                                Hero - Instantly revive (Picked unit) at [B](Center of Region 008 <gen>), [/B]Show revival graphics
                    Else - Actions
                        Unit Group - Pick every unit in [B](Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Demon Hunter))[/B] and do (Actions)
                            Loop - Actions
                                Hero - Instantly revive (Picked unit) at [B](Center of Region 007 <gen>), [/B]Show revival graphics

Here's a nonleaking version:
Code:
Rez
    Events
        Time - Every 5.00 seconds of game time
    Conditions
    Actions
        set tempGroup = (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Demon Hunter))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Lvl2 Equal to True
            Then - Actions
                Unit Group - Pick every unit in tempGroup and do (Actions)
                    Loop - Actions
                        set tempPoint = (Center of Radius <gen>)
                        Hero - Instantly revive (Picked unit) at tempPoint, Show revival graphics
                        Custom Script:     call RemoveLocation(udg_tempPoint)
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Lvl3 Equal to True
                    Then - Actions
                        Unit Group - Pick every unit in tempGroup and do (Actions)
                            Loop - Actions
                                set tempPoint = (Center of Region 008 <gen>)
                                Hero - Instantly revive (Picked unit) at tempPoint, Show revival graphics
                                Custom Script:     call RemoveLocation(udg_tempPoint)
                    Else - Actions
                        Unit Group - Pick every unit in tempGroup and do (Actions)
                            Loop - Actions
                                set tempPoint = (Center of Region 007 <gen>)
                                Hero - Instantly revive (Picked unit) at tempPoint, Show revival graphics
                                Custom Script:     call RemoveLocation(udg_tempPoint)
        Custom Script:     call DestroyGroup(udg_tempGroup)
 

Kyzerdrood

New Member
Reaction score
3
Hmm, thanks, was wondering, i read the tut and tried this, tell me what you think

its a maze, so...

Code:
Rez
    Events
        Unit - A unit Dies
    Conditions
    Actions
        Set Temp_Unit = (Dying unit)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Lvl2 Equal to True
            Then - Actions
                Set Temp_Point = (Center of Radius <gen>)
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Lvl3 Equal to True
                    Then - Actions
                        Set Temp_Point = (Center of Region 008 <gen>)
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                Lvlwin Equal to True
                            Then - Actions
                                Set Temp_Point = (Center of Region 009 <gen>)
                            Else - Actions
                                Set Temp_Point = (Center of Region 007 <gen>)
        Hero - Instantly revive Temp_Unit at Temp_Point, Show revival graphics
        Custom script:   call RemoveLocation (udg_Temp_Point)
 

PiCkstix

New Member
Reaction score
18
It's right.

To prevent leaks just make sure that:
• You create variables for:
-Points
-Unit Groups
-and, destroying Points

• Also:
-Make sure you destroy Special Effects

You will be "ay for a way" if you just keep those in mind.
PS. Please somebody add to the list if you remember some other things, I am too lazy to remember any more... O_O
 
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