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

Things That Leak

Level 14
Joined
Mar 4, 2009
Messages
1,156
Does this leak?
  • Does this leak?
  • BASE 1
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Owner of (Attacking unit)) Not equal to (Owner of (Random unit from (Units in Region 001 <gen> matching ((Unit-type of (Matching unit)) Equal to Human Flag(Base Owner)))))
      • (Owner of (Attacking unit)) Not equal to (Owner of (Random unit from (Units in Region 002 <gen> matching ((Unit-type of (Matching unit)) Equal to Human Flag(Base Owner)))))
      • (Owner of (Attacking unit)) Not equal to (Owner of (Random unit from (Units in Region 003 <gen> matching ((Unit-type of (Matching unit)) Equal to Human Flag(Base Owner)))))
      • ((Region 001 <gen> contains (Attacked unit)) Equal to True) or (((Region 002 <gen> contains (Attacked unit)) Equal to True) or ((Region 003 <gen> contains (Attacked unit)) Equal to True))
    • Actions
      • Unit - Order (Attacking unit) to Stop
    • Custom script: set bj_wantDestroyGroup = true
    • Custom script: set bj_wantDestroyGroup = true
    • Custom script: set bj_wantDestroyGroup = true
or i shold maybe do it like this?

  • BASE 1 Copy
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Attacking unit)) Not equal to (Owner of (Random unit from (Units in Region 001 <gen> matching ((Unit-type of (Matching unit)) Equal to Human Flag(Base Owner)))))
          • (Owner of (Attacking unit)) Not equal to (Owner of (Random unit from (Units in Region 002 <gen> matching ((Unit-type of (Matching unit)) Equal to Human Flag(Base Owner)))))
          • (Owner of (Attacking unit)) Not equal to (Owner of (Random unit from (Units in Region 003 <gen> matching ((Unit-type of (Matching unit)) Equal to Human Flag(Base Owner)))))
          • ((Region 001 <gen> contains (Attacked unit)) Equal to True) or (((Region 002 <gen> contains (Attacked unit)) Equal to True) or ((Region 003 <gen> contains (Attacked unit)) Equal to True))
        • Then - Actions
          • Unit - Order (Attacking unit) to Stop
        • Else - Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Custom script: set bj_wantDestroyGroup = true
      • Custom script: set bj_wantDestroyGroup = true


I dont know does "Custom script: set bj_wantDestroyGroup = true" must go after the action or before the action
 
Level 14
Joined
Mar 4, 2009
Messages
1,156
It has to go before groups are used. And it doesn't stack, so you need another one before the next time you use a group.
that sucks....i need to do it like this?:ugly:,for every group:thumbs_down: (i have 32 triggers 0_o and they will need this... :slp:)
are that leaks really so inportant?Would it work that i make trigger that destroys groups every time units is attacked,i think not...
want to destroy group
-if conditions.....
want to destroy group
-if conditions.....
want to destroy group
-if conditions.....
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
that sucks....i need to do it like this?:ugly:,for every group:thumbs_down: (i have 32 triggers 0_o and they will need this... :slp:)
are that leaks really so inportant?Would it work that i make trigger that destroys groups every time units is attacked,i think not...
want to destroy group
-if conditions.....
want to destroy group
-if conditions.....
want to destroy group
-if conditions.....

You would need to do that each time, tough luck :D

Yeah, leaks are that important, ffs!!! Leaks cleaning is one of the most important things in a map! How would you feel if you make a killer map that has great effects and stuff, but it crashes after 5 minutes every time you try to play the map??

I'll tell you how you'd feel, you would feel like shit.
 
Level 14
Joined
Mar 4, 2009
Messages
1,156
You would need to do that each time, tough luck :D

Yeah, leaks are that important, ffs!!! Leaks cleaning is one of the most important things in a map! How would you feel if you make a killer map that has great effects and stuff, but it crashes after 5 minutes every time you try to play the map??

I'll tell you how you'd feel, you would feel like shit.

Yeah but i never saw my map lagging when i wasn´t fixing leaks .....

