• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[General] Call Remove Location fast question

Status
Not open for further replies.
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