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

Need Help With Chat Menu Button

1651770369

Edited 1651770458
vÍnce &nbsp;said: Hi Sirius, love those little victories. ;-) Is this for a custom sheet?&nbsp; Might I suggest posting a snippet of your css that removes the button styling to help other's that travel this same road? There are some examples on the wiki for dealing with chat buttons.&nbsp; <a href="https://wiki.roll20.net/Chat_Menus#Other" rel="nofollow">https://wiki.roll20.net/Chat_Menus#Other</a> Ziechael &nbsp;also has a real cool trick of just using a backtick inside the macro command that forces text-only buttons.&nbsp; here This was a reply to one of my previous posts that, at the time, was not what I was looking for. However, I remembered the backtick trick and thought maybe I could use it now. I have two buttons in a repeating section one with a backtick&nbsp; `&nbsp; [Critical] and one without it [Damage] to see what difference it made. I thought it looked a lot cleaner but when I rolled the [Critical] button it only showed ~repeating_attack_crit instead of showing the crit roll. I looked at the post that Ziechael posted and previous posts to see if I was missing something. I saw theirs had (&nbsp; [PUNCH 1](`~ selected| repeating_melee-strikes_$0_ATTACK-DAMAGE) &nbsp;)&nbsp;&nbsp;~selected|repeating. I tried that but it's still not working. Not sure what the $0 is or what it does so I'm hesitant to try it.&nbsp; This is the HTML of the "roll_damage" with the [Critical] button and what it is supposed to roll, "roll_crit": &lt; button type = "roll" name = "roll_damage" class = "hidden" value = "@{whispertoggle}&amp;{template:custom}{{title=Damage}}@{dmgflag}@{dmg2flag} {{=[Critical](`~repeating_attack_crit)}}" &gt; Damage &lt;/ button &gt; &lt; button type = "roll" name = "roll_crit" class = "hidden" value = "@{whispertoggle}&amp;{template:custom}{{title=Critical Damage}} {{[[@{dmgcustcrit}]]=@{dmgtype}}}@{crit2flag}@{hldmgflag}" &gt; Crit &lt;/ button &gt; I'd appreciate any help but I can live with a big pink button if necessary. (Though blue would be better if I knew how to change that lol) EDIT: I tried not to make this post too long so if you need to see the whole repeating section just ask.
1651771838
GiGs
Pro
Sheet Author
API Scripter
The _$0_ in the original code is the ROW of the repeating ability - 0 is forst, 1 is second, 2 is third, etc. If you are calling an ability from inside a repeating section you don't need to add that - roll20 fills in the row id automatically. Does your ability call work without the backtick?
Yes, it does. Everything rolls perfectly fine without the backtick.
1651772314
GiGs
Pro
Sheet Author
API Scripter
Its very possible that the backtick trick only works when typing in the chat window, and doesnt work from the character sheet. If you really want it, you could replace it with whatever code is a HTML Entity for a backtick, and see if it works now.
If I am not mistaken, I tried this,&nbsp; &amp;#96;&nbsp; &nbsp;and got the same result. Not really a big issue, just wanted to see if it would work.
One more quick question, is there a way to change the yellow background of the roll result in the template? Maybe to be transparent or just not have a background?
1651773330
GiGs
Pro
Sheet Author
API Scripter
You can change details about the rolltemplate in your CSS - the wiki has the details. Your best option might be to add your own rolltemplate, then you can customize it's appearance exactly as you want. The Custom Rolltemplate (also in the wiki) is a great place to start.
I did end up finding what I was looking for through some digging. I just wish the wiki explained it better what everything did instead of just showing an example. But thanks anyways GiGs!
1651779143
GiGs
Pro
Sheet Author
API Scripter
What was your solution? Others might need it in the future, and I'm curious.
Turns out, even though in the HTML for a custom roll template you don't call or make a call for inline rolls, you can still customize how they look by using .inlinerollresult Also if you are using CSE, you still have to put "sheet-" in front anything regarding rolltemplates. .sheet-rolltemplate-custom .inlinerollresult { background-color : transparent ; border : none ; } .sheet-rolltemplate-custom .inlinerollresult { background-color : transparent ; border : none ; font-size : 18px ; padding : 0px ; } .sheet-rolltemplate-custom .inlinerollresult.fullcrit { color : rgb ( 0 , 165 , 0 ); border : none ; } .sheet-rolltemplate-custom .inlinerollresult.fullfail { color : red ; border : none ; } .sheet-rolltemplate-custom .inlinerollresult.importantroll { border : none ; }
1651779521
Kraynic
Pro
Sheet Author
Sirius said: I did end up finding what I was looking for through some digging. I just wish the wiki explained it better what everything did instead of just showing an example. But thanks anyways GiGs! It is a wiki.&nbsp; You can edit the entries there to add or clarify something.&nbsp;
1651779580
GiGs
Pro
Sheet Author
API Scripter
This part is especially irritating: Sirius said: Also if you are using CSE, you still have to put "sheet-" in front anything regarding rolltemplates.
Tell me about it! Lol but I got my template to look a bit nicer so I'm happy.
1654086612

Edited 1654086680
Daniel S.
Pro
Marketplace Creator
Sheet Author
Compendium Curator
This is the HTML of the "roll_damage" with the [Critical] button and what it is supposed to roll, "roll_crit": &lt; button type = "roll" name = "roll_damage" class = "hidden" value = "@{whispertoggle}&amp;{template:custom}{{title=Damage}}@{dmgflag}@{dmg2flag} {{=[Critical](`~repeating_attack_crit)}}" &gt; Damage &lt;/ button &gt; &lt; button type = "roll" name = "roll_crit" class = "hidden" value = "@{whispertoggle}&amp;{template:custom}{{title=Critical Damage}} {{[[@{dmgcustcrit}]]=@{dmgtype}}}@{crit2flag}@{hldmgflag}" &gt; Crit &lt;/ button &gt; I was wondering if you could walk through the full code of what this looks like on your sheet? I'm trying to do the same, where you click on a button on a roll template (via a chat menu), and it shows another roll template with the result. Perhaps the answer is on one of the wiki pages, but haven't managed to figure it out yet after lots of trial and error and scouring. Looks like it may have something to do with using hidden variables/fields that you setup? I don't know much about how to use those.
1654164927

Edited 1654164938
GiGs
Pro
Sheet Author
API Scripter
It sounds like you are looking for advice in launching buttons from chat, that have been created from buttons. That is fairly straightforward. At the risk of posting my site too much (I have permission, when relevant!), you might find this link useful: <a href="https://cybersphere.me/buttons-that-create-other-buttons/" rel="nofollow">https://cybersphere.me/buttons-that-create-other-buttons/</a>
1654237613
Daniel S.
Pro
Marketplace Creator
Sheet Author
Compendium Curator
Yeah I figured it out from your other post. Just basically asked the same question in two places.