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

Nested Macros - Whispering issues

I am stuck on a nested macro calling other macros.  This is the code I have for the Query &{template:simple} {{rname=Dice}} {{name=}} {{r1=?{Choose|Public,#DPublic| Whispered,#DWhisper }}} The macros I am calling are written as follows: DWhisper /w gm &{template:simple} {{rname=Dice}} {{mod=}} {{r1=[[?{How many dice?}d?{How many sides?}+?{Any modifiers?}]]}} {{normal=1}} {{r2=}} {{charname=}} DPublic &{template:simple} {{rname=Dice}} {{mod=}} {{r1=[[?{How many dice?}d?{How many sides?}+?{Any modifiers?}]]}} {{normal=1}} {{r2=}} {{charname=}}  I was hoping that I could get one to show publicly while the other is whispered. However, they both show up as public rolls. I feel like the fix is something easy but I am stuck as to what it is supposed to be. 
1719198707
Gauss
Forum Champion
Hi Zyrek,  You cannot do this because you are trying to put one template inside another template.  When a query is processed the result replaces the query. Thus this: &{template:simple} {{rname=Dice}} {{name=}} {{r1=?{Choose|Public,#DPublic| Whispered,#DWhisper }}} becomes this:  &{template:simple} {{rname=Dice}} {{name=}} {{r1=/w gm &{template:simple} {{rname=Dice}} {{mod=}} {{r1=[[?{How many dice?}d?{How many sides?}+?{Any modifiers?}]]}} {{normal=1}} {{r2=}} {{charname=}}}} Instead, use Chat Menu buttons . 
Much appreciated. I was afraid that was the case. 
I’m guessing that what you want to do is very possible. What are you trying to do?  Is it that you want the R1 roll to be public and the R2 roll to be hidden and only visible to you as GM? if so then you might be able to use Stylus and the Hidden Roll  trick to do that. I haven’t tested that out in the R2 field but it certainly works in the Description field. 
1719321155
timmaugh
Forum Champion
API Scripter
Yeah, I think it bears mentioning because there seems to be a misunderstanding... This is your query: ?{Choose|Public,#DPublic| Whispered,#DWhisper } Everything else in your initial command line is part of the syntax required for a template statement... except you don't need that template. You have the template in the two macros you're trying to call. Except... Macros expand before queries are resolved ( order of operations ), so all of that macro verbiage from both macros gets injected to your query and the syntax of your query breaks (things like commas, pipes, and right-braces move the query parsing into new parts before you're ready). So to do this, you'd typically want a Chat Menu , with a button for either template... but, as Jarren says, if you can explain what you're trying to do a bit better (if this is part of a larger operation you're trying to perform) we might be able to give better answers for how to do it.
No my intent is to have a drop down menu but have it capable of both a whispered roll or a public roll. My dice macro allows my players to create any die roll while having it also in a nice template.  But now I am wondering if I can query the command /w or not before using the macro 
1719335049
Gauss
Forum Champion
Zyrek said: No my intent is to have a drop down menu but have it capable of both a whispered roll or a public roll. My dice macro allows my players to create any die roll while having it also in a nice template.  But now I am wondering if I can query the command /w or not before using the macro  Yes, you can:  ?{test|whisper,/w GM|no whisper, } &{template:default} {{name=testing}} {{test=this is a test}}
Zyrek said: No my intent is to have a drop down menu but have it capable of both a whispered roll or a public roll. My dice macro allows my players to create any die roll while having it also in a nice template.  But now I am wondering if I can query the command /w or not before using the macro  ?{Whisper?|Public Roll,|Whisper Roll,/w gm } &{template:simple} {{rname=Dice}} {{mod=}} {{r1=[[?{How many dice?}d?{How many sides?}+?{Any modifiers?}]]}} {{normal=1}} {{r2=}} {{charname=}}
Thank you all very much. This worked out fantastically!