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

Get string from roll query and use it in roll chat?

1604432881

Edited 1604433777
Hi, I have a fairly big dice roll in my character sheet. Is there a clever way to use the name of a selected value in a query in the chat window result shown? I would like the string in bold  to show where (TEST)  is... it's so fuzzy I can't even explain what I'm trying to do. The amp; stuff is to get around nested querys. Example (extremely shortened):             [...] name="roll_ror" type="roll" class="test3d6" value="&{template:default} {{name= **Rörlighet** (TEST) }}                 {{?{Med fördel?| Normalt, ?{Normalt| Utan färdighet , [[3d6+[[@{rorlighet_ge}]]]]| Atletisk förmåga ,[...] So, when a character clicks on the "roll button" they are asked what Skill to use - I would like the Chat window to show that skill name with the roll results... not sure if I made it any easier to understand... I'm praying for Aaron or some other Jedi master to come save me, please please please don't say JavaScript or API - that stuff is scary. Dear God, let there be a native variable name hidden somewhere.
1604435403
GiGs
Pro
Sheet Author
API Scripter
You have two strings in bold - so I'm not sure what you want to put in TEST.  That said, the only way to do this, if i understand you correctly, is to expand what each query includes, starting from where the (TEST) text is, which means more html substitutions. I'll try to illustrated with a simple example. First, imagine you are presenting a query that asks people what stat they are using, and uses that stats value, you can do this: &{template:default} {{name=Stat Roll}} {{Roll=[[1d20+?{Stat?| STR,@{STR}| DEX,@{DEX}| CON,@{CON}}]]}} But you also want to show which stat was selected. You could do that by widening the query to have more information in it, like so: &{template:default} {{name=Stat Roll}} {{Stat=?{Stat?| STR,STR}} {{Roll=[[1d20+@{STR}| DEX,DEX}} {{Roll=[[1d20+@{DEX}| CON,CON}} {{Roll=[[1d20+@{CON}}]]}} Obviously this wouldnt work because you need to include some html substitutions. But it illustrates the way you have to do this kind of thing.
Aha, I think I understand what you mean. Thanks for the pointers!
Trying to get my head around the substitutions but I can't get the query within the query to execute. It just shows me the whole option as a text row insteat of a select value. I'm missing a translation somewhere. How would you use html substitution in your example?
Never mind, got it to work - I was a bit zealous in my substitution and accidentially substituted stuff in the parent query as well.