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

Problems with macros

I have the following difficulty, I have these two macros: difficulty [[? {Difficulty | Routine, 1d6 | Easy, 2d6 | Normal, 3d6 | Difficult, 4d6 | Very Difficult, 5d6 | Impossible, 6d6}]] test-strength & {template: default} {{name = @ {selected | token_name} tested a Strength}} {{Value = @ {selected | strength}}} {{Result = #Difficulty}} I'd like to create a macro with a query that invokes the test-strength macro but can't get the syntax right, I'm trying this way: [[? {Attribute | [[# strength test]]}]] How to fix?
1567042354
GiGs
Pro
Sheet Author
API Scripter
I assume all those spaces aren't in there? The problem you are likely running into is the way queries break when there are multiple } characters. A query ends with }, and if the macro contains an } that isnt a query ending, inside a query, that query will break. It's described hopefully a bit more clearly here:&nbsp; <a href="https://wiki.roll20.net/Macros#Advanced_Usage_for_Roll_Queries" rel="nofollow">https://wiki.roll20.net/Macros#Advanced_Usage_for_Roll_Queries</a> , with the way to solve it (which can be very tricky). Note that any macro calls (like #Difficulty) are expanded in the calling macro, before the macro is resolved. So if, say StrengthTest contains an } character, that can break the ?{Attribute query.
Thank you, I managed to solve with your help, the code was like this: &amp;{template:default}{{name=@{selected|token_name} testou um Atributo}}{{Atributo(Valor)=?{Atributo--|Força(@{selected|forca})|Reflexo(@{selected|reflexo})|Saúde(@{selected|saude})|Intuição(@{selected|intuicao})|Vontade(@{selected|vontade})|Presença(@{selected|presenca})}}}{{Dificuldade(Valor) =?{Difficuldade--|Rotineira, Rotineira([[1d6]])|Fácil, Fácil([[2d6]])|Normal, Normal([[3d6]])|Difícil, Difícil([[4d6]])|Ext Difícil, Ext Dificil([[5d6]])|Virt Impossível, Virt. Impossível([[6d6]])}}}
1567531842
GiGs
Pro
Sheet Author
API Scripter
I'm glad you got it sorted :)