Hey, I'm trying to make a function that will either return the position of the nearest nydus worm, or other specified spawning point on map to the players hero unit.
I've tried twice, by using the distance between points function, and if then statements that are meant to take the smallest distance of those points. The map seems to be having problems with the nydus worms of which I tried two different methods (see map attached). You'll notice if you go into test document that the eastern nydus worms fine. The northern nydus only works if the player is to the right of it, but not if he is to the left of it. North and south don't matter. The western nydus doesn't work at all, and just defaults to the west spawn point instead.
I'm not sure why it does this... I created some text messages under the "Attack ultra - spawn" trigger (currently disabled). And they show the correct value for distance between points. I tried both absolute value and without, thinking that might initially be the problem. But absolute value makes no difference.
Well I went ahead and took one more stab at it b4 bed and it seems to have worked. This time I just went ahead and threw all the distances into local variables at the beginning of the function, then compared those distances in the if/then statement. Don't really know what that made a difference, but it's working now...
If curious, see the updated "Closest spawn point" function in attachment.
Hey, I'm trying to make a function that will either return the position of the nearest nydus worm, or other specified spawning point on map to the players hero unit.
I've tried twice, by using the distance between points function, and if then statements that are meant to take the smallest distance of those points. The map seems to be having problems with the nydus worms of which I tried two different methods (see map attached). You'll notice if you go into test document that the eastern nydus worms fine. The northern nydus only works if the player is to the right of it, but not if he is to the left of it. North and south don't matter. The western nydus doesn't work at all, and just defaults to the west spawn point instead.
I'm not sure why it does this... I created some text messages under the "Attack ultra - spawn" trigger (currently disabled). And they show the correct value for distance between points. I tried both absolute value and without, thinking that might initially be the problem. But absolute value makes no difference.
Well I went ahead and took one more stab at it b4 bed and it seems to have worked. This time I just went ahead and threw all the distances into local variables at the beginning of the function, then compared those distances in the if/then statement. Don't really know what that made a difference, but it's working now...
If curious, see the updated "Closest spawn point" function in attachment.