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

Trying to make it less ugly

1648611614

Edited 1648611742
Æ
Plus
Hi All, I have the following macro -   &{template:default} {{name= **Vehicle was Hit in**}}  /r ?{How many hits|1}t[?{Which|Ground-Vehicle-F/B|Ground-Vehicle-Side}]  You tell it how hits where made, you choose the table you want it to roll on and you get a result like this -   Which is rather ugly. I was hoping to get it all to sit inside the default template similar to this -   &{template:default} {{name=**Facing after Fall**}} {{[[1t[Facing-After-Fall]]]}}) Any ideas would be greatly appreciated. 
1648613283
GiGs
Pro
Sheet Author
API Scripter
In a roll template, you cant use the /roll command, and need to enclose you roll in inline roll brackets [[  ]]   &{template:default} {{name=**Facing after Fall**}} {{ [[?{How many hits|1}t[?{Which|Ground-Vehicle-F/B|Ground-Vehicle-Side}] ]] }} That said, IIRC there might be a problem with rollable tables inside the inline roll brackets. You can try this and report back what happens.
1648639129

Edited 1648639148
I thought the whole point of recursive tables was to allow putting rollable tables with rolls in them.  AKA this is api level stuff.  
1648689455
GiGs
Pro
Sheet Author
API Scripter
But we aren't talking about Recursive tables? We are talking about Rollable Tables.
1648695089
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Æ wants to use a query to decide which table to use, not have a table roll determine which table roll to use, is my interpretation. Don't recall off the top of my head if this violates the order of operations.
1648696423

Edited 1648696434
GiGs
Pro
Sheet Author
API Scripter
Ah, that explains where Eddie got the idea of it being a Recursive Table thing. You can use queries to get or create table names. There might even be a tip in the Useful Tips thread about that.
Firstly, thanks for the responses. keithcurtis said: Æ wants to use a query to decide which table to use, not have a table roll determine which table roll to use, is my interpretation. Don't recall off the top of my head if this violates the order of operations. What the macro needs to do is ask how many times to roll on the chosen table. Which does work the way I need it to I just wanted to display it all in a nice little layout like my second example above. GiGs said: In a roll template, you cant use the /roll command, and need to enclose you roll in inline roll brackets [[  ]]   &{template:default} {{name=**Facing after Fall**}} {{ [[?{How many hits|1}t[?{Which|Ground-Vehicle-F/B|Ground-Vehicle-Side}] ]] }} That said, IIRC there might be a problem with rollable tables inside the inline roll brackets. You can try this and report back what happens. This is an improvement but unfortunately it only displays the first roll on the table not all the rolls made. Weirdly if I hover over the result it does display all the results made on the table so that is close to what I need. Thanks again everyone.
1649041864
GiGs
Pro
Sheet Author
API Scripter
Æ said: GiGs said: In a roll template, you cant use the /roll command, and need to enclose you roll in inline roll brackets [[  ]]   &{template:default} {{name=**Facing after Fall**}} {{ [[?{How many hits|1}t[?{Which|Ground-Vehicle-F/B|Ground-Vehicle-Side}] ]] }} That said, IIRC there might be a problem with rollable tables inside the inline roll brackets. You can try this and report back what happens. This is an improvement but unfortunately it only displays the first roll on the table not all the rolls made. Weirdly if I hover over the result it does display all the results made on the table so that is close to what I need. Unfortunately, that's the problem I alluded to. You cant show more than one table result in an inline roll, which means if you want to show more than one result, you cant use a rolltemplate. You have to use the /roll command.
Cool. I assume that you may be able to do so if using API level access? Either way it is a lot neater using the suggested method. Thanks again.
1649048572
GiGs
Pro
Sheet Author
API Scripter
Yes, you can definitely do it with the API, though it might not be straightforward. Using a script like Scriptcards might be be ideal, and avoid the problem of coding your own script.
Thank you to all.