| Blockland Forums > Modification Help |
| Finding the distance between two points [SOLVED] |
| (1/3) > >> |
| Gamefandan:
Alright, let's speak hypothetically here. Let's say that I want to take my current position and the position of another person and then find the distance between us. I am aware of the formula to find the distance between two points, however I would like to know how I would go about doing it in Blockland. The reason for my wanting to know this shall remain unknown to anyone but myself for the time being. I greatly appreciate all, if any, help. |
| Nexus:
vectordist("x y z", "x y z"); Also msqrt(mpow(x, 2) + mpow(y, 2) + mpow(z, 2)); |
| Gamefandan:
--- Quote from: Nexus on September 07, 2011, 06:59:44 PM ---vectordist("x y z", "x y z"); Also msqrt(mpow(x, 2) + mpow(y, 2) + mpow(z, 2)); --- End quote --- Yeah that basically solved all my problems, thanks. |
| Gamefandan:
Ah, yes. %bot.pathtime[%ArgB] = vectordist(%bot.pathpoint[%m],%bot.gettransform())/%bot.MaxForwardSpeed; This will be perfect. |
| phflack:
seeing how long a bot will take to scurry somewhere? i wonder what that could be used for |
| Navigation |
| Message Index |
| Next page |