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

Clickable Roll in Pulled NPC Trait Box

I'm using the code  %{selected|repeating_npcaction_$0_npc_action}  to pull an NPC trait, which I love. What I would like to do is have it so where the trait has a damage on failed save, that I am able to click on text within that pulled trait box in order to roll the damage.  Here is what an example of a pulled trait is that I would like to be able to roll damage from. Being able to click on the (3d6) in this example and get the rolled damage would be great. 
1488837137

Edited 1488837263
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
What you want are  API  or  ability command buttons . If all you want to have it do is output an inline roll result to chat without any template formatting, then I'd recommend using the API command buttons like this: [3d6](!
/w gm [[3d6]]) or [3d6](![[
/w gm [[3d6]]) The only difference between these two options is the final output. The top one will output a normal inline roll that you can hover over to see the details. The bottom one will output the roll result as text, removing the tooltip capability. If you want it formatted in a template, then I'd recommend making an ability for the damage and using an ability command button. EDIT: Also, not sure you're aware, but the output you have up there does have the rolled damage (the "10"). The (3d6) is just text that was added to show you what dice were rolled without needing to hover over it.
I haven't made the leap to a Pro subscription yet, so I do not believe I have access to API. I can just set this up as another line though, and have it autoroll damage, and do it that way. EDIT: Also, not sure you're aware, but the output you have up there does have the rolled damage (the "10"). The (3d6) is just text that was added to show you what dice were rolled without needing to hover over it. That 10 value is just the average value provided, without rolling. It doesn't change. I always like to use real rolls for damage though.
You could also just edit the description and change the 10 to [[3d6]]
Yup.
Access to the API is not required in order to use a Command Button in the way that Scott C. is demonstrating.
1488838411
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Shaun said: I haven't made the leap to a Pro subscription yet, so I do not believe I have access to API. I can just set this up as another line though, and have it autoroll damage, and do it that way. EDIT: Also, not sure you're aware, but the output you have up there does have the rolled damage (the "10"). The (3d6) is just text that was added to show you what dice were rolled without needing to hover over it. That 10 value is just the average value provided, without rolling. It doesn't change. I always like to use real rolls for damage though. Ah, didn't realize that. And yeah, as Silvyre said, everything I mentioned is useable regardless of subscription tier. The API Command Buttons are called that because they were designed to work with API commands, but they don't have to.
And yeah, as Silvyre said, everything I mentioned is useable regardless of subscription tier. The API Command Buttons are called that because they were designed to work with API commands, but they don't have to. Today I learned. Thanks guys!