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 .
×

Abilities choices in one macro per char. S.O.S - I tried everything 😭

Guys, how are you? I was trying (and I really failed at it) to create a macro so my char could select (from a list) what ability or what attribute check to use. Below is my DX check: I read these three links: one , two and three.  After 1 day of reading and attempts, I got nothing. I tried this one (macro): ?{Choose a Roll|ST, %{Myrius|ATT-ST}|DX,%{Myrius|ATT-DX}} * Myrius is the char name.* Myrius is the char name. To call this DX or ST check: &{template:default}{{name=Destreza}}{{@{Nome} testou sua agilidade e checou se foi rápido o suficiente pra n se ferrar = [[3d6+?{modifier|0}]]}}{{Joga por @{DX}}} Can anyone help me with that? Thank you all!
1584653171
GiGs
Pro
Sheet Author
API Scripter
You've hit probably the most common problem people encounter when they start using queries. First, a query will assuming any | is a row end, any comma is a divdor within a row, and any } (not part of an attribute/ability) is the macros end. Second, the Order of Operations: when you have something like this ?{Choose a Roll|ST, %{Myrius|ATT-ST}|DX,%{Myrius|ATT-DX}} It's natural to assume that roll20 will ask for your choice, then run that abillity. But thats not what happens. Roll20 first expands all abilities, and calls any attribute values, outs them into their place in the query, and then runs the query. So lets say this ability  %{Myrius|ATT-ST} includes some special characters, like a comma: Myrius makes a Strength attack, and shouts menacingly So you run the macro, roll20 expands the abilities, so you end up with ?{Choose a Roll|ST, Myrius makes a Strength attack, and shouts menacingly|DX,Another ability} Now look at that middle item: notice there are two commas. In a query, commas (and |, and } ) have special meanings, and so this breaks the query. To avoid this you have three options: 1) Edit the original abilities to handle the special characters following the rules here . This will often render them unusable as individual macros 2) copy their text into a single macro, and edit them there. 3) Abandon dropdowns and use a Chat Menu instead. This works with the original macros, and is really simple to implement.
Hey GiGs! Thanks a lot! You explanation was fantastic! Keep the great work. And thank you again!!! ⚔🛡 GiGs said: You've hit probably the most common problem people encounter when they start using queries. First, a query will assuming any | is a row end, any comma is a divdor within a row, and any } (not part of an attribute/ability) is the macros end. Second, the Order of Operations: when you have something like this ?{Choose a Roll|ST, %{Myrius|ATT-ST}|DX,%{Myrius|ATT-DX}} It's natural to assume that roll20 will ask for your choice, then run that abillity. But thats not what happens. Roll20 first expands all abilities, and calls any attribute values, outs them into their place in the query, and then runs the query. So lets say this ability  %{Myrius|ATT-ST} includes some special characters, like a comma: Myrius makes a Strength attack, and shouts menacingly So you run the macro, roll20 expands the abilities, so you end up with ?{Choose a Roll|ST, Myrius makes a Strength attack, and shouts menacingly|DX,Another ability} Now look at that middle item: notice there are two commas. In a query, commas (and |, and } ) have special meanings, and so this breaks the query. To avoid this you have three options: 1) Edit the original abilities to handle the special characters following the rules here . This will often render them unusable as individual macros 2) copy their text into a single macro, and edit them there. 3) Abandon dropdowns and use a Chat Menu instead. This works with the original macros, and is really simple to implement.
1585798335
GiGs
Pro
Sheet Author
API Scripter
I'm glad to hear it :)