• 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.

Leak Help

Status
Not open for further replies.
Level 10
Joined
Mar 25, 2008
Messages
339
I'm fairly sure this trigger leaks, i have many just like it, I;m wondering how i can obliterate the Leakage with as little effort as possible, as there's seriously, tons of these.
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Unit-type of (Dying unit)) Equal to Plemins
    • Then - Actions
      • Unit - Create 1 Grangantis for Neutral Hostile at (Center of Arena Revive <gen>) facing Default building facing degrees
      • Unit - Order (Last created unit) to Attack (Killing unit)
      • Set ArenaPoints[(Player number of (Owner of (Killing unit)))] = (ArenaPoints[(Player number of (Owner of (Killing unit)))] + 1)
      • Game - Display to (Player group((Owner of (Killing unit)))) the text: |c0000cc00Arena Poi...
    • Else - Actions
      • Do nothing
The Arena Points & Killing Unit thing, not sure if i can make "Integer = Owner of Killing Unit" and then just use the Integer, but that seems like it would leak too.
 
Level 16
Joined
May 1, 2008
Messages
1,605
Moin moin =)

1) Create a point variable, store the Center of Arena Revive in it, refer to it and delete it at the end of your trigger with :
  • Custom script: call RemoveLocation(udg_NameOfVariable)
2) Make a unit variable and store (Killing unit) in it and refer to the variable.

3) If the event is "Unit - A unit dies" you can use (Triggering unit) instead of (Dying Unit)

4) No reason for the "Do nothing" action.

Greetings and Peace
Dr. Boom
 
Level 10
Joined
Mar 25, 2008
Messages
339
Ty, like this?
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Unit-type of (Dying unit)) Equal to Rozzenz
    • Then - Actions
      • Set ArenaSpawn = (Center of Arena Revive <gen>)
      • Unit - Create 1 Olobaz for Neutral Hostile at ArenaSpawn facing Default building facing degrees
      • Unit - Order (Last created unit) to Attack (Killing unit)
      • Set ArenaKiller = (Owner of (Triggering unit))
      • Set ArenaPoints[(Player number of ArenaKiller)] = (ArenaPoints[(Player number of ArenaKiller)] + 1)
      • Game - Display to (Player group(ArenaKiller)) the text: |c0000cc00Arena Poi...
      • Custom script: call RemoveLocation(udg_ArenaSpawn)
    • Else - Actions
Though the spawn point never changes its always the same spot
 
Level 16
Joined
May 1, 2008
Messages
1,605
Just three things I don't know:

1) Even player groups can leak but very rare so no need to fix it but I don't know if "(Player group(ArenaKiller))" is a player group leak .. Shit GUI =D

2) Wondering: You use instead the (killing unit) the (triggering unit) and left the (dying unit). As far as I remember, there's only the event "Unit - A Unit dies". In this case the dying unit is the triggering unit and the killing unit is the killing unit.

3) Don't know if this has any trigger-bases change but place the "Set ArenaKiller = ()" at the top of the trigger. It's always at the top.
 
Level 10
Joined
Mar 25, 2008
Messages
339
Im hoping a Player Variable will only hold one value at a time and continuously overright itsself each time it's set, triggering unit dosent seem to work for setting the killer, it uses a unit owned by neutral hostile dies, but other than that, its working good, kinda hard to tell if anything leaks.

This map has so many spawning/triggering player triggers, surprised it dosent crash wc3 after a few minutes.
 
Ty, like this?
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Unit-type of (Dying unit)) Equal to Rozzenz
    • Then - Actions
      • Set ArenaSpawn = (Center of Arena Revive <gen>)
      • Unit - Create 1 Olobaz for Neutral Hostile at ArenaSpawn facing Default building facing degrees
      • Unit - Order (Last created unit) to Attack (Killing unit)
      • Set ArenaKiller = (Owner of (Triggering unit))
      • Set ArenaPoints[(Player number of ArenaKiller)] = (ArenaPoints[(Player number of ArenaKiller)] + 1)
      • Game - Display to (Player group(ArenaKiller)) the text: |c0000cc00Arena Poi...
      • Custom script: call RemoveLocation(udg_ArenaSpawn)
    • Else - Actions
Though the spawn point never changes its always the same spot

This doesn't leak. You're fine mate ^^
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
If you're using the same exact spot/location without changing the point at all, you don't need to create and destroy it each time the Event occurs (it will be less efficient)

Just use the location through the rest of the game since you're using the same exact location, this doesn't leak, trust me.

Only create the location once in the setup trigger, don't need to create it and destroy it each time the Event occur, it's not efficient.

1. Set the Center of Arena Revive by using Point variable (via Map Initialization Event)
2. Keep using the same spot without destroying it (don't use the call RemoveLocation() function), this does not create leaks.
 
Level 10
Joined
Mar 25, 2008
Messages
339
Cool, Thanks guys, its going to take alot of work for me to lower the amount of trigger leaking in my map... lol

Atleast every time i optimize a system in my map it makes me feel better.

But -- will the Player Integer leak? or will it just clear/add new player each time, only way i know how to test that myself is with another player
 
Status
Not open for further replies.
Top