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

really easy question about leaks

Status
Not open for further replies.
Level 6
Joined
Apr 23, 2008
Messages
263
if i set a temporary point several times in a trigger without waits do i need to remove them each time i create them or just in the end of the trigger?
 
Level 6
Joined
Apr 23, 2008
Messages
263
i just had a little thought, let's say i have a loop wich each time checks distance between temp_point and temp_point_1 or something, do i then each loop have to remove the leak? even if i dont set the points to something else?
 
Level 12
Joined
Dec 10, 2008
Messages
850
Well if your comparing a point to another point, then you might want to save the one that your trying to get closer to until its no longer refrenced to, but if you change the other point, then remove it as the last thing in the loop, and set it at the top, since Blizzard never really thought about leaks and such in GUI
 
Level 3
Joined
Sep 11, 2004
Messages
63
I think a point should be removed after each "set" rather than after each use..
 
Huh, I read again my post and maybe it could cause some confusion...
I meant it should be removed after you don't need it anymore.

A point is like an object in the map that must be removed when it's useless. And, whenever you use "Set var = point", you're creating a new "object". So, if you don't remove it before setting the variable again, you won't be able to do so anymore.

Therefore, you have to remove/set point variables in a loop if you need to change it. If the point remains constant during the whole loop, set it before looping and remove after doing so. Like this:

  • -------- Creating 6 units in random points --------
  • For each integer (Integer A) from 1 to 6 do (Actions)
    • Loop - Actions
      • Set ThePoint = (Random point in (region))
      • Unit - Create 1 Footman at ThePoint [...]
      • Custom Script: call RemoveLocation( udg_ThePoint )
  • -------- Creating 6 units at the same point --------
  • Set ThePoint = (Random point in (region))
  • For each integer (Integer A) from 1 to 6 do (Actions)
    • Loop - Actions
      • Unit - Create 1 Footman at ThePoint [...]
  • Custom Script: call RemoveLocation( udg_ThePoint )
 
Status
Not open for further replies.
Top