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

[General] Call Remove Location fast question

Status
Not open for further replies.
Level 15
Joined
Dec 6, 2008
Messages
345
Hi everybody,
I have just one simple question:
Have I remove locations every time i want to change the variables?
Or I can just change them like I want and then I just put the custom script (remove location) to the end of the trigger?

For example:

  • Set Point = (Position of (Triggering unit))
  • "Some action here"
  • "Some action here"
  • Custom script: call RemoveLocation(udg_Point)
  • Set Point = (Position of (Picked unit))
  • "Some action here"
  • "Some action here"
  • Custom script: call RemoveLocation(udg_Point)
OR:

  • Set Point = (Position of (Triggering unit))
  • "Some action here"
  • "Some action here"
  • Set Point = (Position of (Picked unit))
  • "Some action here"
  • "Some action here"
  • Custom script: call RemoveLocation(udg_Point)
 
Last edited:
First method.

Variables are pointers, they don't actually hold the object as some may think it would. So if you reassign it, the old object will be left in memory. That's why you have to clear it before it gets reassigned, because once you set the variable to something else, you don't have access to that old object if you ever want to remove it later. ;)
 
Status
Not open for further replies.
Top