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

Roll Template - Large Table Output

Greetings! I've been working on a custom character sheet etc and am hitting an issue with Roll Templates in regards to displaying the results of multiple rolls on a table.


TL;DR: Rolling multiple times on a table (e.g. 3t[Table-Name] ) inside of a Roll Template will only display the first result.


Basically I have three tables setup for scavenging equipment (Blades, Bludgeoning, Armor) that describe condition and value loss (e.g. "blade is rusty, -20% value"). There is a Macro that characters can add to their quick-bar that runs a Roll Query to select Blade/Bludge/Armour, the values of the roll-query being a roll template that does a 1t[Scavenge-Bladed] to summon the table.


That works great, but rolling for say 10 swords is tedious, so I want it to ask for a quantity. I can add another Roll Query into the template. so I end up with something like this as the final section of the roll-template:

[[ ?{Quantity|1}t[Scavange-Bladed] ]]


This "works" in that it makes the template and i can hover-over the .inlinerollresult to see (Quantity) # of rolls from the table, but without the hover I'm seeing only the first result actually displayed in the template body. See this picture, where the top shows a raw table roll with multiple results, and you can see the default template and my modified one both displaying only the one value, with the hover showing a full result.




Any way to get the full results displayed into the template?

February 17 (4 years ago)
GiGs
Pro
Sheet Author
API Scripter

I believe this is a limitation of tables and inline rolls - tables will only ever show the first result if in an inline roll. And of course, you have to use inline rolls in a rolltemplate.

Since you're a Pro user, the API might help. There might be an API script that allows multiple rolls, and displays them in a pretty fashion.

February 17 (4 years ago)

Edited February 17 (4 years ago)
David M.
Pro
API Scripter

Not sure about a dedicated script, but this could be easily done with Scriptcards. Pass a number of rolls with a query and create a loop to output table rolls.

The following rolls multiple times (default=3) on a Beholder's "EyeRays" table (this example allows duplicates - I figured I'd keep it simple for illustrative purposes). You just need to change the name of the table in the RollTable function at the bottom. 

!scriptcard {{
  --#title|Beholder Ray
  
  --:Initialize Roll Vars|
      --=NumRolls|?{NumRolls?|3}
      --=Roll|
      --=RollCount|0

  --:Loop|
      --=RollCount|[$RollCount] + 1
      -->RollTable|
      --+[$RollCount]|[$Roll.tableEntryText]
      --?[$RollCount] -lt [$NumRolls]|Loop

  --X| End macro
  
--:FUNCTIONS|

  --:RollTable|
      --=Roll|[T#EyeRays]
  --<|

}}


Awesome, thanks. I had seen PowerCards script before but avoided it, trying to make things work with out-of-the-box functionality, but clearly this was a limitation I couldn't get around so I got a ScriptCard working perfectly, appreciate the help!