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

Can a Inline roll command that print a roll template?

1715579216
Peter B.
Plus
Sheet Author
Hello. I am trying to implement a Roll command that prints a roll template to the chat for my Character Sheet. I want to use this for making a roll, and having a button to do the roll over and over again, as it can be needed multiple times. Like this: Do anyone know if it is possible to do this? All my tests have either caused the roll template to be printed immediately, before the roll command was clicked. When I try to use HTML encoding for special characters, such as {}[]& etc, for the roll template, then nothing gets printed when I click my roll command. If anyone knows how to make something like this I would love to know how.
1715584162

Edited 1715584255
GiGs
Pro
Sheet Author
API Scripter
I'm not sure I fully understand the question. All my tests have either caused the roll template to be printed immediately, before the roll command was clicked. Are you saying you are trying to print a button to chat that then prints a rolltemplate when clicked? If so, what will the rolltemplate contain? PS: once people discover rollTemplaters, they usually dispense with roll commands (of the form /r). Why are you trying to use both a rollcommand and a rolltemplate?
1715608523
Peter B.
Plus
Sheet Author
GiGs said: I'm not sure I fully understand the question. All my tests have either caused the roll template to be printed immediately, before the roll command was clicked. Are you saying you are trying to print a button to chat that then prints a rolltemplate when clicked? If so, what will the rolltemplate contain? PS: once people discover rollTemplaters, they usually dispense with roll commands (of the form /r). Why are you trying to use both a rollcommand and a rolltemplate? The Roll template will contain exactly what you see in the image. Information about a roll and a button that will do the same roll again. PS: I am trying to make something that people can click, that I can dynamically define. If I make a button to the sheet, then I need to update the information the button rolls, either by updating a hidden attribute or by some other means. As described above, I want to give a roll template to users, with a button / link / roll command that can redo the roll and basically print itself, as shown in the screenshot. I tried to do this: [Roll again](`&{template:default}{{name=test}}) When I do this the template will be shown before the link is clicked and the link wont be there.
1715614991

Edited 1715615039
Gauss
Forum Champion
Hi Peter, Is your Dispel roll from a macro? Why not just use the Chat Menu to put the macro command in? Example: [Roll again](~charactername|DispelRoll)
1715617888
Peter B.
Plus
Sheet Author
Gauss said: Hi Peter, Is your Dispel roll from a macro? Why not just use the Chat Menu to put the macro command in? Example: [Roll again](~charactername|DispelRoll) Hey Gauss It is for a macro but I do not want to store the macro on the sheet as I plan to change it a bit with each call, either making it public or private. What I essentially want to do is to click a button that can send a parameter to the javascript, but I know this is not possible.  I guess I will just have to make this the only way I know how in the backend.
1715619569

Edited 1715619680
Gauss
Forum Champion
Ahhh, didn't realize you were doing character sheet coding. (We aren't in that forum.) I wonder, could  you   do the public/private component of the macro separately? Perhaps with an Attribute call?  Then modify the attribute based on public or private? example: @{publicprivate} ....rest of the macro.... Then you can call the macro normally. 
1715623725
Peter B.
Plus
Sheet Author
Yeah I know. I just have a very specific use case in mind. I want this to work in exactly the right way. I will Hack it together and see if I can get it exactly right.