Bad trigger, tons of leaks.

Daskunk

SC2 Forum MVP - TheSkunk #386
Reaction score
186
Ive never been good at making Efficient triggers, often making 6 seperate triggers that could be done in one, also Ive never fixed my leaks... :(

Heres my terrible attempt at fixing the leaks, but it doesnt work..
Code:
Eggs
    Events
        Time - Every 0.15 seconds of game time
    Conditions
    Actions
        Set Eggssmall = (Units of type Small Egg)
        Unit Group - Pick every unit in Eggssmall and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked unit) has buff Mana Shield) Equal to False
                    Then - Actions
                        Unit - Order (Picked unit) to Neutral Naga Sea Witch - Activate Mana Shield
                    Else - Actions
        Custom script:   call DestroyGroup (udg_Eggssmall)
        Set Eggssmall = (Units of type Small Egg)
        Unit Group - Pick every unit in Eggssmall and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Mana of (Picked unit)) Less than or equal to 1.00
                    Then - Actions
                        Unit - Remove (Picked unit) from the game
                    Else - Actions
        Custom script:   call DestroyGroup (udg_Eggssmall)
        Set EggsBREED = (Units of type Breeder Egg)
        Unit Group - Pick every unit in EggsBREED and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked unit) has buff Mana Shield) Equal to False
                    Then - Actions
                        Unit - Order (Picked unit) to Neutral Naga Sea Witch - Activate Mana Shield
                    Else - Actions
        Custom script:   call DestroyGroup (udg_EggsBREED)
        Set EggsBREED = (Units of type Breeder Egg)
        Unit Group - Pick every unit in EggsBREED and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Mana of (Picked unit)) Less than or equal to 1.00
                    Then - Actions
                        Unit - Remove (Picked unit) from the game
                    Else - Actions
        Custom script:   call DestroyGroup (udg_EggsBREED)
        Set EggsNormal = (Units of type Normal Egg)
        Unit Group - Pick every unit in EggsNormal and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Mana of (Picked unit)) Less than or equal to 1.00
                    Then - Actions
                        Unit - Remove (Picked unit) from the game
                    Else - Actions
        Custom script:   call DestroyGroup (udg_EggsNormal)
        Set EggsNormal = (Units of type Normal Egg)
        Unit Group - Pick every unit in EggsNormal and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked unit) has buff Mana Shield) Equal to False
                    Then - Actions
                        Unit - Order (Picked unit) to Neutral Naga Sea Witch - Activate Mana Shield
                    Else - Actions
        Custom script:   call DestroyGroup (udg_EggsNormal)
        Set EggsSlime = (Units of type Slimey Egg)
        Unit Group - Pick every unit in EggsSlime and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Mana of (Picked unit)) Less than or equal to 1.00
                    Then - Actions
                        Unit - Remove (Picked unit) from the game
                    Else - Actions
        Custom script:   call DestroyGroup (udg_EggsSlime)
        Set EggsSlime = (Units of type Slimey Egg)
        Unit Group - Pick every unit in EggsSlime and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked unit) has buff Mana Shield) Equal to False
                    Then - Actions
                        Unit - Order (Picked unit) to Neutral Naga Sea Witch - Activate Mana Shield
                    Else - Actions
        Custom script:   call DestroyGroup (udg_EggsSlime)
        Set EggsBIG = (Units of type Big Egg)
        Unit Group - Pick every unit in EggsBIG and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Mana of (Picked unit)) Less than or equal to 1.00
                    Then - Actions
                        Unit - Remove (Picked unit) from the game
                    Else - Actions
        Custom script:   call DestroyGroup (udg_EggsBIG)
        Set EggsBIG = (Units of type Big Egg)
        Unit Group - Pick every unit in EggsBIG and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked unit) has buff Mana Shield) Equal to False
                    Then - Actions
                        Unit - Order (Picked unit) to Neutral Naga Sea Witch - Activate Mana Shield
                    Else - Actions
        Custom script:   call DestroyGroup (udg_EggsBIG)
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,494
Terrific indeed... :p

> Custom script: call DestroyGroup (udg_Eggssmall)
> Set Eggssmall = (Units of type Small Egg)

Seems counterproductive to destroy a group you're still needing...
 

Daskunk

