• 🏆 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!

Question: is this leaked?

Status
Not open for further replies.
Level 6
Joined
Aug 5, 2015
Messages
202
is this leaked? if leaked, teach me the right things to do :vw_love:

  • shd blink
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Treant Hide
    • Actions
      • Unit - Create 1 Dummy for (Owner of (Casting unit)) at (Position of (Casting unit)) facing Default building facing degrees
      • Unit - Add Shadow invi to (Last created unit)
      • Unit - Set level of Shadow invi for (Last created unit) to (Level of Treant Hide for (Casting unit))
      • Unit - Order (Last created unit) to Human Sorceress - Invisibility (Casting unit)
      • Wait 2.00 seconds
      • Unit - Kill (Last created unit)
 

Attachments

  • 1.png
    1.png
    12.9 KB · Views: 59
Level 19
Joined
Oct 7, 2014
Messages
2,209
You should create a variable for the position of casting units since location leaks
after than you destroy the variable.

  • Custom script: call RemoveLocation(udg_loc)
You shouldn't use wait and then kill the dummy unit. You can generate an expiration timer for your dummy unit.

  • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
 
Level 6
Joined
Aug 5, 2015
Messages
202
if im not use variable, instead i just use:
Unit - Add a 2.00 second Generic expiration timer to (Last created unit)

its already good for my trigger?

and i dont need trigger: Unit - Kill (Last created unit)
anymore?
 
Level 19
Joined
Oct 7, 2014
Messages
2,209
if im not use variable, instead i just use:
Unit - Add a 2.00 second Generic expiration timer to (Last created unit)

You should use the variable for the location. Locations leak.

Unit - Add a 2.00 second Generic expiration timer to (Last created unit)

its already good for my trigger?

and i dont need trigger: Unit - Kill (Last created unit)
anymore?

Yes you don't need to use it. The expiration timer removes the dummy unit.
 
Level 6
Joined
Aug 5, 2015
Messages
202
thanks =) and so here we are

  • treanthide
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Treant Hide
    • Actions
      • Set TreantHidePoint = (Position of (Casting unit))
      • Unit - Create 1 Dummy for (Owner of (Casting unit)) at TreantHidePoint facing Default building facing degrees
      • Unit - Add Shadow invi to (Last created unit)
      • Unit - Set level of Shadow invi for (Last created unit) to (Level of Treant Hide for (Casting unit))
      • Unit - Order (Last created unit) to Human Sorceress - Invisibility (Casting unit)
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation(udg_TreantHidePoint)
good? ;)
 
Level 6
Joined
Aug 5, 2015
Messages
202
okay thanks guys, but i have new trigger
is this right? i want this trigger leakless and remove any units in "any condition"
i worried if the dummy stuck on map, and more stuck can caused fatal error (too many units)

or i must making variable region and making :
Set flaregroup = (Units in (Playable map area))
and the customscript: Custom script: call DestroyGroup( udg_flaregroup )


this is my current trigger:

  • wrathdummy1
    • Events
      • Time - Every 61.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Central explosion
              • (Unit-type of (Picked unit)) Equal to Flare Star Segment.
              • (Unit-type of (Picked unit)) Equal to Flare Summoner
              • (Unit-type of (Picked unit)) Equal to Flare.
              • (Unit-type of (Picked unit)) Equal to invisible Flare.
            • Then - Actions
              • Unit - Remove (Picked unit) from the game
            • Else - Actions
 
Level 6
Joined
Aug 5, 2015
Messages
202
this?

  • wrathdummy1
    • Events
      • Time - Every 61.00 seconds of game time
    • Conditions
    • Actions
      • Set flaregroup = (Units in (Playable map area))
      • Unit Group - Pick every unit in flaregroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Unit-type of (Picked unit)) Equal to Central explosion
                  • (Unit-type of (Picked unit)) Equal to Flare Star Segment.
                  • (Unit-type of (Picked unit)) Equal to Flare Summoner
                  • (Unit-type of (Picked unit)) Equal to Flare.
                  • (Unit-type of (Picked unit)) Equal to invisible Flare.
            • Then - Actions
              • Unit - Remove (Picked unit) from the game
              • Custom script: call DestroyGroup( udg_flaregroup )
            • Else - Actions
 