i think my trigger will be better like this and that there is no leaks....(i hope)

  • BASE 1 Copy
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Region 005 <gen> contains (Attacked unit)) Equal to True) or (((Region 006 <gen> contains (Attacked unit)) Equal to True) or ((Region 007 <gen> contains (Attacked unit)) Equal to True))
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Random unit from (Units owned by (Owner of (Attacking unit)) matching (((((Region 007 <gen> contains (Matching unit)) Equal to True) or ((Region 006 <gen> contains (Matching unit)) Equal to True)) or ((Region 005 <gen> contains (Matching unit)) Equal to Tru Not equal to True
        • Then - Actions
          • Unit - Order (Attacking unit) to Stop
        • Else - Actions
lol its so long that is couldn´t fit in :xxd:

is it better to set the group and after the action destroy it or its the same with "Custom script: set bj_wantDestroyGroup = true"?

if you have "Custom script: set bj_wantDestroyGroup = true" do you need to destroy the group every time iven if it is not changed?
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
Yeah but i never saw my map lagging when i wasn´t fixing leaks .....

You will, young Skywalker, you will.... (in Yoda's voice)

is it better to set the group and after the action destroy it or its the same with "Custom script: set bj_wantDestroyGroup = true"?

Well, I suggest that you use bj_wantDestroyGroup when you use the group only once, for example, those conditions of yours. But if you want to use the same group several times, I suggest you store it in a variable, then use that variable where you need to use it, and then destroy it afterward.

if you have "Custom script: set bj_wantDestroyGroup = true" do you need to destroy the group every time iven if it is not changed?

I don't quite understand this question. But you need to destroy it every time you create it, yeah.

Stop asking questions already :p
 
Level 9
Joined
Aug 16, 2008
Messages
319
Another leaked thing?

My spell leaks when the hero cast normally.
 

Attachments

  • 234234234.PNG
    234234234.PNG
    22.3 KB · Views: 82
Level 12
Joined
Apr 27, 2008
Messages
1,228
Most probably he is refering to leaks as the bugs caused due to the un-MUI-ness result from the wait.
 
Level 11
Joined
Jun 21, 2007
Messages
505
I suggest to Zirukurt01 to use a trigger like this.
  • Wait N Times
  • Events
  • Conditions
  • Actions
    • Set TEMP_INT = (TEMP_INT + 1)
    • Wait 0.08 seconds
    • Animation Play Crazycaster's attack animation
    • Animation Play Crazytarget's death animation
    • If (TEMP_INT Less than 45) then do (Run Trigger "Wait N Times") else do (Do nothing)
 
Level 4
Joined
Feb 12, 2007
Messages
99
Hi, i wanted to ask about a thing because i wonder if it's leak :
-i have a trigger for locations where i declare them at the start like this:

  • Init
    • Evénements
      • Map initialization
    • Conditions
    • Actions
      • Joueur - Add 1000 to Joueur 1 (Rouge) Or actuel
      • Joueur - Add 1000 to Joueur 2 (Bleu) Or actuel
      • Joueur - Add 1000 to Joueur 3 (Cyan) Or actuel
      • Joueur - Add 1000 to Joueur 4 (Pourpre) Or actuel
      • Joueur - Add 1000 to Joueur 5 (Jaune) Or actuel
      • -------- Abilities Variable --------
      • Set Abilities_Gestion[31] = Earth - Natural Regeneration
      • Set Abilities_Gestion[33] = Earth - Sarment
      • Set Abilities_Gestion[34] = Earth - Schockwave
      • Set Abilities_Gestion[35] = Earth - Thrilling Venom
      • Set Abilities_Gestion[38] = Earth - VenomWave (Neutre hostile)
      • Set Abilities_Gestion[39] = Earth - Worm's Venom, Venom of Worms
      • -------- Passives Variables --------
      • Set Abilities_Gestion[210] = Dummy-Venom
      • Set Abilities_Gestion[310] = Earth - Venom
      • Set Abilities_Gestion[211] = Dummy-Pulverisation
      • Set Abilities_Gestion[311] = Earth - Pulverisation
      • Set Abilities_Gestion[212] = Dummy-VenomLash
      • Set Abilities_Gestion[312] = Earth - VenomLash
      • -------- Locations --------
      • Set Locations_Important[1] = (Position of Gate of Souls 0009 <gen>)
      • Set Locations_Important[5] = (Center of SpamCreepsAlliance <gen>)
      • -------- Experience Cost --------
      • Set Experienc_Cost[1] = 5
      • Set Experienc_Cost[2] = 10
      • Set Experienc_Cost[3] = 17
      • Set Experienc_Cost[4] = 25
      • Set Experienc_Cost[5] = 35
      • Set Experienc_Cost[6] = 50
      • Set Experienc_Cost[7] = 70
      • Set Experienc_Cost[8] = 93
      • Set Experienc_Cost[9] = 120
      • Set Experienc_Cost[10] = 150
      • Set Experienc_Cost[11] = 185
      • Set Experienc_Cost[12] = 226
      • Set Experienc_Cost[13] = 273
      • Set Experienc_Cost[14] = 330
      • Set Experienc_Cost[15] = 400
      • Set Experienc_Cost[16] = 485
      • Set Experienc_Cost[17] = 596
      • Set Experienc_Cost[18] = 755
      • Set Experienc_Cost[19] = 945
      • Set Experienc_Cost[20] = 1167
You can see two locations that i use for the whole game (locations_important 1&5) but then i don't remove them anytime so does it leak always or just two times ? i use some trigger like this with those locations :

  • Start Spam CreepsAlliance
    • Evénements
      • Temps - Elapsed game time is 30.00 seconds
    • Conditions
    • Actions
      • Unité - Create 1 Troll Headhunter for Joueur 10 (Bleu clair) at Locations_Important[5] facing 160.00 degrees
      • Héros - Learn skill for (Last created unit): Damnit, i am using all of my axes (Troll Headhunter)
      • Set IA_Unit_Hero[1] = (Last created unit)
      • Unité - Create 4 Troll for Joueur 10 (Bleu clair) at Locations_Important[5] facing 90.00 degrees
      • Unité - Create 1 Berzerker Troll for Joueur 10 (Bleu clair) at Locations_Important[5] facing 90.00 degrees
      • Groupe unité - Pick every unit in (Units in SpamCreepsAlliance <gen>) and do (Actions)
        • Boucle - Actions
          • Unité - Order (Picked unit) to Attaquer-Avancer vers Locations_Important[1]
          • Groupe unité - Remove all units from (Last created unit group)
      • Wait 60.00 seconds
      • Unité - Create 1 Furblog King for Joueur 10 (Bleu clair) at Locations_Important[5] facing 160.00 degrees
      • Héros - Learn skill for (Last created unit): Stomp (Furblog King)
      • Set IA_Unit_Hero[2] = (Last created unit)
      • Unité - Create 2 Furbolg for Joueur 10 (Bleu clair) at Locations_Important[5] facing 90.00 degrees
      • Unité - Create 1 Chaman Furbolg for Joueur 10 (Bleu clair) at Locations_Important[5] facing 90.00 degrees
      • Groupe unité - Pick every unit in (Units in SpamCreepsAlliance <gen>) and do (Actions)
        • Boucle - Actions
          • Unité - Order (Picked unit) to Attaquer-Avancer vers Locations_Important[1]
          • Groupe unité - Remove all units from (Last created unit group)
      • Déclencheur - Turn off (This trigger)
and too i was wondering about this trigger, it also use locations but on reviving of heroes, units doesn't go to attack the other locations so what ?

  • ReviveHeroIA of CA
    • Evénements
      • Unité - A unit Meurt
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • ((Dying unit) is Un héros) Egal Ã* TRUE
          • (Owner of (Dying unit)) Egal Ã* Joueur 10 (Bleu clair)
    • Actions
      • Wait 50.00 seconds
      • Héros - Instantly revive (Dying unit) at Locations_Important[5], Masquer revival graphics
      • Unité - Move (Reviving Hero) instantly to Locations_Important[5]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Si - Conditions
          • (Unit-type of (Dying unit)) Egal Ã* Troll Headhunter
        • Alors - Actions
          • Unité - Create 4 Troll for Joueur 10 (Bleu clair) at Locations_Important[5] facing 90.00 degrees
          • Unité - Create 1 Berzerker Troll for Joueur 10 (Bleu clair) at Locations_Important[5] facing 90.00 degrees
          • Groupe unité - Pick every unit in (Units in SpamCreepsAlliance <gen>) and do (Actions)
            • Boucle - Actions
              • Unité - Order (Picked unit) to Attaquer-Avancer vers Locations_Important[1]
              • Groupe unité - Remove all units from (Last created unit group)
        • Sinon - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Si - Conditions
          • (Unit-type of (Dying unit)) Egal Ã* Furblog King
        • Alors - Actions
          • Unité - Create 2 Furbolg for Joueur 10 (Bleu clair) at Locations_Important[5] facing 90.00 degrees
          • Unité - Create 1 Chaman Furbolg for Joueur 10 (Bleu clair) at Locations_Important[5] facing 90.00 degrees
          • Groupe unité - Pick every unit in (Units in SpamCreepsAlliance <gen>) and do (Actions)
            • Boucle - Actions
              • Unité - Order (Picked unit) to Attaquer-Avancer vers Locations_Important[1]
              • Groupe unité - Remove all units from (Last created unit group)
        • Sinon - Actions
 
Level 4
Joined
Feb 12, 2007
Messages
99
Yeah, in fact i forgot that i had already solved the problem of not attacking unit :', well i am happy that this idea of variable for full game was good.

Anyway i have a weird bug :
on this trigger the rocket skill of the troll hero is going weird, the rocket look like they are going into the sky and doesn't attack any unit at all (it's an IA hero). Also i was wondering if there was easier way than mine for AOE with target (or even without) because i am not really sure that my tech is both working well and leakless, specially with a lot of heroes in game.

  • Use Spell
    • Evénements
      • Temps - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set UnitGroup = (Units within 600.00 of (Position of (Triggering unit)) matching ((((Matching unit) is alive) Egal Ã* TRUE) and (((Triggering player) is an enemy of (Owner of (Triggering unit))) Egal Ã* TRUE)))
      • -------- AoeSpell(Target) --------
      • -------- TrollHeadhunter --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Si - Conditions
          • (IA_Unit_Hero[1] is alive) Egal Ã* TRUE
        • Alors - Actions
          • Set Point = (Position of (Random unit from UnitGroupIA_AOEspell))
          • Set UnitGroupIA_AOEspell = (Units within 250.00 of Point matching ((((Matching unit) is alive) Egal Ã* TRUE) and (((Matching unit) is visible to Joueur 10 (Bleu clair)) Egal Ã* TRUE)))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Si - Conditions
              • (Number of units in UnitGroupIA_AOEspell) Supérieur ou égal Ã* 4
            • Alors - Actions
              • Unité - Order IA_Unit_Hero[1] to Artisan neutre - Roquettes Point
            • Sinon - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Si - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Number of units in UnitGroup) Supérieur ou égal Ã* 1
            • Alors - Actions
              • Unité - Order IA_Unit_Hero[1] to Neutre - Servant des eaux
              • Unité - Order (Summoned unit) to Attaquer-Avancer vers Locations_Important[1]
              • Unité - Order IA_Unit_Hero[1] to Prophète Orc - Esprit sauvage
              • Unité - Order (Summoned unit) to Attaquer-Avancer vers Locations_Important[1]
            • Sinon - Actions
        • Sinon - Actions
      • -------- FurblogKing --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Si - Conditions
          • (Triggering unit) Egal Ã* IA_Unit_Hero[2]
        • Alors - Actions
          • Set UnitGroupIA_AOEspell = (Units within 325.00 of (Position of IA_Unit_Hero[2]) matching ((((Matching unit) is alive) Egal Ã* TRUE) and (((Owner of (Matching unit)) is an enemy of Joueur 10 (Bleu clair)) Egal Ã* TRUE)))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Si - Conditions
              • (Number of units in UnitGroupIA_AOEspell) Supérieur ou égal Ã* 4
            • Alors - Actions
              • Unité - Order IA_Unit_Hero[2] to Roi de la montagne humain - Coup de tonnerre
            • Sinon - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Si - Conditions
              • (Vie of IA_Unit_Hero[2]) Inférieur ou égal Ã* 60.00
            • Alors - Actions
              • Unité - Order IA_Unit_Hero[2] to Roi de la montagne humain - Activer avatar
            • Sinon - Actions
        • Sinon - Actions
 
Level 11
Joined
Jun 21, 2007
Messages
505
I need help. I'm using a variable (Unit_Pos) to store the position of a unit in the variable. I move the unit around by triggers, for example
Event: Every 0.05 seconds
Set Unit_Pos = Unit_Pos offset by 16.72 towards Unit_Facing
Move TheUnit to Unit_Pos offset by (Random number between -4 and 4; Tandom number between -4 and 4)
Make TheUnit face Random angle between 0 and 360

In which place the hell do I use custom script RemoveLocation? After or before I changed the variable to an offset of it?
EDIT: Please help!
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
If you put it before, it cannot makean offset of point that has been destroyed. If you put it after, you will stil have that problem + one extra leak.

Even if you destroy Unit_Pos right, you're still leaking a point in the move action.

First, you should have two point variables, Unit_Pos1 and Unit_Pos2 (you can name them whatever you want). Then set Unit_Pos1 to the position of the unit. Create an integer variable (I'll call it Int) and set it to 0 in the non-looping trigger (in your case it's probably the spell effect trigger). Then just do this:

Set Int = Int + 1
Set Unit_Pos2 = Unit_Pos1 offset by (16.72 x Int) towards Unit_Facing
Move TheUnit to UnitPos2
Make TheUnit face Random angle between 0 and 360
Custom script: call RemoveLocation(udg_Unit_Pos2)

And when the trigger is finished looping destroy Unit_Pos1 also.

There are probably other ways to do it, but this one's fine too.
 
Level 14
Joined
Mar 4, 2009
Messages
1,156
when i play some sound i wanna remove the leak but it destroys the sound and the sound is not played

if i do it like this it will not work
  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red) types a chat message containing s as An exact match
    • Conditions
    • Actions
      • Set SOUND[1] = LightningBolt1 <gen>
      • Sound - Play SOUND[1]
      • Sound - Destroy SOUND[1]
and if it is like this it will work :hohum:
  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red) types a chat message containing s as An exact match
    • Conditions
    • Actions
      • Set SOUND[1] = LightningBolt1 <gen>
      • Sound - Play SOUND[1]
 
Level 17
Joined
Mar 2, 2009
Messages
332
you can do it like this...... when you play sound you can count down timer ....and new trigger where event is timer-expires.... and then you remove leak in that trigger

and i saw you are croatian.....me too (ja takoder, jbga nemoj pricat hrvatski ne smi se...)...dont speak croatian it is forbidden...
 
Level 11
Joined
Dec 31, 2007
Messages
780
isnt there an option like "destroy sound after fading"?... or was it stop sound after fading? i dont remember

ive never tried saving the sound into another variable and then removing it, but i think that one day somebody told me that global sound variables (the ones that you set in the sound editor) do not leak. But im not sure
 
do waits create leak?

im pretty sure this trigger is leaking since it's causing the lag

  • Skip Player1
    • Events
      • Unit - A unit enters Move1 <gen>
    • Conditions
    • Actions
      • Wait 0.50 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units in (Playable map area) matching (((Unit-type of (Matching unit)) Equal to Control Tower) and ((Owner of (Matching unit)) Equal to Player 1 (Red))))) Equal to 0
        • Then - Actions
          • Set Start = (Random point in Start2 <gen>)
          • Unit - Move (Triggering unit) instantly to Start
          • Custom script: call RemoveLocation(udg_Start)
        • Else - Actions
 
