this leaks?

Troll

New Member
Reaction score
4
Code:
init 15
    Events
        Unit - A unit Dies
    Conditions
        (Unit-type of (Triggering unit)) Equal to Footmen Frenzy
    Actions
        Game - Display to (All players) for 4.00 seconds the text: (PLAYER_COLORS[(Player number of (Owner of (Triggering unit)))] + ((Name of (Owner of (Triggering unit))) + (|r +  has been defeated!)))
        Player Group - Remove (Owner of (Triggering unit)) from (All players)
        Trigger - Turn off init 13 <gen>
        Unit Group - Pick every unit in (Units owned by (Owner of (Triggering unit))) and do (Unit - Kill (Picked unit))
        Trigger - Turn on init 13 <gen>
        Wait 2.00 seconds
        Unit Group - Pick every unit in (Units owned by (Owner of (Triggering unit))) and do (Unit - Remove (Picked unit) from the game)
 

Beetlebomb

New Member
Reaction score
43
Yes, the Unit Group - Pick every unit action leaks.

To remove it, make a unit group variable and set it to what you have now(Units own by (owner of triggering unit blah blah blah)). Then add a custom script like this:

call DestroyGroup(udg_*name here*)

udg_ needs to be put before the variable name.

Do that with both Unit Groups and that will be leakless.
 

Troll

New Member
Reaction score
4
Code:
init 15
    Events
        Unit - A unit Dies
    Conditions
        (Unit-type of (Triggering unit)) Equal to Footmen Frenzy
    Actions
        Game - Display to (All players) for 4.00 seconds the text: (PLAYER_COLORS[(Player number of (Owner of (Triggering unit)))] + ((Name of (Owner of (Triggering unit))) + (|r +  has been defeated!)))
        Player Group - Remove (Owner of (Triggering unit)) from (All players)
        Trigger - Turn off init 13 <gen>
        Set INIT_15 = (Units owned by (Owner of (Triggering unit)))
        Unit Group - Pick every unit in INIT_15 and do (Unit - Kill (Picked unit))
        Trigger - Turn on init 13 <gen>
        Wait 2.00 seconds
        Unit Group - Pick every unit in INIT_15 and do (Unit - Remove (Picked unit) from the game)
        Custom script:   call DestroyGroup(udg_INIT_15)


thats OK? right? :D!
 

Pharaoh_

The epic journey will soon begin... Prepare!
Reaction score
136
Unit Group - Pick every unit in INIT_15 and do (Unit - Kill (Picked unit))
Trigger - Turn on init 13 <gen>
Wait 2.00 seconds
Unit Group - Pick every unit in INIT_15 and do (Unit - Remove (Picked unit) from the game)
You have already killed them, why do you remove them as well? Just use the custom script you used already. No use of this: Wait 2.00 seconds
Unit Group - Pick every unit in INIT_15 and do (Unit - Remove (Picked unit) from the game)

PlayerGroups also leak a bit. Set Temp_Group = (All Players) and so, Player Group - Remove (Owner of (Triggering unit)) from (Temp_Group) and in the end of your trigger (if you don't need the Playergroup), then do Custom script: call DestroyForce (udg_Temp_Group)
 

Troll

New Member
Reaction score
4
if i dont remove them, the hero will come back to life thanks to my auto revive hero trigger.. the wait is to show the art of "diying animations" a bit and then remove it, for luxury.
 

cleeezzz

The Undead Ranger.
Reaction score
268
it seems All players is a variable being used globally which means there is no need to destroy it. You do not need to set it into a temp group to remove a player either.
 

Curo

Why am I still playing this game...?
Reaction score
109
Doesn't Unit Group - Pick every unit in INIT_15 and do (Unit - Remove (Picked unit) from the game) also leak? Shouldn't you have to set (Picked unit) to a temp variable before removing it from the game, then clear the variable?

I think I read somewhere that the following leaks:
Code:
Unit - Remove (Triggering unit) from the game

But that this doesn't leak:
Code:
Set [I]TempUnit[/I] = (Triggering unit)
Unit - Remove [I]TempUnit[/I] from the game
Set [I]TempUnit[/I] = No unit
 

AoW_Hun7312

I'm a magic man, I've got magic hands.
Reaction score
76
Actually, units don't leak.

Things that leak

  • Unit Groups
  • Special Effects
  • Points

There may be more.
 

cleeezzz

The Undead Ranger.
Reaction score
268
>Actually, if you destroy "all players", it's gone... and, triggers using it will stop working.

haha i thought it was a custom variable because i thought it would read "All Players" instead of "All players" but then theres a space which variables cant have.
 
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