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

Trigger rolltemplate from roll template

1624308198
.Hell
Sheet Author
Hey, I would like to have the possibility to click on the word in a roll template to trigger another rolltemplate. Is this possible? Can I somehow transfer data between the templates? Thanks
1624309325
Andreas J.
Forum Champion
Sheet Author
Translator
<a href="https://wiki.roll20.net/Chat_Menus" rel="nofollow">https://wiki.roll20.net/Chat_Menus</a> has info on how to do it. You know how if you have the 5E sheet to not auto-roll damage, the button to roll damage is done the same way.
1624697806
.Hell
Sheet Author
Hey Andreas, apparently I am doing something wrong and cannot get it to work. This is the roll I want to reference. &lt;label class='sheet-fumbletitle' data-i18n="fumble-u" &gt;FUMBLE&lt;/label&gt;&lt;button class='sheet-fumble-roll' type='roll' name="roll_fumble" value= '@{whisper}&amp;{template:fumble} {{title=FUMBLE}} {{name=@{character_name}}} {{roll=[[1d10!+1]]}}'&gt;&lt;/button&gt;&lt;br /&gt; And this is the roll template I want to refrence it in: &lt;table&gt; &lt;tr&gt;&lt;th style='text-transform: uppercase;'&gt;{{title}}&lt;/th&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;&lt;strong class="template-title"&gt;NAME: &lt;/strong&gt; {{name}}&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;&lt;strong class="template-title"&gt;SKILL ROLL: &lt;/strong&gt; {{roll}}&lt;/td&gt;&lt;/tr&gt; {{#rollWasCrit() roll}}&lt;tr style='text-align: justify; font-size: 12px;'&gt;&lt;td&gt;&lt;strong class="template-title" style='color: #66c600; text-shadow: 1px 1px #000;'&gt;CRITICAL:&lt;/strong&gt; Criticals are already calculated into the roll&lt;/td&gt;&lt;/tr&gt;{{/rollWasCrit() roll}} {{#rollWasFumble() roll}}&lt;tr style='text-align: justify; font-size: 12px;'&gt;&lt;td&gt;&lt;strong class="template-title" style='color: #c60000; text-shadow: 1px 1px #000;'&gt;FUMBLE:&lt;/strong&gt; Use the [fumble](&amp;#126;fumble) button, **subtract** the result from your total score.&lt;/td&gt;&lt;/tr&gt;{{/rollWasFumble() roll}} &lt;/table&gt; I tried it with [fumble](~fumble] and the escaped variant both write in chat: TypeError: u is undefined What am I missing?
1624709125

Edited 1624709194
GiGs
Pro
Sheet Author
API Scripter
You need to include which character sheet the ability roll is on, like: [fumble](~NAME|fumble] Change NAME to the relevant character sheet name, or selected. When a button is rolled from the character sheet, roll20 knows which sheet it is coming from. When you click a button in chat, roll20 cannot tell which character sheet's button you want to use, so the information has to be included. I'm still waking up so I cant remember how to generate the character sheet name automatically, to send with the rolltemplate, but I'm sure someone else will or this might point you in the right direction.
1624780352
.Hell
Sheet Author
Hey Gigs, thanks for the tip. I had the name in the rolltemplate anyway and could just use it. Now it works, thanks!
1624792512
GiGs
Pro
Sheet Author
API Scripter
Great :)
1624892625
.Hell
Sheet Author
I tried to style the button but didnt get it to work. Is there a specific trick to it? I tried to simply overwrite it like written <a href="https://app.roll20.net/forum/post/7209333/show-off-your-style/?pageforid=7455586#post-7455586" rel="nofollow">https://app.roll20.net/forum/post/7209333/show-off-your-style/?pageforid=7455586#post-7455586</a> or <a href="https://app.roll20.net/forum/post/7129900/css-makeover-for-default-template" rel="nofollow">https://app.roll20.net/forum/post/7129900/css-makeover-for-default-template</a> but that didnt work. Also being more specific did not change a thing.
1624896261
GiGs
Pro
Sheet Author
API Scripter
In your links, Keith is using Stylus, a browser extension that only changes the style for him - each player who wants to use this style needs to install Stylus and set it up properly. It is possible to style a button created via a rolltemplate, but you need very specific CSS to do it. Post the html for your rolltemplate (at least its name0, and the html for your button, and the css you'd like to apply to the button.
1624899741
.Hell
Sheet Author
&lt;rolltemplate class="sheet-rolltemplate-reputation"&gt; &lt;table&gt; {{#rollWasFumble() roll}} &lt;tr style='text-align: justify; font-size: 12px;'&gt; &lt;td class="sheet-test"&gt; &lt;strong class="template-title" style='color: #c60000; text-shadow: 1px 1px #000;'&gt;FUMBLE:&lt;/strong&gt; Use the [fumble](~{{name}}|fumble) button, **subtract** the result from your total score. &lt;/td&gt; &lt;/tr&gt;{{/rollWasFumble() roll}} &lt;/table&gt; &lt;/rolltemplate&gt; We can go with this styling, when it works I can tweak it myself :) .textchatcontainer a[href^="~"] { &nbsp; &nbsp; background-color: transparent; &nbsp; &nbsp; padding: 0px; &nbsp; &nbsp; color: #ce0f69; &nbsp; &nbsp; display: inline-block; &nbsp; &nbsp; border: none; } Thanks for the help
1624911088
GiGs
Pro
Sheet Author
API Scripter
For styles within a rolltemplate, you need to include the rolltemplate. So the above CSS should start . rolltemplate-reputation a [ href ^= "~" ] { That will catch all buttons in the rolltemplate that use ~ If you're using legacy code, that would be .sheet- rolltemplate-reputation a [ href ^= "~" ] {
1624911434
Kraynic
Pro
Sheet Author
I don't think anything has changed with how roll templates need to be written in their html/css.&nbsp; Note Regarding Roll Templates Because chat is closely integrated into the VTT, roll templates will continue to use the legacy system, both for CSS and HTML. From the first post here: <a href="https://app.roll20.net/forum/post/9883156/character-sheet-enhancements/?pagenum=1" rel="nofollow">https://app.roll20.net/forum/post/9883156/character-sheet-enhancements/?pagenum=1</a>
1624912868
Finderski
Pro
Sheet Author
Compendium Curator
Yeah, CSE doesn’t apply to roll templates, so still need the sheet-
1624913089
GiGs
Pro
Sheet Author
API Scripter
Aha, thanks for the correction.
1624915797
.Hell
Sheet Author
Thanks for all the help. My error was to keep the textchatcontainer. I got it to work how I wanted it. I really appreciate all your help :)