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!
I asked another question above^ I need to add an effect to my ability, best do to that via trigger or how would I add the effect to my ability, I couldn't seem to get it working. And also the mouse cursor when ability is selected is invisible.
Set SphereBlinkTarget = (Target point of ability being cast)
Set SphereBlinkMagnitude = (Distance between (Position of (Triggering unit)) and SphereBlinkTarget)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Terrain pathing at (Target point of ability being cast) of type Buildability is off) Equal to True
SphereBlinkMagnitude Greater than or equal to 150.00
(Ability being cast) Equal to Sphere of Doom Blink Custom
Then - Actions
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
SphereBlinkMagnitude Greater than or equal to 150.00
(Ability being cast) Equal to Sphere of Doom Blink Custom
Then - Actions
Item - Create Tome of Experience at ((Target point of ability being cast) offset by ((Distance between (Target point of ability being cast) and (Position of (Triggering unit))) - 175.00) towards (Angle from (Target point of ability being cast) to (Position of (Triggering unit))) degrees)
Unit - Move (Triggering unit) instantly to ((Target point of ability being cast) offset by ((Distance between (Target point of ability being cast) and (Position of (Triggering unit))) - 175.00) towards (Angle from (Target point of ability being cast) to (Position of (Triggering unit))) degrees)
Unit - Move (Triggering unit) instantly to (Position of (Last created item))
Unit - Move (Triggering unit) instantly to (Target point of ability being cast)
Does this leak^ ? All the tutorials I've looked at it seems leaks are just units, effects and locations? Or am I mistaken. Does any variable that stores information leak? Like my real variable that stores the distance between two points?
Yes it does leak. Many locations are leaked every cast. Every time you call a function that returns a new location, you will need to pass that location object to RemoveLocation to prevent it from leaking.
You do not. Real is a primitive type so creates no object to leak. Variables themselves cannot leak as they have well defined life times. Global variables are only created at map initialization and last until map end. Local variables (local keyword declared and function parameters) are created at the start of a function and last until the function call returns.
Yes. Obviously you can reuse the location object as much as you want as long as you remember to pass it to RemoveLocation before losing reference to it.
Complex types such as unit, location, group, etc are actually references to the object. The reference is in the form of a unique object identifier number which variables store as a primitive type. These references are called handles or agents. You pass these around to functions you call as arguments. When you assign a variable to a new reference, the object it previously referred to does not automatically get destroyed, hence you need to pass it as an argument to the destructor functions before losing reference to it.
It is very important to learn how to prevent triggers from leaking early on if you plan to map in Warcraft III seriously. It is much harder/more effort to discover the leaks are causing playability problems with your map and have to clean them up retrospectively then.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.