• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Solved] Leaks

Status
Not open for further replies.
Level 10
Joined
Jun 20, 2017
Messages
333
about leaks
1.When should I use or/and or nothing in conditions!
Example unit/unit-type comparison, if units more than 1, they are always need or any conditions are true?!
2.Item - pick every item in playable map area and do action
3.Destructible - pick every item in playable map area and do action
Should I use this for 2/3? set bj_wantDestroyGroup = true
4.Player Group. What should I use for this one without set variables?!
5.Why the first and second Visibility cannot be destroy after 55.00 seconds!
  • Lightning
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Visibility - Create an initially Enabled visibility modifier for Player 11 (Dark Green) emitting Visibility from (Center of 004 Pick Vampires <gen>) to a radius of 512.00
      • Set Visibility[1] = (Last created visibility modifier)
      • Visibility - Create an initially Enabled visibility modifier for Player 12 (Brown) emitting Visibility from (Center of 004 Pick Vampires <gen>) to a radius of 512.00
      • Set Visibility[2] = (Last created visibility modifier)
      • -------- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// --------
      • Visibility - Create an initially Enabled visibility modifier for Player 11 (Dark Green) emitting Visibility from (Center of (Playable map area)) to a radius of 1024.00
      • Visibility - Create an initially Enabled visibility modifier for Player 12 (Brown) emitting Visibility from (Center of (Playable map area)) to a radius of 1024.00
      • -------- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// --------
      • Lightning - Create a Finger of Death lightning effect from source (Position of Ruins Obelisk 6058 <gen>) to target (Position of Ruins Obelisk 6059 <gen>)
      • Set Lightning[1] = (Last created lightning effect)
      • Lightning - Create a Finger of Death lightning effect from source (Position of Ruins Obelisk 6059 <gen>) to target (Position of Ruins Obelisk 6060 <gen>)
      • Set Lightning[2] = (Last created lightning effect)
      • Lightning - Create a Finger of Death lightning effect from source (Position of Ruins Obelisk 6060 <gen>) to target (Position of Ruins Obelisk 6061 <gen>)
      • Set Lightning[3] = (Last created lightning effect)
      • Lightning - Create a Finger of Death lightning effect from source (Position of Ruins Obelisk 6061 <gen>) to target (Position of Ruins Obelisk 6062 <gen>)
      • Set Lightning[4] = (Last created lightning effect)
      • Lightning - Create a Finger of Death lightning effect from source (Position of Ruins Obelisk 6062 <gen>) to target (Position of Ruins Obelisk 6063 <gen>)
      • Set Lightning[5] = (Last created lightning effect)
      • Lightning - Create a Finger of Death lightning effect from source (Position of Ruins Obelisk 6063 <gen>) to target (Position of Ruins Obelisk 6064 <gen>)
      • Set Lightning[6] = (Last created lightning effect)
      • Lightning - Create a Finger of Death lightning effect from source (Position of Ruins Obelisk 6064 <gen>) to target (Position of Ruins Obelisk 6065 <gen>)
      • Set Lightning[7] = (Last created lightning effect)
      • Lightning - Create a Finger of Death lightning effect from source (Position of Ruins Obelisk 6065 <gen>) to target (Position of Ruins Obelisk 6058 <gen>)
      • Set Lightning[8] = (Last created lightning effect)
      • -------- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// --------
      • Wait 55.00 seconds
      • Visibility - Destroy Visibility[1]
      • Visibility - Destroy Visibility[2]
      • Lightning - Destroy Lightning[1]
      • Lightning - Destroy Lightning[2]
      • Lightning - Destroy Lightning[3]
      • Lightning - Destroy Lightning[4]
      • Lightning - Destroy Lightning[5]
      • Lightning - Destroy Lightning[6]
      • Lightning - Destroy Lightning[7]
      • Lightning - Destroy Lightning[8]
