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

Query works strange

Probably it is because I am doing something wrong, but can't understand what. I am making a query that works like this: "/me RESISTS ?{Wanna use Fatigue? | No,  /r {@{selected|Resistencia}d10!!6 + @{selected|Res.Fisica|max}d10!!6}k2 | Yes, /r {@selected|Resistencia}d10!!6 + @{selected|Res.Fisica|max}d10!!6 + 1d10!!6}k3} + @{selected|Resistencia|max}" What I expect is that the program should ask me to use fatigue, and the posible answers should be "No" or "Yes", and throwing some dice depending, but what I get is only one answer and that Answer is "No, /r 2d10!!6 + 0d10!!6" (The numbers 2 and 0 are okay, are the real values of "Resistencia" and "Res.Fisica|max")  What am I missing? Thank you in advance
1621726997

Edited 1621727137
Andreas J.
Forum Champion
Sheet Author
Translator
one of the problems is with how nested queries work, you liekly need to use html replacements. <a href="https://wiki.roll20.net/Macro_Guide#Nesting" rel="nofollow">https://wiki.roll20.net/Macro_Guide#Nesting</a> <a href="https://wiki.roll20.net/Macro_Guide#HTML_replacement" rel="nofollow">https://wiki.roll20.net/Macro_Guide#HTML_replacement</a> you could also simplify it to only have the query replace the changing part, not the whole thing. I'm not great at nesting queries, but something along these lines should be much closer to work. /r {@selected|Resistencia}d10!!6 + @{selected|Res.Fisica|max}d10!!6 ?{Wanna use Fatigue? |No, &amp;#125;k2|Yes, + 1d10!!6 &amp;#125; k3 &amp;#125; + @{selected &amp;#124; Resistencia &amp;#124; max &amp;#125; } Res.Fisica I don't remember when I've last seen an attribute name that included a ".", dunno if it's even a legit attribute name or if it breaks things.
1621757759

Edited 1621843630
Ziechael
Forum Champion
Sheet Author
API Scripter
Andreas was close but committed the cardinal sin of replacing parts of attribute calls: /me RESISTS /r {@{selected|Resistencia}d10!!6 + @{selected|Res.Fisica|max}d10!!6?{Wanna use Fatigue|No, &amp;#125; k2|Yes,&nbsp;+ 1d10!!6 &amp;#125; k3 + @{selected|Resistencia|max}} In your case the breaking characters of the query were the closing } of the keep dice calls
Thanks you both!! It works wonderfully! :)
I come back in the search of your wisdom... Don't know the problem. My new idea is to nest some calculations and use that number as de roll number and it works properly here. "/r [[?{Elige bono}+@{selected|FUERZA}+@{selected|P.Fuerza|max}]]d10cs6cf10s" but when I put this inside another query, it breaks... it's impossible to nest a query with another one?&nbsp; "/me usa su ?{Elige habilidad| Proezas de Fuerza, **Proezas de Fuerza** /r [[? &amp;#123; Elige bono &amp;#125; +@{selected|FUERZA}+@{selected|P.Fuerza|max}]]d10cs6cf10s |}"&nbsp;
1622535771
Ziechael
Forum Champion
Sheet Author
API Scripter
You don't need to escape the opening bracket of a nested query, just commas, pipes and closing curly braces (that don't relate to attribute calls): /me usa su ?{Elige habilidad| Proezas de Fuerza, **Proezas de Fuerza** /r [[? { Elige bono &amp;#125; +@{selected|FUERZA}+@{selected|P.Fuerza|max}]]d10cs6cf10s | }