• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Question About Leaks

Status
Not open for further replies.
Level 16
Joined
May 1, 2008
Messages
1,605
Moin moin =)

That's a very good questions, because there are a difference... I don't know why but I notice this some time ago.
If you got for example the trigger:
  • Test
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Set TempLoc = (Center of (Playable map area))
      • Unit - Create 1 Footman for Player 1 (Red) at TempLoc facing Default building facing (270.0) degrees
      • Custom script: call RemoveLocation(udg_TempLoc)
then you have to remove the leak, else you got every 0.03 seconds a leak.

But, I can't give an example now, I notice it, that if I use this example above in a MUI trigger ( GUI in the loop trigger ) then the trigger doesn't work anymore correctly. ( Maybe other conditions ... )

So I don't know it exactly but actually you have to clear the leak in trigger you multiple use.

Greetings
~ The Bomb King > Dr. Boom
 
Level 14
Joined
Nov 18, 2007
Messages
1,084
If you set a location variable to one point only, you only need to remove it once regardless of how many times you refer to that variable in your trigger. However, if you use it for more than one location, you'll need to remove it more than once.
Ex:
This is okay:
  • Set Temp_Loc = (Position of (Triggering unit))
  • Unit - Create 1 Footman for (Owner of (Triggering unit)) at Temp_Loc facing Default building facing degrees
  • Unit - Create 1 Archer for (Owner of (Triggering unit)) at Temp_Loc facing Default building facing degrees
  • Custom script: call RemoveLocation(udg_Temp_Loc)
Not this:
  • Set Temp_Loc = (Position of (Triggering unit))
  • Unit - Create 1 Footman for (Owner of (Triggering unit)) at Temp_Loc facing Default building facing degrees
  • Set Temp_Loc = (Position of (Target unit of ability being cast))
  • Unit - Create 1 Footman for (Owner of (Triggering unit)) at Temp_Loc facing Default building facing degrees
  • Custom script: call RemoveLocation(udg_Temp_Loc)
Do this:
  • Set Temp_Loc = (Position of (Triggering unit))
  • Unit - Create 1 Footman for (Owner of (Triggering unit)) at Temp_Loc facing Default building facing degrees
  • Custom script: call RemoveLocation(udg_Temp_Loc)
  • Set Temp_Loc = (Position of (Target unit of ability being cast))
  • Unit - Create 1 Footman for (Owner of (Triggering unit)) at Temp_Loc facing Default building facing degrees
  • Custom script: call RemoveLocation(udg_Temp_Loc)
 
Status
Not open for further replies.
Top