Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×

Macros that calculates distance between points

1586509067

Edited 1586509121
Hello there, I am making homebrew Ship vs Ship combat macroses and I need a way to figure out distance between attacking ship and targeted ship. Distance between "Selected" and "Target" tockens basically. Typing it distance with hands each time is sad( Thanks in advance
1586513258
GiGs
Pro
Sheet Author
API Scripter
I dont believe this is possible without an API script, which requires Pro subscriber access. You can have roll20 do the calculation for you though. Here's a macro that will prompt you for the horizontal difference and the vertical difference and give you distance, rounded to 1st decimal place: &{template:default} {{name=Distance}} {{Axes=[[?{First Distance?|0}]], [[?{Second Distance?|0}]] }} {{Distance=[[round(10*[[?{First Distance?|0}**2 + ?{Second Distance?|0}**2]]**0.5)/10]] }}