Level 6
Joined
Aug 5, 2015
Messages
202
:D

  • wrathdummy1
    • Events
      • Time - Every 61.00 seconds of game time
    • Conditions
    • Actions
      • Set flaregroup = (Units in (Playable map area))
      • Unit Group - Pick every unit in flaregroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Unit-type of (Picked unit)) Equal to Central explosion
                  • (Unit-type of (Picked unit)) Equal to Flare Star Segment.
                  • (Unit-type of (Picked unit)) Equal to Flare Summoner
                  • (Unit-type of (Picked unit)) Equal to Flare.
                  • (Unit-type of (Picked unit)) Equal to invisible Flare.
            • Then - Actions
              • Unit - Remove (Picked unit) from the game
            • Else - Actions
      • Custom script: call DestroyGroup( udg_flaregroup )
 
Level 6
Joined
Aug 5, 2015
Messages
202
  • wrathdummy1
    • Events
      • Time - Every 61.00 seconds of game time
    • Conditions
    • Actions
      • Set flarepoint = (Playable map area)
      • Set flaregroup = (Units in flarepoint)
      • Unit Group - Pick every unit in flaregroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Unit-type of (Picked unit)) Equal to Central explosion
                  • (Unit-type of (Picked unit)) Equal to Flare Star Segment.
                  • (Unit-type of (Picked unit)) Equal to Flare Summoner
                  • (Unit-type of (Picked unit)) Equal to Flare.
                  • (Unit-type of (Picked unit)) Equal to invisible Flare.
            • Then - Actions
              • Unit - Remove (Picked unit) from the game
            • Else - Actions
      • Custom script: call DestroyGroup( udg_flaregroup )
and this is my trigger of my pick hero after i learn few things about leak here it is

  • hero pick
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • ((Sold unit) is A Hero) Equal to True
    • Actions
      • Set Wisp = Nephalem Soul
      • Set wisp1 = (Buying unit)
      • Set WispGroup = (Units owned by (Owner of (Sold unit)))
      • Set REGION1 = (Center of Region 001 <gen>)
      • Unit Group - Pick every unit in WispGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Unit-type of (Sold unit)) Equal to Paladin
                  • (Unit-type of (Sold unit)) Equal to Cleric
                  • (Unit-type of (Sold unit)) Equal to Berserker
                  • (Unit-type of (Sold unit)) Equal to Void Lord
                  • (Unit-type of (Sold unit)) Equal to Necromancer
                  • (Unit-type of (Sold unit)) Equal to Faceless King
                  • (Unit-type of (Sold unit)) Equal to Magic Walker
                  • (Unit-type of (Sold unit)) Equal to Sky Magician
                  • (Unit-type of (Sold unit)) Equal to Scar Ancient
                  • (Unit-type of (Sold unit)) Equal to Agile Assassin
                  • (Unit-type of (Sold unit)) Equal to Crypt Guardian
            • Then - Actions
              • Unit - Add a 1.00 second Generic expiration timer to wisp1
              • Unit - Move (Sold unit) instantly to REGION1
              • Camera - Pan camera for (Owner of (Sold unit)) to REGION1 over 0.40 seconds
              • Special Effect - Create a special effect at REGION1 using Abilities\Spells\Other\Awaken\Awaken.mdl
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
      • Custom script: call RemoveLocation (udg_REGION1)
      • Custom script: call DestroyGroup(udg_WispGroup)
 
Level 6
Joined
Aug 5, 2015
Messages
202
thanks, the unit group for add hero to the group for condition

i read sound have leak too
and my trigger:
play - sound
set volume last played sound to 100%
destroy last played sound
then after that my sound doesnt play
so i cant do without being leak?
 
Level 23
Joined
Feb 6, 2014
Messages
2,466
If you created Sound via Trigger and don't need that Sound anymore, then yes your Sound leaks. If you detroyed a sound, you can't play it anymore so don't destroy it, especially Sound Created at Sound Editor. Bottomline is, destroy sounds that you will no longer play.

I said you don't need the unit group because you directly refer to the Sold Unit and not the Picked Unit.
After defining REGION1, your next code should be the If-Condition. Unit group was unnecessary.
 
Status
Not open for further replies.
Top