
Update v0.1.3 -- added Arcs on the Edge, as well as Offset distances. (Thanks Angelo)
Update v0.1.2 -- fixed bug where WeaponArcs won't allow any paths to be changed, rather than just the Arc paths. (Thanks David M.)
Update v0.1.1 -- fixed crash when no angle or rotation are specified in the first argument. (Thanks Tim M)
WeaponArcs provides a means to add weapon arcs to tokens for visualization of range and targetable tokens.
(Space Ships by Wolf's Forge: Super Spaceships Tokens)
Commands
- --help -- Displays this help
- --add -- Creates an arc attached to each selected token.
- angle|width -- A pair of numbers in degrees. angle is the direction off of the token that the arc will be centered on. 0 is up on the token (the direction of the Rotation handle), and numbers proceed clockwise. width is the width of the arc, to be centered on the angle direction. If angle| is omitted, it is treated as 0.
- offset|range -- A pair of numbers that describe the distance where the arc begins and how long it is.
offset
moves the origin of the arc away from the default (center of the token for--add
).offset
defaults to0
.distance
is the length of the arc from the arc origin to the outer edge. You can useu
for Roll20 Units (70px),g
for grid scale units, or any ofs
,ft
,m
,km
,mi
,in
,cm
,un
,hex
, orsq
for map scale units. - fill color -- (Optional) This is the color the arc will be filled with. It must be an HTML color code and can include an opacity. It can be any of 3, 4, 6, or 8 letter formats:
#RGB
,#RGBA
,#RRGGBB
, or#RRGGBBAA
Omitting the opacity will default to99
. The color defaults to#990000
. - stroke color -- (Optional) This is the color of the line around the arc. It must be an HTML color code and can include an opacity. It can be any of 3, 4, 6, or 8 letter formats:
#RGB
,#RGBA
,#RRGGBB
, or#RRGGBBAA
Omitting the opacity will default toee
. The color defaults to#330000
. - stroke thickness -- (Optional) This is the thickness of the line around the arc. It can be any positive number and will default to
3
.
- --addEdge -- Identical to
--add
, except it starts from the edge of the token. - --remove-at -- Removes arcs at the specified angles from all selected tokens.
- --clear -- Removes all arcs attached to the selected tokens.
Instructions
Created arcs will maintain their position with regards to the token they are attached to. Moving the token will cause them to move, rotating will rotate them, etc. A token on the objects layer will have attached arcs on the map layer. A token on the gm layer will have attached arcs on the gm layer. If you move a token from the gm layer to the objects layer or vice versa, the arcs will be moved the the correct layer.
Note: Because of a bug with the toFront()
Roll20 function, arcs on the map layer will take a second to appear. Creating multiple arcs will take 1 second for each arc.
Note: Changes made using TokenMod will also be respected. Feel free to rotate, position, and move all you like.
You can specify multiple arguments on the command line:
Note: You can use the {{
and }}
to span multiple lines with your command for easier clarity and editing:
--add 90 3u #660 #00ff00cc 7
--add -90|60 2u
--add 90|60 2u
--add 180|20 8u #600a
}}
Examples
Creating an arc in the forward direction which is 15 degrees wide and 7 units long with the default colors and strokes:
Creating an arc in the forward direction, starting 3 units from the center of the token, which is 15 degrees wide and 7 units long with the default colors and strokes:
Creating an arc in the forward direction, starting at the edge of the token, which is 15 degrees wide and 7 units long with the default colors and strokes:
Creating an arc in the forward direction, starting 3 units from the edge of the token, which is 15 degrees wide and 7 units long with the default colors and strokes:
Inline rolls are supported, including rollable tables.
Removing the arc at 90 degrees.
Removing the arcs at 90, 45, 120, and 180 degrees.
Clearing all arcs.
Clearing all arcs, then adding four new ones
--clear
--add 90 3u #660 #00ff00cc 7
--add -90|60 2u
--add 90|60 2u
--add 180|20 8u #600a
}}
Github: https://github.com/shdwjk/Roll20API/blob/master/WeaponArcs/WeaponArcs.js