Last edited:
Level 14
Joined
Mar 4, 2009
Messages
1,156
do waits create leak?

im pretty sure this trigger is leaking since it's causing the lag


  • Skip Player1
    • Events
      • Unit - A unit enters Move1 <gen>
    • Conditions
    • Actions
      • Wait 0.50 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units in (Playable map area) matching (((Unit-type of (Matching unit)) Equal to Control Tower) and ((Owner of (Matching unit)) Equal to Player 1 (Red))))) Equal to 0
        • Then - Actions
          • Set Start = (Random point in Start2 <gen>)
          • Unit - Move (Triggering unit) instantly to Start
          • Custom script: call RemoveLocation(udg_Start)
        • Else - Actions
I think you need to set entering unit with a variable when you use waits but you must not change the veriable before 0.5 sec
set UNIT = entering unit
wait 0.5 sec
move UNIT

You must remove the unit group leak

set GOODGROUP = (group that you want)
do whatever you want with the GOODGROUP (you can do it more times)
Custom script:call DestroyGroup8udg_GOODGROUP)

or

Custom script:set bj_wantDestroyGroup = true
do whatever you want with any unit group
(you can do it once and you must use the Custom script again)
 
ah, so, Number of units in "GoodGroup" = 0?

after setting it?

EDIT: it still lags.

  • Skip Player1
    • Events
      • Unit - A unit enters Move1 <gen>
    • Conditions
    • Actions
      • Wait 0.50 seconds
      • Set Creeps = (Units in (Playable map area) matching (((Unit-type of (Matching unit)) Equal to Control Tower) and ((Owner of (Matching unit)) Equal to Player 1 (Red))))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in Creeps) Equal to 0
        • Then - Actions
          • Set Start = (Random point in Start2 <gen>)
          • Unit - Move (Triggering unit) instantly to Start
          • Custom script: call RemoveLocation(udg_Start)
        • Else - Actions
      • Custom script: call DestroyGroup(udg_Creeps)
 
