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

Secondary Rolls off of Chat Output

So, I have an issue which it seems like I figured out how to do once before but can't figure out now. Basically, on the sheet I've created, once the attack roll is made, I want to be able to click on the output template in chat so that they can roll damage off the chat output. Much like the way the D&D5e sheet allows you to roll an attack and then roll the damage afterwards by clicking on the weapon name in chat. I'm outputting information to a roll template and would like to include a damage roll as part of it but to have that roll delayed until they click in chat to make the roll.   As a basic example of the output, in this output, the damage would not have been rolled but instead they would click on another roll button or link that would execute the damage roll. As stated, I feel like I had figured this out once before but for the life of me can't figure out where I found the information or where I saw it used before other than in the 5e sheet. Any help would be appreciated.
I believe what you are looking for is an api chat button template.&nbsp; I use them for manual damage rolls also.&nbsp;&nbsp; <a href="https://wiki.roll20.net/API:Chat" rel="nofollow">https://wiki.roll20.net/API:Chat</a> &nbsp;scroll down to the button, it doens't have to use an api call, it just needs to fit the syntax and can call a macro or a sheet link.&nbsp;&nbsp;
Definitely, all of the information is there in what you posted. I am trying to do this without using API but it appears I just don't understand it well enough. I've tried altering my code in multiple ways to accommodate it but either it doesn't do anything or it actually tries to pull up an entirely new webpage. I think part of the problem I have is that there are substrings as part of the equation but I can't be sure as there is not always an error message telling me what I've done wrong and I've got to do a lot of guesswork. The original value appears thusly in the character sheet: value="&amp;{template:attack} {{name=@{wpnname} Attack/Parry}} {{subtag=@{wpnType}}} {{score=[[?{Combat Points}+(?{SV Mods|0})+(@{woundlvl})+(@{fearlvl})]]}} {{roll=[[1d20cs1cf20]]}} {{damage=[[1d10!&gt;@{wpnOR}+@{dambonus}]]}} " In this case, the very last section in bold-face is what we're dealing with and the @{wpnOR} is pulled from the weapon stat-block and is dependent on what they've chosen in their dropdown menu as the value. The next variable is @{dambonus} which is also selected in a drop down where the weapon is designated Ranged (@{dambonus}=0) or Melee (@{dambonus}=@{str}). I have tried replacing&nbsp; {{damage=[[1d10!&gt;@{wpnOR}+@{dambonus}]]}} &nbsp;with: damage=[Damage](&amp;#13;#Damage) where #Damage refers to a macro in my macro list. This has it's own set of problems with trying to be universal and automatically pull the preceeding information from the character sheet and, depending on the modifications made to the macro to get around this either does nothing or tries to call up a new webpage. damage=[Damage]([[1d10!&gt;@{wpnOR}+@{dambonus}]] which seems to do nothing and I assume is having issues trying to pull up the substring information and failing to do so. damage=[Damage](&amp;#91;&amp;#91;1d10!&gt;&amp;#64;{wpnOR}+&amp;#64;{dambonus}&amp;#93;&amp;#93;) which, if I remember, attempts to call up another webpage. There's obviously something I'm failing to understand about all of this but I do appreciate the information. Hopefully, I'll be able to figure it out at some point and can modify the sheet to include the new functionality.
1619474970

Edited 1619475101
Andreas J.
Forum Champion
Sheet Author
Translator
Not eve sure you can use direct rolls in in those buttons(the linked page doesnt show examples similar to yours). The point is to save the buttons rolls in separate macros or as character abilities, instead of trying to cram in the calculations inside the [button name](content). This page shows more examples and better in general how you can have buttons in your roll templates: <a href="https://wiki.roll20.net/Chat_Menus" rel="nofollow">https://wiki.roll20.net/Chat_Menus</a>
Yeah, I'm still diving ever deeper into the information. I know &nbsp;there's a way to do what I want it to do (or at least close). I&nbsp; just have to find that one bit of information that knocks that switch in my brain that says, "Ah ha!" For now, I think I'll just have to have it set up as two separate rolls to accomplish what I'm attempting.
Thank you for all your assistance on this issue. If I come up with my "Ah ha!" moment, I'll be sure to let you know what it was.
Honestly, this is the one &nbsp;thing that Astral Tabletop does that I can't seem to easily do in Roll20. They allow you to delay a roll within a template that the roller can then roll when ready. The reason I'm going about this like I am is because in Trudvang Chronicles , once a player is attacked, if &nbsp;the attack hits, they can decide if they wish to attempt to parry or evade or just take the hit. I was trying to automate my attack by the NPC as much as possible so that I could make the attack but still hide the damage being done until we'd determined whether the player was going to defend in any fashion or just take the hit. I know I can do that by virtue of just rolling an attack roll, waiting for the result of the player's decision and rolls, and then rolling the attack roll. I was just hoping to making a little cleaner and a little less of me needing to go back into the NPC sheet to finish the damage roll. And, if I could figure this out, this would be another thing that I could plug into future character sheets as well whenever they became necessary.