Anski Posted January 2, 2016 Share Posted January 2, 2016 (edited) Hi, is it possible to know the distance between 2 units? condition : unit1 (helico player) distance unit2 (soldier or static object) ---> action ... ty edit : for example distance is : distance > 100, distance < 100, ... Edited January 2, 2016 by Anski Link to comment Share on other sites More sharing options...
Grumpy Old Man Posted January 2, 2016 Share Posted January 2, 2016 You could use the old school approach of calculating the distance between two 2d vectors, or use MIST for it, since MIST already has a function for that. Old school approach would be to get the 2d points of both units, then use the following: point1 = {x1,y1} point2 = {x2,y2} xd = x2-x1 yd = y2-y1 distance = squareroot(xd*xd + yd*yd) This would return the 2d distance between both points. Cheers Link to comment Share on other sites More sharing options...
Anski Posted January 2, 2016 Author Share Posted January 2, 2016 ok thank you but this is not usable in the editor. So necessarily, I have to use MIST ... and that's my problem ! :( I just looked without success MIST Link to comment Share on other sites More sharing options...
Yurgon Posted January 2, 2016 Share Posted January 2, 2016 ok thank you but this is not usable in the editor. Trigger Condition -> LUA Predicate Not entirely sure how it works, but I believe this is what you're looking for, with or without MIST. Link to comment Share on other sites More sharing options...
Anski Posted January 2, 2016 Author Share Posted January 2, 2016 Ok I'll have a look at that ... ;) ty Link to comment Share on other sites More sharing options...
Recommended Posts