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

[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