Last edited:
yeah.

Btw, there are 8 triggers each of these and the one above.

but the lag only happens when massive (like 20) units are spawned. then every time they move instantly, it will spike madly

  • Movement1
    • Events
      • Unit - A unit enters Move1 <gen>
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 11 (Dark Green)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Custom value of (Triggering unit)) Not equal to 0
        • Then - Actions
          • Set End = (Random point in End1 <gen>)
          • Unit - Order (Triggering unit) to Move To End
          • Custom script: call RemoveLocation(udg_End)
        • Else - Actions
          • Set Start = (Random point in Start2 <gen>)
          • Unit - Move (Triggering unit) instantly to Start
          • Custom script: call RemoveLocation(udg_Start)
(move1 and start1 would be ontop of eachother, but move1 is bigger so that the creeps will always be inside it when spawned in start1)
 
Level 8
Joined
Sep 24, 2007
Messages
300
  • Speical Effect
  • Events
  • Unit - A unit Starts the effect of an ability
  • Conditions
  • (Ability being cast) Equal to Some Spell
  • Actions
  • Set Point = (Position of (Triggering unit))
  • Special Effect - Create a special effect at Point using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
  • Special Effect - Destroy (Last created special effect)
Do I have to store s. effect in variable and then destroy it or is it ok this way?