6.When I destroy the sound 1, the other sounds cannot be play!
  • Tips Humans
    • Events
      • Time - Elapsed game time is 60.00 seconds
    • Conditions
    • Actions
      • Sound - Play SecretFound <gen>
      • Set Sound[1] = (Last played sound)
      • Game - Display to PlayerGroup_Humans the text: |cffffcc00Tip:|r |c...
      • Sound - Destroy Sound[1]
      • -------- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// --------
      • Wait 30.00 seconds
      • Sound - Play SecretFound <gen>
      • Set Sound[2] = (Last played sound)
      • Game - Display to PlayerGroup_Humans the text: |cffffcc00Tip:|r |c...
      • Sound - Destroy Sound[2]
      • -------- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// --------
      • Wait 30.00 seconds
      • Sound - Play SecretFound <gen>
      • Set Sound[3] = (Last played sound)
      • Game - Display to PlayerGroup_Humans the text: |cffffcc00Tip:|r |c...
      • Sound - Destroy Sound[3]
      • -------- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// --------
      • Wait 30.00 seconds
      • Sound - Play SecretFound <gen>
      • Set Sound[4] = (Last played sound)
      • Game - Display to PlayerGroup_Humans the text: |cffffcc00Tip:|r |c...
      • Sound - Destroy Sound[4]
      • -------- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// --------
      • Wait 30.00 seconds
      • Sound - Play SecretFound <gen>
      • Set Sound[5] = (Last played sound)
      • Game - Display to PlayerGroup_Humans the text: |cffffcc00Tip:|r |c...
      • Sound - Destroy Sound[5]
      • -------- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// --------
      • Wait 30.00 seconds
      • Sound - Play SecretFound <gen>
      • Set Sound[6] = (Last played sound)
      • Game - Display to PlayerGroup_Humans the text: |cffffcc00Tip:|r |c...
      • Sound - Destroy Sound[6]
 
Last edited:
Level 12
Joined
Dec 11, 2014
Messages
662
1. Just use logic, if any of the units are acceptable then use Or(any).
2/3. Depends on if "playable map area" leaks. A simple test you could do is to reuse the trigger that has 'set bj_wantDestroyGroup = true' in it. If it works the second time then the game had no problem re-creating the 'playable map area' and all's good. If it doesn't run the second time then you don't need to use 'set bj_wantDestroyGroup = true' and 'playable map area' will work fine.
This is easy to notice when you destroy 'all players' which doesn't leak/shouldn't be destroyed.
4. You'll have to set it in a variable and destroy it afterwards.
5. Never tried messing with that action.. Are you sure there aren't some other you can use like disable/remove instead of 'destroy'
6. Pretty sure there's no need to destroy sounds
 
Level 39
Joined
Feb 27, 2007
Messages
5,023
2/3. Depends on if "playable map area" leaks.
It explicitly does not. It always returns the same rect: bj_mapInitialPlayableArea and doesn't need to be cleaned up. As far as I know there are no item group or destructable group objects that need to be cleaned either.
A simple test you could do is to reuse the trigger that has 'set bj_wantDestroyGroup = true' in it. If it works the second time then the game had no problem re-creating the 'playable map area' and all's good. If it doesn't run the second time then you don't need to use 'set bj_wantDestroyGroup = true' and 'playable map area' will work fine.
I don't think you understand what that JASS line does. It's only relevant to functions that check the wantDestroyGroup variable, and at that only works for unit groups not anything else. It's not a catchall leak-clearing line.
4.Player Group. What should I use for this one without set variables?!
It's a force variable but they are called Player Groups in GUI. You clean them with call DestroyForce(FORCE_VARIABLE).
6.When I destroy the sound 1, the other sounds cannot be play!
This is a bug with the current sound engine in 1.30+; you'll have to wait for it to be fixed in a patch.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
So if I destroy these floating text, there is no text in my map, but if I do not destroy it, it will leak ;/
It is not a leak if it is still useful. You want the floating text to persist forever, hence you do not need to ever destroy or remove it.

That said the location you create the floating text at is leaking. You can remove this location after using it to create the floating text. This will not affect the floating text since the resulting floating text does not reference the location. Since this is only 2 locations at map initialization this leak can be considered trivial and is unlikely to have a noticeable effect on performance.
 
