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

[Solved] Removing leaks

Status
Not open for further replies.
Level 7
Joined
Jul 9, 2012
Messages
159
Hey Hive!
I have a few problems with removing points leak, when I use it as an array with a "Custom value of unit".
Here is a silly example:
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Animate Dead
  • Actions
    • Set AnimateDeadUnit = (Triggering unit)
    • Set AnimateDeadPoint[(Custom value of AnimateDeadUnit)] = (Position of AnimateDeadUnit)
    • Custom script: call RemoveLocation(udg_AnimateDeadPoint[?????])
What text should I write in the custom script to remove the point when i'm using "Custom Value of Unit"? :)
btw, sorry for my bad grammar.
 
Level 25
Joined
Sep 26, 2009
Messages
2,381
You save custom value into integer variable, so you can call it later - like this:

  • Actions
    • Set AnimateDeadUnit = (Triggering unit)
    • Set Index = (Custom value of AnimateDeadUnit)
    • Set AnimateDeadPoint[Index] = (Position of AnimateDeadUnit)
    • Custom script: call RemoveLocation(udg_AnimateDeadPoint[udg_Index])
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
This would also do the trick, but the method of Nichilus is he one I'd recommend.

  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Animate Dead
  • Actions
    • Set AnimateDeadUnit = (Triggering unit)
    • Set AnimateDeadPoint[(Custom value of AnimateDeadUnit)] = (Position of AnimateDeadUnit)
    • Custom script: call RemoveLocation(udg_AnimateDeadPoint[GetUnitUserData(udg_AnimateDeadUnit)])
 
Status
Not open for further replies.
Top