I am a bit confused, because leak checker reports a leak, even if I destroy it.

trigger
  • onehitkill
    • Events
      • Unit - A unit Begins casting an ability
      • Unit - A unit Is issued an order targeting an object
    • Conditions
    • Actions
      • Set TempLoc[19] = (Position of (Target unit of issued order))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is in onehitkill) Equal to True
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Target unit of issued order) is in godmode) Equal to False
            • Then - Actions
              • Special Effect - Create a special effect at TempLoc[19] using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
              • Unit - Kill (Target unit of issued order)
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Target unit of ability being cast) is in godmode) Equal to False
            • Then - Actions
              • Special Effect - Create a special effect at TempLoc[19] using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
              • Unit - Kill (Target unit of ability being cast)
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
        • Else - Actions
      • Custom script: call RemoveLocation(udg_TempLoc[19])
Leak Checker
(Line: 16) (Word: 3) Special Effect Leak
Special Effect - Create a special effect at TempLoc[19] using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
Special Effect - ^Leak

(Line: 24) (Word: 3) Special Effect Leak
Special Effect - Create a special effect at TempLoc[19] using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
Special Effect - ^Leak

Scan Complete
Location leaks: 0
Special Effect leaks: 2
Lightning leaks: 0
Unit Group leaks: 0
Player Group leaks: 0

