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

[5e Shaped] Clickable Ability Macro in Attacher

I would like to add a link to the attack roll of a character with a custom class to do one of several templated rolls of some conditional extra damage. I have abilities set up to do each of the rolls, and I tried to make another ability with a query to choose between them, but I couldn't get it to actually activate the roll ability. Various things I've tried either gave errors, nothing, or just printed the name. I also tried to create an attacher that would add an 'API Command Button' I think is what they're called? I have no idea what they have to do with the API, but it took forever to find the documentation. This also I have tried in various ways but it either tries to interpret it like a web link and changes the page, gives various errors, or just does nothing. So, how does one make a query to trigger one of several abilities? And, how does one format the text in an attacher to get it to act as a clickable link to trigger an ability?
1515492863
Ziechael
Forum Champion
Sheet Author
API Scripter
Hi Alex (great name by the way...), could you post your current macros (the attacher and the desired abilities to nest within it)? There is likely a certain amount of  html entity replacement needed to get it working but based on your description it should be entirely possible.
1515499925
Kryx
Pro
Sheet Author
API Scripter
Creating and Linking Character Abilities details what I believe you are asking for. You can either do it as documented for  sneak attack or something similar to the  Fighter's Superiority dice using an attacher on step 5. I would avoid using queries. They are not well supported and require a fair amount of hacks.
1515518124

Edited 1515518135
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
The wiki version of the documentation is a lot easier to follow than the old doc. Still, once I get something to work for one character, I usually use the ability as a template the next time I need someone who has a Sneak Attack or Divine Smite.
1515525958

Edited 1515526250
Thanks for the responses everyone, but in the mean time I've managed to mess something up and now trying to do any roll at all breaks everything. Now posting anything in chat doesn't show up in chat, and causes the all of the previous messages with roll templates to collapse to black bars. This happens for attacks from the sheet, using the /roll command directly in chat, just posting text in chat, anything I've tried. Reloading the tabletop page returns the previous chat messages to normal, but the next thing to get posted breaks them again. I think in reading the steps in Kryx's Superiority Dice link I've figured out the syntax for the macro links a bit better, but I can't try anything new right now due to the above problem. Assuming that is fixable, here is what I've got now as requested. In the attacher, I put [Crimson Rite](!%{CR-Query}) as the name, put a space in the freetext field or it wouldn't post anything, and checked the 'offense' box. I tried this one in many, many different ways, but this is one of them. The query ability. Again I've tried this a lot of ways and none of them worked, so here is one of them. CR-Query ?{Which Rite?|Rite of the Flame,%{rite-flame}|Rite of the Dawn,%{rite-dawn}} And the abilities I made for the actual rolls. They worked fine last night but now they're causing the same problem as everything else. rite-flame &{template:5e-shaped} {{action=1}} {{text_top=Rite of the Flame}} {{has_attack_damage=1}} {{attack_damage=[[@{rite_die}]]}} {{attack_damage_type=fire}} rite-dawn &{template:5e-shaped} {{action=1}} {{text_top=Rite of the Dawn}} {{has_attack_damage=1}} {{attack_damage=[[@{rite_die}]]}} {{attack_damage_type=radiant}} {{freetext=+[[@{wisdom_mod}]] if target is undead}} So yeah. I'm a bit lost now. This is a new campaign I'm trying to set up so if I need to scrap it, I can, but I'm using the Curse of Strahd module, so I have to update all the monster and expand their spells, and then check through them all to make sure they all converted properly. Not a trivial thing to do. Thanks for helping me out.
1515536928
Kryx
Pro
Sheet Author
API Scripter
Alex said: [Crimson Rite](!%{CR-Query})  What is the exclamation? It should use something like the following format: [Divine Smite](~-KpBU_gfHySx6uBOLOw-|repeating_classfeature_-kpbvnzeyjw0gvzkq1zs_roll) Roll20 has a wiki for their chat format. Macros can't be executed from queries like that. Maybe. I would definitely avoid queries. I would suggest never using them for anything but very simple things like determine spell level or other very simple cases. Instead have clickable options to all the possible abilities. I'd suggest fixing that and then clearing chat (from the setting page - the archive) and trying again
Ok. I've got it in a workable state now. Thank you very much Kryx for your help (and all your work on the sheet and script, both are really great.) Kryx said: What is the exclamation? The exclamation is what remained of my attempt to make sense of  the only thing I could find on the roll20 wiki relating to these macro links. I didn't see anything about using ~ until reading over your link to the Superiority Die setup. What exactly do either ! or ~ do, if it's possible to explain in a vaccum? Do you use ~ for anything you are trying to link, or just abilities, or anything on a character's sheet, or..? I ended up with [Rite of the Flame](~rite-flame) and [Rite of the Dawn](~rite-dawn) each on their own line in the freetext of an attacher. I will give up on the query for now but I feel like that would be a much nicer way to do it if it worked. I guess that's sort of how things in roll20 go... not the way that is elegant, but the way that works. Also, clearing the chat archive fixed whatever had gone horribly wrong, but I would be really curious to know how it got like that. Anyone have any idea how that happened? Thanks again for taking the time to help me out.
1515600976

Edited 1515601259
Alex said: What exactly do either ! or ~ do, if it's possible to explain in a vaccum? Exclamation marks are used with API commands . Tildes are part of Ability Command Button syntax. Do you use ~ for anything you are trying to link, or just abilities, or anything on a character's sheet All of the above: Sheet Roll calls and Ability calls share the same syntax. Also, clearing the chat archive fixed whatever had gone horribly wrong, but I would be really curious to know how it got like that. Anyone have any idea how that happened? On occasion, the Text Chat will "choke" when a Roll Template is sent to it. The Devs are aware of this bug.