SC2 Forum MVP - TheSkunk #386
Reaction score
186
Code:
Remove Fixed
    Events
        Time - Every 0.15 seconds of game time
    Conditions
    Actions
        Set Eggssmall = (Units of type Small Egg)
        Unit Group - Pick every unit in Eggssmall and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked unit) has buff Mana Shield) Equal to False
                    Then - Actions
                        Unit - Order (Picked unit) to Neutral Naga Sea Witch - Activate Mana Shield
                    Else - Actions
        Unit Group - Pick every unit in Eggssmall and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Mana of (Picked unit)) Less than or equal to 1.00
                    Then - Actions
                        Unit - Remove (Picked unit) from the game
                    Else - Actions
        Custom script:   call DestroyGroup (udg_Eggssmall)
        Do nothing
        Set EggsBREED = (Units of type Breeder Egg)
        Unit Group - Pick every unit in EggsBREED and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked unit) has buff Mana Shield) Equal to False
                    Then - Actions
                        Unit - Order (Picked unit) to Neutral Naga Sea Witch - Activate Mana Shield
                    Else - Actions
        Unit Group - Pick every unit in EggsBREED and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Mana of (Picked unit)) Less than or equal to 1.00
                    Then - Actions
                        Unit - Remove (Picked unit) from the game
                    Else - Actions
        Custom script:   call DestroyGroup (udg_EggsBREED)
        Do nothing
        Set EggsNormal = (Units of type Normal Egg)
        Unit Group - Pick every unit in EggsNormal and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Mana of (Picked unit)) Less than or equal to 1.00
                    Then - Actions
                        Unit - Remove (Picked unit) from the game
                    Else - Actions
        Unit Group - Pick every unit in EggsNormal and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked unit) has buff Mana Shield) Equal to False
                    Then - Actions
                        Unit - Order (Picked unit) to Neutral Naga Sea Witch - Activate Mana Shield
                    Else - Actions
        Custom script:   call DestroyGroup (udg_EggsNormal)
        Do nothing
        Set EggsSlime = (Units of type Slimey Egg)
        Unit Group - Pick every unit in EggsSlime and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Mana of (Picked unit)) Less than or equal to 1.00
                    Then - Actions
                        Unit - Remove (Picked unit) from the game
                    Else - Actions
        Unit Group - Pick every unit in EggsSlime and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked unit) has buff Mana Shield) Equal to False
                    Then - Actions
                        Unit - Order (Picked unit) to Neutral Naga Sea Witch - Activate Mana Shield
                    Else - Actions
        Custom script:   call DestroyGroup (udg_EggsSlime)
        Do nothing
        Set EggsBIG = (Units of type Big Egg)
        Unit Group - Pick every unit in EggsBIG and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Mana of (Picked unit)) Less than or equal to 1.00
                    Then - Actions
                        Unit - Remove (Picked unit) from the game
                    Else - Actions
        Unit Group - Pick every unit in EggsBIG and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked unit) has buff Mana Shield) Equal to False
                    Then - Actions
                        Unit - Order (Picked unit) to Neutral Naga Sea Witch - Activate Mana Shield
                    Else - Actions
        Custom script:   call DestroyGroup (udg_EggsBIG)
Better.... Laggs me less now anyways. Is there anything else wrong with it?
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,494
> Do nothing

???

Congratulations, you're the first ever to use "do nothing" outside an "if then else".
It does what it says, nothing at all. As such, that action is definitely not needed.


> ((Picked unit) has buff Mana Shield) Equal to False

Actually, does it matter?
 

Daskunk

SC2 Forum MVP - TheSkunk #386
Reaction score
186
> Do nothing

???

Congratulations, you're the first ever to use "do nothing" outside an "if then else".
It does what it says, nothing at all. As such, that action is definitely not needed.
I was useing it to tell apart were it changed types of eggs when I was fixing it. I just never removed them.

The rest of the lag must be comming from the large number of units on the map and any other leaking triggers. Before it was unplayible, now its just a tiny bit laggy...

> ((Picked unit) has buff Mana Shield) Equal to False

Actually, does it matter?
??? What about it??
 

Daskunk

SC2 Forum MVP - TheSkunk #386
Reaction score
186
> What about it?

Just a random guess, but, does it matter if you test it? As in, can't you just order the use regardless?
I could, I just did that becaus at first I though it was lagging because it kept casting it every time.
 
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