• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Help with cleaning leaks

Status
Not open for further replies.
Level 4
Joined
Dec 3, 2012
Messages
51
Hey, I am on my way to finishing my map, and was wondering if I could run some triggers by to see if they leak or if there is a better way to implement them. The map is "Huge", has 8200 doodads, and is nearly 8 mb. It is very laggy at times, and then goes through phases where it seems to be playing at a hyper fast speed. Is this just my computer acting slow or is it due to leaks? I have posted represenative triggers that would fire most often during the game. There are about 12 of the spawn triggers and maybe 35 command triggers. (Note also that I did not make the creep respawn trigger). Any help would be greatly appreciated. Thanks.

  • CrepRe
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Custom value of (Triggering unit)) Greater than 0
      • (Owner of (Triggering unit)) Equal to Neutral Hostile
    • Actions
      • Wait 180.00 game-time seconds
      • Unit - Create 1 (Unit-type of (Triggering unit)) for Neutral Hostile at creepLocation[(Custom value of (Triggering unit))] facing 90.00 degrees
      • Unit - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))
  • CreepLocation
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set creepGroup = (Units in (Playable map area) owned by Neutral Hostile)
      • Unit Group - Pick every unit in creepGroup and do (Actions)
        • Loop - Actions
          • Set i = (i + 1)
          • Set creepLocation[i] = (Position of (Picked unit))
          • Unit - Set the custom value of (Picked unit) to i
      • Custom script: call DestroyGroup( udg_creepGroup )
  • Spawn Tauren
    • Events
      • Time - Every 80.00 seconds of game time
    • Conditions
    • Actions
      • Set Point2 = (Center of Hunters Hall <gen>)
      • If ((Night Elf Fortress 0274 <gen> is alive) Equal to True) then do (Unit - Create 2 Tauren for Player 5 (Yellow) at Point2 facing 90.00 degrees) else do (Do nothing)
      • If ((Night Elf Fortress 0274 <gen> is alive) Equal to True) then do (Unit - Create 1 Spirit Walker for Player 5 (Yellow) at Point2 facing 90.00 degrees) else do
      • Custom script: call RemoveLocation (udg_Point2)

  • Studded Leather Armor
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • ((Triggering unit) has an item of type Leather Armor) Equal to True
      • ((Triggering unit) has an item of type Glyph) Equal to True
    • Actions
      • Item - Remove (Item carried by (Triggering unit) of type Leather Armor)
      • Item - Remove (Item carried by (Triggering unit) of type Glyph)
      • Hero - Create Studded Leather Armor and give it to (Triggering unit)

  • Command 1
    • Events
      • Unit - A unit enters Ancient Spawn Zone <gen>
    • Conditions
      • (Owner of (Entering unit)) Equal to Player 5 (Yellow)
    • Actions
      • Unit - Order (Entering unit) to Attack-Move To (Center of South 1 <gen>)

  • Summoner Spell
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit - Order Summoner 0975 <gen> to Special Archimonde - Finger Of Death Demon Gate 0409 <gen>
      • Unit - Order Summoner 0974 <gen> to Special Archimonde - Finger Of Death Demon Gate 0409 <gen>
      • Unit - Order Summoner 0977 <gen> to Special Archimonde - Finger Of Death Demon Gate 0409 <gen>

  • Crypt Teleport
    • Events
      • Unit - A unit enters Crypt <gen>
    • Conditions
      • ((Owner of (Entering unit)) is an ally of Player 12 (Brown)) Equal to True
    • Actions
      • Set Point = (Center of Inside Crypt <gen>)
      • Unit - Move (Entering unit) instantly to Point
      • Custom script: call RemoveLocation (udg_Point)
      • Custom script: set udg_Point = null
 
Last edited:
Level 28
Joined
Jan 26, 2007
Messages
4,789
You don't really need a temporary group in the trigger "CreepLocation", you could just use set bj_wantDestroyGroup = true right before the unit group (saves a variable).
The trigger "Command 1" leaks (location).

I'm unsure if "CreepRe" will always work, because the unit might be removed after 3 minutes. Personally, I would do this with local variables to unsure that it does indeed work.
That would look something like this: Post (uses X- and Y coordinates instead of a location).
 
Level 4
Joined
Dec 3, 2012
Messages
51
Thanks for the replies, hopefully cleaning up the 30+ "command" triggers I have will help the map run smoother.

As for the creep respawn system, it works, but if the corpse is removed through a raise dead spell or explosion, then it will not revive. Also, if the creep doesnt leave a corpse, like a revenant, then it will not revive (which is actually useful for creeps that I dont want to respawn). I increased the decay time to 180, although this is problematic because hundreds of corpses are piling up (this is an AOS style map btw). Can anyone recommend a better creep respawn system?

One last thing, does creating items or picking destructibles cause leaks? Again thanks so much, I overlooked the "command" triggers.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Can anyone recommend a better creep respawn system?
I've already given you one:
Personally, I would do this with local variables to unsure that it does indeed work.
That would look something like this: Post (uses X- and Y coordinates instead of a location).
One last thing, does creating items or picking destructibles cause leaks? Again thanks so much, I overlooked the "command" triggers.
Creating items itself doesn't leak, but you do need to remove the location you used, of course ("Create item and give it to hero" doesn't leak).
Tomes always generate a leak. It is best to remove a tome after purchasing, or you could always use Item Cleanup by Bribe.

Picking destructibles does not leak.
 
Status
Not open for further replies.
Top