Variables
TempLoc[19] : (Line: 7) Location - Removed: Yes

Summary
Total Leaks: 2
Unremoved Variables: 0
Scan duration: 0 seconds
Total Lines Scanned: 30
Total Words Scanned: 189


edit: another one
Why this leaks??
  • MS
    • Events
      • Player - Player 1 (Red) types a chat message containing -ms as An exact match
      • Player - Player 2 (Blue) types a chat message containing -ms as An exact match
      • Player - Player 3 (Teal) types a chat message containing -ms as An exact match
      • Player - Player 4 (Purple) types a chat message containing -ms as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -ms as An exact match
      • Player - Player 6 (Orange) types a chat message containing -ms as An exact match
      • Player - Player 7 (Green) types a chat message containing -ms as An exact match
      • Player - Player 8 (Pink) types a chat message containing -ms as An exact match
      • Player - Player 9 (Gray) types a chat message containing -ms as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -ms as An exact match
    • Conditions
    • Actions
      • Set TempGroup[6] = (Units owned by (Triggering player))
      • Unit Group - Pick every unit in TempGroup[6] and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is A Hero) Equal to True
            • Then - Actions
              • Set MSHero[(Player number of (Triggering player))] = (Picked unit)
              • Set TempPGroup[2] = (Player group((Triggering player)))
              • Game - Display to TempPGroup[2] the text: (String((Current movement speed of MSHero[(Player number of (Triggering player))])))
            • Else - Actions
      • Custom script: call DestroyGroup(udg_TempGroup[6])
      • Custom script: call DestroyForce(udg_TempPGroup[2])
 
