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 macro example not working

Hi folks, My nested macro stopped working so I went back to basics; the example nested macro doesn't even seem to work. I've tried different browsers so I don't think it's just me; can anyone else shed some light? Trying: ?{Choose a Roll| STR,/roll 1d20 + @{STR} + ?{Bonus} | DEX,/roll 1d20 + @{DEX} + ?{Bonus} | CON,/roll 1d20 + @{CON} + ?{Bonus} } gives me an error in the chat. In Chrome I get `TypeError: Cannot read properties of undefined (reading 'substring')`. In Firefox, I get ` TypeError: ct is undefined`. Cheers.
Are you pasting that into chat, using a collection macro, or is it directly on a character sheet as an ability macro? You will need to confirm that it is on a character sheet as an ability, because there is no reference (@{selected| or @{target|), and you also need to confirm that the attributes being called ('STR', 'DEX', 'CON') are the correct attribute names for the character sheet in your game.   Which game are you playing, and what character sheet template are you using, and what was the macro you were using before?
Tom HS said: Hi folks, My nested macro stopped working so I went back to basics; the example nested macro doesn't even seem to work. I've tried different browsers so I don't think it's just me; can anyone else shed some light? Trying: ?{Choose a Roll| STR,/roll 1d20 + @{STR} + ?{Bonus} | DEX,/roll 1d20 + @{DEX} + ?{Bonus} | CON,/roll 1d20 + @{CON} + ?{Bonus} } gives me an error in the chat. In Chrome I get `TypeError: Cannot read properties of undefined (reading 'substring')`. In Firefox, I get ` TypeError: ct is undefined`. Cheers. Tom, If you're rolling on a 5e sheet try this: ?{Choose a Roll| STR,[[1d20+@{selected|strength_mod}+?{Bonus|0}]] | DEX,[[1d20+@{selected|dexterity_mod}+?{Bonus|0}]] | CON,[[1d20+@{selected|constitution_mod}+?{Bonus|0}]] } You'll have to select the token representing a character sheet in order for this to work.
1651100510
GiGs
Pro
Sheet Author
API Scripter
Also, since a lot of it is repeated,you can remove most of it from the query, like /roll 1d20 + ?{Choose a Roll| STR,@{STR}| DEX,@{DEX}| CON,@{CON}} + ?{Bonus|0} or [[1d20+ ?{Choose a Roll| STR,@{selected|strength_mod}| DEX,[[1d20+@{selected|dexterity_mod}| CON,[[1d20+@{selected|constitution_mod}}+?{Bonus|0}]]
Ahhh I see, this makes total sense.  Thanks so much.