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

need help with a generic attack macro

Hi, i'm kinda new to roll20 and i'm struggling with a macro i use to get an all around macro that use the stats of the selected token to make an attack roll i works fine for my players  but i want my rolls result to ber whispered to me the GM and i cant  find a solution for it to do just that my results are public i'm using the pathfinder community sheet here is my macro i hope you can help me /w "@{Selected|character_name}" @{selected|attacks-macro} {{whisper=@{selected|PC-whisper}}} {{switch=~@{selected|character_id}|NPC-attacks}} Arkhayne
1633236097
GiGs
Pro
Sheet Author
API Scripter
You cant do this: @{selected|character_id}|NPC-attacks} and if you could, you'd be missing an { anyway ,ad an }! Attribute calls cannot be constructed from parts like that - they have to be used in there entirety. You can use {{switch=~@{selected|NPC-attacks}}} Though I'm not sure what the ~ is for, and depending on the content of NPC-attacks, that might not work. If NPC-attacks is a roll of its one, that wont work, you'd best put it in a button, like {{switch=[NPC Attack](~selected|NPC-attacks)}} Come to think of it, maybe thats why the ~ is there.
As for why it doesn't whisper, My guess is you are whispering to a selected token that has no owner?  AKA most npc sheets.  
1633318994
timmaugh
Roll20 Production Team
API Scripter
If DM Eddie's observation is what is causing the problem, you can get around this with a Fetch construction and default value: @(selected.character_name[gm]) To make that work, you'd need to initially turn your macro into an API call, which you then dump out to normal chat. That means you'd need ZeroFrame and SelectManager, too. Then you command line would look like: !/w @(selected.character_name[gm]) ........ {&simple} All that said, I think GiGs has a valid point, too. Abilities are expanded before attribute calls, but that ability isn't formatted in such a way to be detected, so the attribute will expand first. Can you share the contents of an example attacks-macro? And of the NPC-attacks?