Level 10
Joined
Jun 20, 2017
Messages
333
this should leak?!
  • Quest Menu
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Point_FloatingText[1] = (Center of 000 Heroes Pool <gen>)
      • Floating Text - Create floating text that reads Level Up (Heroes) at Point_FloatingText[1] with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Custom script: call RemoveLocation(udg_Point_FloatingText[1])
      • Set Point_FloatingText[2] = (Center of 005 AFK Pool <gen>)
      • Floating Text - Create floating text that reads AFK Pool (Safe Whi... at Point_FloatingText[2] with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Custom script: call RemoveLocation(udg_Point_FloatingText[2])
 
Level 10
Joined
Jun 20, 2017
Messages
333
  • Quest Menu
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Point_FloatingText = (Center of 000 Heroes Pool <gen>)
      • Floating Text - Create floating text that reads Level Up (Heroes) at Point_FloatingText with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Custom script: call RemoveLocation(udg_Point_FloatingText)
      • Set Point_FloatingText = (Center of 005 AFK Pool <gen>)
      • Floating Text - Create floating text that reads AFK Pool (Safe Whi... at Point_FloatingText with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Custom script: call RemoveLocation(udg_Point_FloatingText)
So I've learned what you guys said to me, and how to fix the leak, but I cannot figure out about how to destroy the visibility!?
And I don't think there is a leak!!!!!!
  • Lightning
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • Set Point_Visibility = (Center of 004 Pick Vampires <gen>)
      • Visibility - Create an initially Enabled visibility modifier for Player 11 (Dark Green) emitting Visibility from Point_Visibility to a radius of 512.00
      • Set Visibility[1] = (Last created visibility modifier)
      • Custom script: call RemoveLocation(udg_Point_Visibility)
      • Set Point_Visibility = (Center of 004 Pick Vampires <gen>)
      • Visibility - Create an initially Enabled visibility modifier for Player 12 (Brown) emitting Visibility from Point_Visibility to a radius of 512.00
      • Set Visibility[2] = (Last created visibility modifier)
      • Custom script: call RemoveLocation(udg_Point_Visibility)
      • -------- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// --------
      • Set Point_Visibility = (Center of (Playable map area))
      • Visibility - Create an initially Enabled visibility modifier for Player 11 (Dark Green) emitting Visibility from Point_Visibility to a radius of 512.00
      • Custom script: call RemoveLocation(udg_Point_Visibility)
      • Set Point_Visibility = (Center of (Playable map area))
      • Visibility - Create an initially Enabled visibility modifier for Player 12 (Brown) emitting Visibility from Point_Visibility to a radius of 512.00
      • Custom script: call RemoveLocation(udg_Point_Visibility)
      • -------- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// --------
      • Set Point_Lightning[1] = (Position of Acolyte 0038 <gen>)
      • Set Point_Lightning[2] = (Position of Acolyte 0018 <gen>)
      • Lightning - Create a Finger of Death lightning effect from source Point_Lightning[1] to target Point_Lightning[2]
      • Set Lightning[1] = (Last created lightning effect)
      • Custom script: call RemoveLocation(udg_Point_Lightning[1])
      • Custom script: call RemoveLocation(udg_Point_Lightning[2])
      • Set Point_Lightning[3] = (Position of Acolyte 0018 <gen>)
      • Set Point_Lightning[4] = (Position of Acolyte 0041 <gen>)
      • Lightning - Create a Finger of Death lightning effect from source Point_Lightning[3] to target Point_Lightning[4]
      • Set Lightning[2] = (Last created lightning effect)
      • Custom script: call RemoveLocation(udg_Point_Lightning[3])
      • Custom script: call RemoveLocation(udg_Point_Lightning[4])
      • Set Point_Lightning[5] = (Position of Acolyte 0041 <gen>)
      • Set Point_Lightning[6] = (Position of Acolyte 0022 <gen>)
      • Lightning - Create a Finger of Death lightning effect from source Point_Lightning[5] to target Point_Lightning[6]
      • Set Lightning[3] = (Last created lightning effect)
      • Custom script: call RemoveLocation(udg_Point_Lightning[5])
      • Custom script: call RemoveLocation(udg_Point_Lightning[6])
      • Set Point_Lightning[7] = (Position of Acolyte 0022 <gen>)
      • Set Point_Lightning[8] = (Position of Acolyte 0043 <gen>)
      • Lightning - Create a Finger of Death lightning effect from source Point_Lightning[7] to target Point_Lightning[8]
      • Set Lightning[4] = (Last created lightning effect)
      • Custom script: call RemoveLocation(udg_Point_Lightning[7])
      • Custom script: call RemoveLocation(udg_Point_Lightning[8])
      • Set Point_Lightning[9] = (Position of Acolyte 0043 <gen>)
      • Set Point_Lightning[10] = (Position of Acolyte 0038 <gen>)
      • Lightning - Create a Finger of Death lightning effect from source Point_Lightning[9] to target Point_Lightning[10]
      • Set Lightning[5] = (Last created lightning effect)
      • Custom script: call RemoveLocation(udg_Point_Lightning[9])
      • Custom script: call RemoveLocation(udg_Point_Lightning[10])
      • -------- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// --------
      • Set Point_Lightning[11] = (Position of Acolyte 0044 <gen>)
      • Set Point_Lightning[12] = (Position of Acolyte 0040 <gen>)
      • Lightning - Create a Finger of Death lightning effect from source Point_Lightning[11] to target Point_Lightning[12]
      • Lightning - Change color of (Last created lightning effect) to (0.00 0.00 100.00) with 1.00 alpha
      • Set Lightning[6] = (Last created lightning effect)
      • Custom script: call RemoveLocation(udg_Point_Lightning[11])
      • Custom script: call RemoveLocation(udg_Point_Lightning[12])
      • Set Point_Lightning[13] = (Position of Acolyte 0040 <gen>)
      • Set Point_Lightning[14] = (Position of Acolyte 0020 <gen>)
      • Lightning - Create a Finger of Death lightning effect from source Point_Lightning[13] to target Point_Lightning[14]
      • Lightning - Change color of (Last created lightning effect) to (0.00 0.00 100.00) with 1.00 alpha
      • Set Lightning[7] = (Last created lightning effect)
      • Custom script: call RemoveLocation(udg_Point_Lightning[13])
      • Custom script: call RemoveLocation(udg_Point_Lightning[14])
      • Set Point_Lightning[15] = (Position of Acolyte 0020 <gen>)
      • Set Point_Lightning[16] = (Position of Acolyte 0042 <gen>)
      • Lightning - Create a Finger of Death lightning effect from source Point_Lightning[15] to target Point_Lightning[16]
      • Lightning - Change color of (Last created lightning effect) to (0.00 0.00 1.00) with 1.00 alpha
      • Set Lightning[8] = (Last created lightning effect)
      • Custom script: call RemoveLocation(udg_Point_Lightning[15])
      • Custom script: call RemoveLocation(udg_Point_Lightning[16])
      • Set Point_Lightning[17] = (Position of Acolyte 0042 <gen>)
      • Set Point_Lightning[18] = (Position of Acolyte 0036 <gen>)
      • Lightning - Create a Finger of Death lightning effect from source Point_Lightning[17] to target Point_Lightning[18]
      • Lightning - Change color of (Last created lightning effect) to (0.00 0.00 1.00) with 1.00 alpha
      • Set Lightning[9] = (Last created lightning effect)
      • Custom script: call RemoveLocation(udg_Point_Lightning[17])
      • Custom script: call RemoveLocation(udg_Point_Lightning[18])
      • Set Point_Lightning[19] = (Position of Acolyte 0036 <gen>)
      • Set Point_Lightning[20] = (Position of Acolyte 0044 <gen>)
      • Lightning - Create a Finger of Death lightning effect from source Point_Lightning[19] to target Point_Lightning[20]
      • Lightning - Change color of (Last created lightning effect) to (0.00 0.00 1.00) with 1.00 alpha
      • Set Lightning[10] = (Last created lightning effect)
      • Custom script: call RemoveLocation(udg_Point_Lightning[19])
      • Custom script: call RemoveLocation(udg_Point_Lightning[20])
      • -------- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// --------
      • Wait 50.00 seconds
      • Visibility - Destroy Visibility[1]
      • Visibility - Destroy Visibility[2]
      • Lightning - Destroy Lightning[1]
      • Lightning - Destroy Lightning[2]
      • Lightning - Destroy Lightning[3]
      • Lightning - Destroy Lightning[4]
      • Lightning - Destroy Lightning[5]
      • Lightning - Destroy Lightning[6]
      • Lightning - Destroy Lightning[7]
      • Lightning - Destroy Lightning[8]
      • Lightning - Destroy Lightning[9]
      • Lightning - Destroy Lightning[10]
      • Unit - Kill Acolyte 0018 <gen>
      • Unit - Kill Acolyte 0020 <gen>
      • Unit - Kill Acolyte 0022 <gen>
      • Unit - Kill Acolyte 0036 <gen>
      • Unit - Kill Acolyte 0038 <gen>
      • Unit - Kill Acolyte 0040 <gen>
      • Unit - Kill Acolyte 0041 <gen>
      • Unit - Kill Acolyte 0042 <gen>
      • Unit - Kill Acolyte 0043 <gen>
      • Unit - Kill Acolyte 0044 <gen>
      • -------- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// --------
      • Special Effect - Create a special effect attached to the origin of Acolyte 0018 <gen> using Objects\Spawnmodels\Undead\UndeadDissipate\UndeadDissipate.mdl
      • Set SpecialEffect[1] = (Last created special effect)
      • Special Effect - Destroy SpecialEffect[1]
      • Special Effect - Create a special effect attached to the origin of Acolyte 0018 <gen> using Abilities\Spells\Human\MarkOfChaos\MarkOfChaosTarget.mdl
      • Set SpecialEffect[2] = (Last created special effect)
      • Special Effect - Destroy SpecialEffect[2]
      • Special Effect - Create a special effect attached to the origin of Acolyte 0020 <gen> using Objects\Spawnmodels\Undead\UndeadDissipate\UndeadDissipate.mdl
      • Set SpecialEffect[3] = (Last created special effect)
      • Special Effect - Destroy SpecialEffect[3]
      • Special Effect - Create a special effect attached to the origin of Acolyte 0020 <gen> using Abilities\Spells\Human\MarkOfChaos\MarkOfChaosTarget.mdl
      • Set SpecialEffect[4] = (Last created special effect)
      • Special Effect - Destroy SpecialEffect[4]
      • Special Effect - Create a special effect attached to the origin of Acolyte 0022 <gen> using Objects\Spawnmodels\Undead\UndeadDissipate\UndeadDissipate.mdl
      • Set SpecialEffect[5] = (Last created special effect)
      • Special Effect - Destroy SpecialEffect[5]
      • Special Effect - Create a special effect attached to the origin of Acolyte 0022 <gen> using Abilities\Spells\Human\MarkOfChaos\MarkOfChaosTarget.mdl
      • Set SpecialEffect[6] = (Last created special effect)
      • Special Effect - Destroy SpecialEffect[6]
      • Special Effect - Create a special effect attached to the origin of Acolyte 0036 <gen> using Objects\Spawnmodels\Undead\UndeadDissipate\UndeadDissipate.mdl
      • Set SpecialEffect[7] = (Last created special effect)
      • Special Effect - Destroy SpecialEffect[7]
      • Special Effect - Create a special effect attached to the origin of Acolyte 0036 <gen> using Abilities\Spells\Human\MarkOfChaos\MarkOfChaosTarget.mdl
      • Set SpecialEffect[8] = (Last created special effect)
      • Special Effect - Destroy SpecialEffect[8]
      • Special Effect - Create a special effect attached to the origin of Acolyte 0038 <gen> using Objects\Spawnmodels\Undead\UndeadDissipate\UndeadDissipate.mdl
      • Set SpecialEffect[9] = (Last created special effect)
      • Special Effect - Destroy SpecialEffect[9]
      • Special Effect - Create a special effect attached to the origin of Acolyte 0038 <gen> using Abilities\Spells\Human\MarkOfChaos\MarkOfChaosTarget.mdl
      • Set SpecialEffect[10] = (Last created special effect)
      • Special Effect - Destroy SpecialEffect[10]
      • Special Effect - Create a special effect attached to the origin of Acolyte 0040 <gen> using Objects\Spawnmodels\Undead\UndeadDissipate\UndeadDissipate.mdl
      • Set SpecialEffect[11] = (Last created special effect)
      • Special Effect - Destroy SpecialEffect[11]
      • Special Effect - Create a special effect attached to the origin of Acolyte 0040 <gen> using Abilities\Spells\Human\MarkOfChaos\MarkOfChaosTarget.mdl
      • Set SpecialEffect[12] = (Last created special effect)
      • Special Effect - Destroy SpecialEffect[12]
      • Special Effect - Create a special effect attached to the origin of Acolyte 0041 <gen> using Objects\Spawnmodels\Undead\UndeadDissipate\UndeadDissipate.mdl
      • Set SpecialEffect[13] = (Last created special effect)
      • Special Effect - Destroy SpecialEffect[13]
      • Special Effect - Create a special effect attached to the origin of Acolyte 0041 <gen> using Abilities\Spells\Human\MarkOfChaos\MarkOfChaosTarget.mdl
      • Set SpecialEffect[14] = (Last created special effect)
      • Special Effect - Destroy SpecialEffect[14]
      • Special Effect - Create a special effect attached to the origin of Acolyte 0042 <gen> using Objects\Spawnmodels\Undead\UndeadDissipate\UndeadDissipate.mdl
      • Set SpecialEffect[15] = (Last created special effect)
      • Special Effect - Destroy SpecialEffect[15]
      • Special Effect - Create a special effect attached to the origin of Acolyte 0042 <gen> using Abilities\Spells\Human\MarkOfChaos\MarkOfChaosTarget.mdl
      • Set SpecialEffect[16] = (Last created special effect)
      • Special Effect - Destroy SpecialEffect[16]
      • Special Effect - Create a special effect attached to the origin of Acolyte 0043 <gen> using Objects\Spawnmodels\Undead\UndeadDissipate\UndeadDissipate.mdl
      • Set SpecialEffect[17] = (Last created special effect)
      • Special Effect - Destroy SpecialEffect[17]
      • Special Effect - Create a special effect attached to the origin of Acolyte 0043 <gen> using Abilities\Spells\Human\MarkOfChaos\MarkOfChaosTarget.mdl
      • Set SpecialEffect[18] = (Last created special effect)
      • Special Effect - Destroy SpecialEffect[18]
      • Special Effect - Create a special effect attached to the origin of Acolyte 0044 <gen> using Objects\Spawnmodels\Undead\UndeadDissipate\UndeadDissipate.mdl
      • Set SpecialEffect[19] = (Last created special effect)
      • Special Effect - Destroy SpecialEffect[19]
      • Special Effect - Create a special effect attached to the origin of Acolyte 0044 <gen> using Abilities\Spells\Human\MarkOfChaos\MarkOfChaosTarget.mdl
      • Set SpecialEffect[20] = (Last created special effect)
      • Special Effect - Destroy SpecialEffect[20]
 
Level 6
Joined
Jun 4, 2017
Messages
172
Is (facing) somewhere does leak?

Yes, you create a new location leak when you use (Position of (Triggering unit))


Also the item will leak?!

The trigger isn't MUI and it will leak an item and a location if some other unit will use the ability in those 30 seconds(also, it will in any case leak a location because you are removing "Point_Unit" while you should remove "Point_Item").


So I've learned what you guys said to me, and how to fix the leak, but I cannot figure out about how to destroy the visibility!?
And I don't think there is a leak!!!!!!

I'm not sure how to destroy visibility, however you can try to disable it before removing it. However the special effects variables are pointless, there is no need of variables if you just create and immediately after you use "Destroy (Last created special effect)".
There is no reason in using so many point arrays, just as you did with the Point_Visibility(removing the value and then give another value) you can do the same thing with Point_Lightning by just using Point_Lightning[1] and Point_Lightning[2].
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
If I do not use the variables, then some of them will be destroyed, some of them not.
Destroying a special effect will run the models death animation. Hence why it works for some (ones without death animations) and not for others (ones with death animations).
than where does it know? which one is right to be destroyed?!
I am not even sure what you are asking...

A variable is a storage location for data. An array is a variable with multiple sequential storage locations that are referenced by an integer argument.

In the case of your Quest Menu trigger there is no need to use a point array. Since you destroy the location before creating the next location the same storage space (variable) can be used. This is recommended both from a performance perspective and from a readability perspective.

Arrays are intended for when one wants to access different variables based on state or function parameters. A common example of array usage in Warcraft III is using an array to map a value to a player slot number. In such a case one can look up the value by getting the player slot number of a player, eg Triggering Player, and then using the slot number as the index of the array.

If one only uses constant array indices then one should not be using an array. Instead each constant index should be converted into a separate, uniquely named variable. This can improve both performance and maintainability.
 
Level 10
Joined
Jun 20, 2017
Messages
333
I am not even sure what you are asking...
I mean, I use more than once(SE).
I tried before, to use them without arrays, so they do not work very well.
The first trigger uses an array, because I set the first SE to num1 and destroy it as 1, so the trigger knows which one is right for destroy, and for others... and its works.
But the second trigger I set them to Last created SE, so it destroy as last one, however (last one) can be any of the SE and the triggers isn't working.
  • Special Effect - Create a special effect attached to the origin of Acolyte 0018 <gen> using Objects\Spawnmodels\Undead\UndeadDissipate\UndeadDissipate.mdl
  • Set SpecialEffect[1] = (Last created special effect)
  • Special Effect - Destroy SpecialEffect[1]
  • Special Effect - Create a special effect attached to the origin of Acolyte 0018 <gen> using Abilities\Spells\Human\MarkOfChaos\MarkOfChaosTarget.mdl
  • Set SpecialEffect[2] = (Last created special effect)
  • Special Effect - Destroy SpecialEffect[2]
  • and more......
  • Special Effect - Create a special effect attached to the origin of Acolyte 0018 <gen> using Objects\Spawnmodels\Undead\UndeadDissipate\UndeadDissipate.mdl
  • Set SpecialEffect = (Last created special effect)
  • Special Effect - Destroy (Last created special effect)
  • Special Effect - Create a special effect attached to the origin of Acolyte 0018 <gen> using Abilities\Spells\Human\MarkOfChaos\MarkOfChaosTarget.mdl
  • Set SpecialEffect = (Last created special effect)
  • Special Effect - Destroy (Last created special effect)
  • and more......
This one without variables and arrays, and does not working. but if I using something between them maybe work, like wait or use if then else for each them.
  • Special Effect - Create a special effect attached to the origin of Acolyte 0018 <gen> using Objects\Spawnmodels\Undead\UndeadDissipate\UndeadDissipate.mdl
  • Special Effect - Destroy (Last created special effect)
  • Special Effect - Create a special effect attached to the origin of Acolyte 0018 <gen> using Abilities\Spells\Human\MarkOfChaos\MarkOfChaosTarget.mdl
  • Special Effect - Destroy (Last created special effect)
  • and more......
just as you did with the Point_Visibility(removing the value and then give another value)
And this variable is not a point, is a unit variable.
  • Special Effect - Create a special effect attached to the origin of Acolyte 0018 <gen> using Objects\Spawnmodels\Undead\UndeadDissipate\UndeadDissipate.mdl
  • ((of Acolyte 0018 <gen>))
But if you mean like this?!
  • Set Unit = Acolyte 0018 <gen>
  • Special Effect - Create a special effect attached to the origin of Unit using Objects\Spawnmodels\Undead\UndeadDissipate\UndeadDissipate.mdl
  • Special Effect - Destroy (Last created special effect)
  • Unit - Remove Unit from the game
The trigger isn't MUI and it will leak an item and a location if some other unit will use the ability in those 30 seconds
Well, how to fix that?! should this work whout variable?!
  • Fake Gold Coin
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (==) Fake Gold Coin
    • Actions
      • Item - Create Gold Coins at (Target point of ability being cast)
      • Wait 30.00 seconds
      • Item - Remove (Last created item)
 
Last edited:
Level 6
Joined
Jun 4, 2017
Messages
172
If I do not use the variables, then some of them will be destroyed, some of them not.
This one without variables and arrays, and does not working. but if I using something between them maybe work, like wait or use if then else for each them.
  • Special Effect - Create a special effect attached to the origin of Acolyte 0018 <gen> using Objects\Spawnmodels\Undead\UndeadDissipate\UndeadDissipate.mdl
  • Special Effect - Destroy (Last created special effect)
  • Special Effect - Create a special effect attached to the origin of Acolyte 0018 <gen> using Abilities\Spells\Human\MarkOfChaos\MarkOfChaosTarget.mdl
  • Special Effect - Destroy (Last created special effect)
What do you mean it doesn't work? Is the effect not appearing? If that's so, it's working. the effects simply don't have any death animation.

And this variable is not a point, is a unit variable.
  • Special Effect - Create a special effect attached to the origin of Acolyte 0018 <gen> using Objects\Spawnmodels\Undead\UndeadDissipate\UndeadDissipate.mdl
  • ((of Acolyte 0018 <gen>))
I wasn't referring to that, I was referring to this:
  • Set Point_Visibility = (Center of 004 Pick Vampires <gen>)
  • Visibility - Create an initially Enabled visibility modifier for Player 11 (Dark Green) emitting Visibility from Point_Visibility to a radius of 512.00
  • Set Visibility[1] = (Last created visibility modifier)
  • Custom script: call RemoveLocation(udg_Point_Visibility)
than where does it know? which one is right to be destroyed?!
You can use this:
  • Set Point_Lightning[1] = (Position of Acolyte 0038 <gen>)
  • Set Point_Lightning[2] = (Position of Acolyte 0018 <gen>)
  • Lightning - Create a Finger of Death lightning effect from source Point_Lightning[1] to target Point_Lightning[2]
  • Set Lightning[1] = (Last created lightning effect)
  • Custom script: call RemoveLocation(udg_Point_Lightning[1])
  • Custom script: call RemoveLocation(udg_Point_Lightning[2])
  • Set Point_Lightning[1] = (Position of Acolyte 0018 <gen>)
  • Set Point_Lightning[2] = (Position of Acolyte 0041 <gen>)
  • Lightning - Create a Finger of Death lightning effect from source Point_Lightning[1] to target Point_Lightning[2]
  • Set Lightning[2] = (Last created lightning effect)
  • Custom script: call RemoveLocation(udg_Point_Lightning[1])
  • Custom script: call RemoveLocation(udg_Point_Lightning[2])
Instead of what you did:
  • Set Point_Lightning[1] = (Position of Acolyte 0038 <gen>)
  • Set Point_Lightning[2] = (Position of Acolyte 0018 <gen>)
  • Lightning - Create a Finger of Death lightning effect from source Point_Lightning[1] to target Point_Lightning[2]
  • Set Lightning[1] = (Last created lightning effect)
  • Custom script: call RemoveLocation(udg_Point_Lightning[1])
  • Custom script: call RemoveLocation(udg_Point_Lightning[2])
  • Set Point_Lightning[3] = (Position of Acolyte 0018 <gen>)
  • Set Point_Lightning[4] = (Position of Acolyte 0041 <gen>)
  • Lightning - Create a Finger of Death lightning effect from source Point_Lightning[3] to target Point_Lightning[4]
  • Set Lightning[2] = (Last created lightning effect)
  • Custom script: call RemoveLocation(udg_Point_Lightning[3])
  • Custom script: call RemoveLocation(udg_Point_Lightning[4])
And so you use only 2 points instead of 20.

Well, how to fix that?! should this work whout variable?!
MUI Triggers with Waits
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
This one without variables and arrays, and does not working. but if I using something between them maybe work, like wait or use if then else for each them.
They are not functionally the same... In one you are using the variable for destruction, in the other you are using a function.

I can tell you that it will work the same. You could try to prove me wrong with demonstration maps but I can assure you that it will be a mistake in the code and not with the concept.
Well, how to fix that?! should this work whout variable?!
Use a local variable? Warcraft III GUI is kind of trash which is why most people recommend using JASS directly so one can have access to features like local variables.

The GUI solution would be an indexing system of sorts to manage the instances in parallel.
 
Level 10
Joined
Jun 20, 2017
Messages
333
So I try this method, but I think somethings wrong! Also, when will I use this? when the event is Unit - A unit Starts the effect of an ability?!
  • Fake Gold Coin
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (==) Fake Gold Coin
    • Actions
      • Set Integer_MUI = (Integer_MUI + 1)
      • Set Point_Item = (Target point of ability being cast)
      • Item - Create Gold Coins at Point_Item
      • Set Item_Caster[Integer_MUI] = (Last created item)
      • Wait 30.00 seconds
      • Set Integer_MUI2 = (Integer_MUI2 + 1)
      • Item - Remove Item_Caster[Integer_MUI2]
      • Custom script: call RemoveLocation(udg_Point_Item)
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Integer_MUI2 Equal to (==) Integer_MUI
          • Then - Actions
            • Set Integer_MUI2 = 0
            • Set Integer_MUI = 0
          • Else - Actions
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
So I try this method, but I think somethings wrong!
I do not think the indexing logic makes any sense. You will probably need to use a local variable (JASS only feature, not available in GUI) to do what you want.

The other approach is to make it like any MUI ability and use an instancing system with a periodic trigger that counts down a duration counter for each instance and then destroys the instance when the counter reaches 0.
 
Status
Not open for further replies.
Top