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

Recursive Table doesn't ShowIcons when item names are numbers, Help?

Hello All [first time post!] I'm working on creating a macro that will do a specific set of rolls off of number of different rollable tables. Each item in the tables consists of an icon with a name that is a number. When I roll the tables in a basic way, I get the icons (which give more info than just the number) and also the sum of the numbers..which is and what I want...but the output is ugly. So I wanted to figure out a way to put this inline so I could put it in a roll template or power card...but putting it inline gets rid of the icons, of course. I thought maybe the RecursiveTable API might be the first step in getting there....since it can show icons and maybe that will bring me closer to what I want? So I made a fresh project with just one table: In the new project, with the Recursive Table API installed I began to experiment. I what I learned was this: The icons will not show if the Names of the Items are numbers. It just outputs the sum of the item names it called on the table, but no icons. I even tried it with numbers that were all unique. No dice (heh). Then I changed the names to words and the icons showed up. So it seems the problem is that the RecursiveTable API does not like it when your table item names are numbers...but I do need that functionality when the items are functions sort of like dice. Is there a way to do something about this? Where I can have the items have numbers for names so that math can keep happening, but still show the icons? Also, once I figure out how to make that work...I'm going to dive into figuring out how to output the rolls in a nicer way. Do I make a Power Card? Do I make a Roll Template and just put that in the HTML/CSS boxes for the game's settings? Is there some other way that I haven't thought of? It there any sort of weirdness I need to know about using RecursiveTables in a roll template or powercards...or some other mysterious option? Any advice would be appreciated!
1603411478
The Aaron
Roll20 Production Team
API Scripter
What command are you using?  For RecursiveTable to be active, it needs to start with !rt: !rt [[{2t[talent-diceT], 3t[knack-diceT], 1t[luck-diceT]}]]
1603427021

Edited 1603427929
To test the Recursive table the command I'm typing is: !rt[showicons] [[1t[talent-dice]]] When the names of the items in the table are words, the command works. But when the names of the items in the table are numbers, it doesn't work. So I'll set it up this way to maybe make is more clear? I have made two identical tables, but one with numbers for item names, and one with words. Here is the test-words table: And this is the output when I type !rt[showicons] [[3t[test-words] ]] I get the Icon and the label, but I don't get the sum of the numbers...because there are no numbers, which is understandable. Here is the test-num table: This is the output when I type: !rt[showicons] [[3t[test-nums] ]] I get neither icon nor label, but I do get the sum of the three number that are the labels. So...I can't get anything to show up when the labels are numbers.
1603430724
GiGs
Pro
Sheet Author
API Scripter
I havent used RT, but you probably want to remove the [ ] from around show-icons, and add a space after !rt. Aarons scripts often use [ ] around something to show the text inside is optional. But you aren't meant to use the [ ] themselves.
1603431752

Edited 1603486431
The script won't work at all if you don't use the syntax that Aaron laid out. He says in the help about things like "showicons": These are inline settings to adjust how the rolls are put together. Options are specified in [ ] right after the !rt The thing is, the command works fine if the labels are Strings, the command doesn't work if the labels are Ints. So it isn't the syntax of the command used to call the API, it is that the RecursiveTable code itself doesn't seem to work if the the labels are ints.
1603447578
The Aaron
Roll20 Production Team
API Scripter
Hmm...  that command looks right, I'll try and test this some this evening. 
Thanks, I appreciate it!
The Aaron, have you found anything more about this? I would add you to my test game if that would help, but I'm not sure how to do that--or if it would help.
I'm just checking in to see if anyone had any ideas on this conundrum?
1604808495
The Aaron
Roll20 Production Team
API Scripter
Ok, I duplicated this. If the names are numbers, it treats them as numbers and bypasses the image display. That's probably not the desired outcome, but I need to mess around with it a bit more to figure out what it should do. 
That you so much The Aaron for looking into this!