Level 8
Joined
Sep 24, 2007
Messages
300
Still reports a leak.

Tried to put on first place and after group set, but same result
  • MS
    • Events
      • Player - Player 1 (Red) types a chat message containing -ms as An exact match
      • Player - Player 2 (Blue) types a chat message containing -ms as An exact match
      • Player - Player 3 (Teal) types a chat message containing -ms as An exact match
      • Player - Player 4 (Purple) types a chat message containing -ms as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -ms as An exact match
      • Player - Player 6 (Orange) types a chat message containing -ms as An exact match
      • Player - Player 7 (Green) types a chat message containing -ms as An exact match
      • Player - Player 8 (Pink) types a chat message containing -ms as An exact match
      • Player - Player 9 (Gray) types a chat message containing -ms as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -ms as An exact match
    • Conditions
    • Actions
      • Set TempPGroup[2] = (Player group((Triggering player)))
      • Set TempGroup[6] = (Units owned by (Triggering player))
      • Unit Group - Pick every unit in TempGroup[6] and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is A Hero) Equal to True
            • Then - Actions
              • Set MSHero[(Player number of (Triggering player))] = (Picked unit)
              • Game - Display to TempPGroup[2] the text: (String((Current movement speed of MSHero[(Player number of (Triggering player))])))
            • Else - Actions
      • Custom script: call DestroyGroup(udg_TempGroup[6])
      • Custom script: call DestroyForce(udg_TempPGroup[2])
(Line: 15) (Word: 3) Player Group Leak
Set TempPGroup[2] = (Player group((Triggering player)))
Set TempPGroup[2] = ^Leak

Scan Complete
Location leaks: 0
Special Effect leaks: 0
Lightning leaks: 0
Unit Group leaks: 0
Player Group leaks: 1

Variables
TempGroup[6] : (Line: 16) Unit Group - Removed: Yes

Summary
Total Leaks: 1
Unremoved Variables: 0
Scan duration: 0 seconds
Total Lines Scanned: 28
Total Words Scanned: 246
Fixing Memory Leaks: http://world-editor-tutorials.thehelper.net/cat_usersubmit.php?view=27219
 
Level 11
Joined
Dec 31, 2007
Messages
780
actually leak checker is correct

you are leaking here Player group((Triggering player)

that function creates a player group from triggering player and you store the player group created into a variable, but then you destroy the variable but not the first player group created... instead of that you should do it this way

add triggering player to TempPGroup[2]

and then you can destroy it safely ;)
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
actually leak checker is correct

you are leaking here Player group((Triggering player)

that function creates a player group from triggering player and you store the player group created into a variable, but then you destroy the variable but not the first player group created... instead of that you should do it this way

add triggering player to TempPGroup[2]

and then you can destroy it safely ;)

and then you can kiss your trigger goodbie as you will be adding a player to a null group(force).


Only one group(force) is created and one is destroyed.
 
Level 11
Joined
Dec 31, 2007
Messages
780
the jass function for this "(Player group((Triggering player)))" isnt creating a player group?

something like this

JASS:
function GetForceOfPlayer takes player whichPlayer returns force
    local force f = CreateForce()
    call ForceAddPlayer(f, whichPlayer)
    return f
endfunction
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
the jass function for this "(Player group((Triggering player)))" isnt creating a player group?

something like this

JASS:
function GetForceOfPlayer takes player whichPlayer returns force
    local force f = CreateForce()
    call ForceAddPlayer(f, whichPlayer)
    return f
endfunction

Yes...
1 group is created and then ultimately destroyed by the custom script.
 
Level 11
Joined
Dec 31, 2007
Messages
780
ok then my bad sry:sad:

EDIT: i still have a doubt

if you create a player group here

JASS:
function GetForceOfPlayer takes player whichPlayer returns force
    local force f = CreateForce()
    call ForceAddPlayer(f, whichPlayer)
    return f
endfunction

and you create another here

  • Set TempPGroup[2] = (Player group((Triggering player)))
then you destroy the seconds one with this line

  • Custom script: call DestroyForce(udg_TempPGroup[2])
when do you destroy the first created player group?

im sry to keep bothering with this but perhaps iam missing something

EDIT2: ive been trying to lag my PC with that kind of leak and this is actually making it lag (dunno if it is because of the high numbers ive chosen or the leak itself)
 

Attachments

  • lag.w3x
    16.1 KB · Views: 111
Last edited:
Top