• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Would this Properly work?

Status
Not open for further replies.
Level 3
Joined
Jun 3, 2013
Messages
34
  • QUESTION?
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • Unit - Move (Attacked unit) instantly to (Position of (Attacking unit))
      • Custom script: call RemoveLocation((GetUnitLoc(GetAttacker())))
Hello, I would like to ask if this is also another way in removing a Location besides using variables
like temp_loc or temp_point, then removing them Manually with:
  • Actions
    • Custom script: call RemoveLocation(udg_temp_point) or call RemoveLocation(udg_temp_loc)
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
that wont work, because invoking Position of (...) will always create new location, so the first line creates location, which you leak, and the second line with custom script will create location, which you immediately pass to RemoveLocation, so you remove that one

edit:

I will just note, that 2 locations, that have same x, y, and z are still 2 independant objects
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
afaik, the only raw points are the one, that are initialized in main(Bjs), since everything else is temporary location, including Center of (Playable map area)

And why wont your script work is, because you call CreateNUnitsAtLoc inside hook of that function, and the function will actually be called after your body of hooked function is executed, and if you call it within the hook, you basically execute the trigger, that runs your body, which executes the trigger etc etc, and that is infinte loop
 
Status
Not open for further replies.
Top