Distance() for coordinates only?

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.
Post Reply
Naglfar
New User
Posts: 15
Joined: Mon Apr 09, 2007 6:27 am

Distance() for coordinates only?

Post by Naglfar »

I need to calculate distance between MOBILE and STATIC in some scripts, so I can't use Distace() function, because it calculates only distance between two objects. (Solution is to put a coin item at location of static, chceck Distance(), and remove the coin... But this is a lot of additional calculations in a loop.)


How should look function like Distance(x1, y1, x2, y2)?
I've tried use this
Image
but this function does'nt work proper in some cases.


Does anyone know what calculations sholud I do to check distance betwen two coorditanes like in Distance()?
Last edited by Naglfar on Sun Apr 15, 2007 7:13 am, edited 1 time in total.
Pierce
Forum Regular
Posts: 420
Joined: Thu Feb 02, 2006 8:33 am

Post by Pierce »

You can use
CoordinateDistance(x1, y1, x2, y2);
if that is what you search.
Naglfar
New User
Posts: 15
Joined: Mon Apr 09, 2007 6:27 am

Post by Naglfar »

Next time I should check documentation precisely... Yep, thats what I need, thanks.
Post Reply