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 .
×

I can't call a macro... WHY?

I'm trying to use a macro inside a macro --  ranged  [[1d20+@{bab}+@{dex}]] and when I type #ranged #ranged appears in the chat instead of a number. What am I doing wrong?
Is [[1d20+@{bab}+@{dex}]] the content of a collection macro or a token macro? If it is a collection macro, you'll need a token reference in the ability calls, either a character_id, 'selected', or 'target'. So it could be: [[1d20+@{selected|bab}+@{selected|dex}]] and you'd have to select the token before clicking on the macro. It could also be a embedded macro html substitution issue, but there's no way to know without you giving a little more context on exactly how you're calling the macros, where they are stored, what the exact code is, etc.  Screenshots would be probably be helpful also.
thank you very much for your help. both of my macros where on a character sheet. when i try to call a macro in the macro tab i get this message : TypeError: yt is undefined. Now, i dont know what YT means but i guess it is because the @{bab} is not linked to a character thats why i tried having both my macros on the character sheet to bypass this problem but i wind up with an other problem. i have been looking for the list of commands available and the list of notification for programming macros and i didnt find any. if you could point me in the right direction that would be greatly apperciated. thank you for your time
1640096273
GiGs
Pro
Sheet Author
API Scripter
Can you post the full text of both macros?
the macros in my character sheet macro 1 test #ranged macro 2 ranged {{1d20+@{bab}[bab]+@{dex-mod}[dex]]] all i had when i used the test macro in chat box is #ranged now i tried with the ranged macro in the macro tab and i got :TypeError: yt is undefined. as i understand it it is because the stats are not linked to a character. i still dodnt know what YT means now Jarren help me fix this (THANK YOU Jarren) with this macro: [[1d20+@{selected|bab}+@{selected|dex}]] and it works if i select a token prior to using the macro
1640098517
GiGs
Pro
Sheet Author
API Scripter
When you have @{selected| it will only work if you have selected a token linked to a character. I'm not sure where the yt is coming from. Jarren is correct in his advice, I'm just puzzled why if those macros were in your character sheet (in the Abilities section), they were failing. That said, this code is in error: {{1d20+@{bab}[bab]+@{dex-mod}[dex]]] The {{ at the start should be [[
1640098864
GiGs
Pro
Sheet Author
API Scripter
Looking back at your original post, I see a problem: Wizmath123 said: I'm trying to use a macro inside a macro --  ranged  [[1d20+@{bab}+@{dex}]] and when I type #ranged #ranged appears in the chat instead of a number. What am I doing wrong? That macro can be in two places: * In the Macro Tab * In the Abilities section of a character sheet. If it's the first, typing #ranged in chat will call it, but it will not work properly. Universal macros aren't linked to a specific character, and roll20 has no way of knowing which characte's stats you use - thats why using the @{selected| part is necessary - it's one way to tell roll20 which character to draw the stats from. If the macro iis instead on the Abilities tab of a character, the # syntax wont grab it. You'll need to use %{NAME|ranged} or %{selected|ranged} to tell roll20 which character to grab the ability from (replace NAME with the character name). In this case your macro should work fine - for abilities on a character, roll20 automatically uses that character's abilities so you don't need to supply something like @{selected|