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 .
×
Create a free account

Attack Range Auras

Hi, guys... Wondering if something has been made to do this or make it possible to do this--hadn't seen anything in a search of forums and the repository, but I might not know what I'm looking for. :-P What I'm looking to do is use an API script (assuming that's even necessary...and assuming it's possible) to use character auras to show the potential range of an attack when the attack ability is initiated on a character. Effectively, I think what I need is a line of code I'd input at the start of an ability that sets the aura to show up before the player clicks on a target, and then a second line that sets the aura to disappear once the rest of the ability has run. Theoretically. O_O So basically it would be: Player clicks on ability Show aura Player selects target Rolls are run Results are shown Aura disappears Ability ends I guess the script would need to include input fields for the aura size and maybe for the color (that way different colors could be used for attacks or healing, maybe). The aura size is the main thing, though. Ideally maybe it could also be able to set either aura 1 or aura 2 so that I could use aura 2 to display the range where you can still attack but at a penalty. It would need to be usable by players and GM so that I can put it into abilities the players would be clicking. Is there anything out there already that could do this that I'm just missing? My apologies if this is obvious. O_O
1425314346

Edited 1425314508
The Aaron
Pro
API Scripter
So, 2 things: Because of when targeting happens, you would not be able to toggle this on and off with the same macro. All the parameter substitutions occur first, so @{attribute}, ?{query}, etc would be changed to their respective values before any lines are executed, then all the lines are executed at once. You can do the rest of this with the TokenMod script: On (ten unit radius, red aura all players can see): !token-mod --set aura1_color|#ff0000 aura1_radius|10 --on showplayers_aura1 Off: !token-mod --set aura1_radius|
1425315779
Ziechael
Forum Champion
Sheet Author
API Scripter
Thanks for asking this, and thanks Aaron for answering... only just realised i could use your TokenMod script to set the auras to toggle for showing incremental range for my range players and then set them up a token action to toggle it on and off for quick range finding! Yey!
1425317582
The Aaron
Pro
API Scripter
=D There is actually a script out there that does this automatically for a specific starwars game on the tokens turn. It could be modified probably, but it made some assumptions about the ranges that might not be easy to get around.
Thanks, TheAaron. :-) I'll definitely look into that script (geez, you're prolific!). So if I'm understanding that right, you're saying that clicking the button would ask for a target before the aura showed up, even if the aura line was listed before the line asking for a target, correct?
Ohmygosh, I just realized you can use that to trigger status markers on tokens, can't you? That's something else I've been looking for...awesome. How did I miss this? O_O
1425326985
The Aaron
Pro
API Scripter
Robert M. said: Thanks, TheAaron. :-) I'll definitely look into that script (geez, you're prolific!). So if I'm understanding that right, you're saying that clicking the button would ask for a target before the aura showed up, even if the aura line was listed before the line asking for a target, correct? That's correct (on several counts actually.. I do have 7 kids...). =D Right, the Order of Operations is listed in the Dice Reference , but it applies to expansion in the chat in general. If you look at that listing, you can see that Roll Queries ( ?{query|default} ) occur at step 4. API commands are effectively step 6.
1425327511
The Aaron
Pro
API Scripter
Robert M. said: Ohmygosh, I just realized you can use that to trigger status markers on tokens, can't you? That's something else I've been looking for...awesome. How did I miss this? O_O Yup! That's probably my most used feature personally. Particularly the toggle option ( ! ) : !token-mod --set statusmarkers|!white-tower --ids @{target|token_id} I use this to turn off and on the tower status, which I use for marking a particular effect. Note also that you can use + and - to add and subtract a particular status, so the above could be two commands (add (which is the default if you omit and operation), then subtract): !token-mod --set statusmarkers|+white-tower --ids @{target|token_id} !token-mod --set statusmarkers|-white-tower --ids @{target|token_id} If you want to replace whatever is there already, you can use = : !token-mod --set statusmarkers|=white-tower --ids @{target|token_id} Finally, you can change the numbers on the status markers by either setting them or adding and subtracting from them, bounded to between 0 and 9: !token-mod --set statusmarkers|white-tower:3 --ids @{target|token_id} // Rook has a 3 on it !token-mod --set statusmarkers|white-tower:+2 --ids @{target|token_id} // Rook has a 5 on it !token-mod --set statusmarkers|white-tower:-1 --ids @{target|token_id} // Rook has a 4 on it !token-mod --set statusmarkers|white-tower:-100 --ids @{target|token_id} // Rook is blank (0) !token-mod --set statusmarkers|white-tower:+100 --ids @{target|token_id} // Rook is 9 !token-mod --set statusmarkers|white-tower:[[2d4]] --ids @{target|token_id} // Rook has a value between 2-8 Cheers!
The Aaron said: Robert M. said: Thanks, TheAaron. :-) I'll definitely look into that script (geez, you're prolific!). So if I'm understanding that right, you're saying that clicking the button would ask for a target before the aura showed up, even if the aura line was listed before the line asking for a target, correct? That's correct (on several counts actually.. I do have 7 kids...). =D Right, the Order of Operations is listed in the Dice Reference , but it applies to expansion in the chat in general. If you look at that listing, you can see that Roll Queries ( ?{query|default} ) occur at step 4. API commands are effectively step 6. If I'm reading that right...I assume you still couldn't get around that by, say, nesting a macro containing the instruction to show the range? i.e. #shownearbyrange (containing the TokenMod code to show the aura) All the attack stuff #hidenearbyrange (containing the TokenMod code to hide the aura)
1425328260

Edited 1425328269
The Aaron
Pro
API Scripter
Nope. Macros are expanded at step 2.
Doh. All right--so the all-in-one version probably isn't possible, but I can still think of a number of terrific uses for this. Thanks again!
1425345147

Edited 1425345523
I haven't tested it, but it looks like @{target} is valid to use within sendChat. In that case, you could have a script which activates the aura, then uses sendChat to do the roll (including desired @{target} references), with a callback to turn the aura back off and do any other cleanup/reporting. Edit: Never mind. Looks like neither @{target} nor @{selected} works within sendChat.