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 Inline Rolls with descriptors

1430455614
vÍnce
Pro
Sheet Author
I'm not sure if this is supposed to work, but including descriptive text enclosed with single brackets [ ] within a nested inline roll fails. nested inline roll macro w/descriptive text fails [[ [[1d20]]+5[mod] ]] Inline roll macro w/descriptive text works [[ 1d20+5[mod] ]] Workaround: Including a 0d0 roll along with other nested inline rolls work [[ 0d0+[[1d20]]+5[mod] ]] Is this working as intended or can this be changed so that a 0d0 roll isn't necessary? Thanks
1430457940
The Aaron
Pro
API Scripter
Just noticed a similar issue. Before the new dice roller, [[ ]] would produce just [[ ]] in chat. Now it causes: SyntaxError: Expected "(", ".", "[", "abs(", "ceil(", "d", "floor(", "round(", "t", "{", [ |\t], [+|\-] or [0-9] but end of input found. This shows up in the DnD_5e character sheet if you leave the Crit Dmg on a weapon off.
1430470490
Lithl
Pro
Sheet Author
API Scripter
I strongly suspect that whatever's causing this particular problem is the same thing stopping us from adding comments to math-only inline rolls. Adding 0d0 is a workaround for both, but it would be nice to need need that. =)
Indeed, the problem seems to be that your roll will translate into: [[ 10+5[mod] ]] ...which is essentially a math-only roll, and as Brian said there is a restriction that's been around for a while where you can't use comments in math-only rolls. I'll see if I can figure out a way to fix that.
1430782112
vÍnce
Pro
Sheet Author
Thanks Riley.
I believe this should now be working properly. Can you let me know if you still see issues? Thanks!
Riley D. said: I believe this should now be working properly. Can you let me know if you still see issues? Thanks! These work... [[ 1d20 + [[5 [ Mod] ]] ]] [[ [[1d20]] + 5 [Mod] ]]
1433291378

Edited 1433314895
It seems that this works when entered manually, but not via sendChat. sendChat("Bob", "[[1[foo]]]"); yields: Could not determine result type of: [{"type":"M","expr":1},{"type":"C","text":"[foo"}] This holds for "[[1[foo] ]]" and "[[ 1[foo] ]]" as well.
1433301335
vÍnce
Pro
Sheet Author
Good news that the nested inline descriptors work manually. Is it safe to assume that the sendChat() method is done via API Manveti? Meaning that they can't be used within a script like Powercards?
Nope. PowerCards sends everything back through a sendChat to get inline roll results for any constructed rolls or repeated tag rolls.
Not unless the script processes the rolls and styles it to look like an inline roll. If it passes the roll along to the roll system, it will fail. When I saw this bug fixed, my first thought was that I could fix up ExtendedExpressions and HiddenRolls (the former strips out labels on anything but dice; the latter wants to label numbers with the dice used to generate them like "17[1d20]", but has to do a clunky "{1d0+17}[1d20]" instead). However, altering the scripts to allow labels on numbers without rolls caused them to fail as above.
Vince said: Good news that the nested inline descriptors work manually. Is it safe to assume that the sendChat() method is done via API Manveti? Meaning that they can't be used within a script like Powercards? Actually I just tested it and [[ 1d20 + [[ 5 [Str Mod] ]] ]] works for some reason even through the API. Not sure why.
1433308286
vÍnce
Pro
Sheet Author
HoneyBadger said: Vince said: Good news that the nested inline descriptors work manually. Is it safe to assume that the sendChat() method is done via API Manveti? Meaning that they can't be used within a script like Powercards? Actually I just tested it and [[ 1d20 + [[ 5 [Str Mod] ]] ]] works for some reason even through the API. Not sure why. That's VERY good news.
It looks like that works because the script isn't actually submitting "[[ 1d20 + [[ 5 [Str Mod] ]] ]]"; the formula replacement step turns it into "[[ 1d20 + 5 ]]". The good news for scripts which pass msg.inlinerolls[i].expression through to an inline roll is that it seems the nested inlines are already evaluated by then. The bad news for other scripts is that if they were to try to submit the first command directly to sendChat, it would fail.
1433342770
The Aaron
Roll20 Production Team
API Scripter
manveti said: It seems that this works when entered manually, but not via sendChat. sendChat("Bob", "[[1[foo]]]"); yields: Could not determine result type of: [{"type":"M","expr":1},{"type":"C","text":"[foo"}] This holds for "[[1[foo] ]]" and "[[ 1[foo] ]]" as well. Just for clairity, is this in Prod or Dev?
Prod.
1433364829
The Aaron
Roll20 Production Team
API Scripter
If you get a chance, try it on dev.
Fails the same way on dev.