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 Tables help

I'm trying to use recursive tables with the default roll template as a simple weather generator.  I have a table for variations in degrees with inline rolls for the table items.  I'm also using a query for each month in the calendar with a base temperature for each month.  The problem is that the temperature is coming up the same every month as just the base temp, so it seems as though the recursive table part is not rolling.  Here's the offending part of the macro:

{{Temperature=[[?{Month?|Hammer,0|Alturiak,2|Ches,5|Tarsakh,10|Mirtul,15|Kythorn,20|Flamerule,25|Eleasis,20|Eleint,15|Marpenoth,10|Uktar,5|Nightal,2}+[[1t[Temperature] ]] ]] degrees}} 

at the beginning, I've got the !rt command before the template command, as follows:

!rt &{template:default} 

So, am I missing something?
September 16 (7 years ago)
The Aaron
Pro
API Scripter
You mean it's basically adding 0 for [[1t[Temperature] ]] ?
September 16 (7 years ago)
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
What are you value options for the temperature table?
Well, when I select "Hammer" (base temp of 0), it just shows 0, as if it's not adding the variation roll (the Temperature table).  When I select Kythorn, for example, the temperature always comes up as 20.
September 16 (7 years ago)
The Aaron
Pro
API Scripter
What's the output of this:
([[1t[Temperature]]])([[1t[Temperature]]])([[1t[Temperature]]])([[1t[Temperature]]])([[1t[Temperature]]])([[1t[Temperature]]])


September 17 (7 years ago)
The Aaron
Pro
API Scripter
Hmmm. I'll try to duplicate tomorrow. 
September 17 (7 years ago)
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Aaron, doesn't RT parse the inline rolls by drilling down, so by the time it gets to the inline roll of the table, there's no inline roll surrounding it to make it add to the query result? Still doesn't explain why it's always 0.
September 17 (7 years ago)

Edited September 17 (7 years ago)
The Aaron
Pro
API Scripter
You're completely right, Scott!  
So...does that mean it can't do what I want it to do?
September 17 (7 years ago)
The Aaron
Pro
API Scripter
That means it won't work the way it is right now.  I'm going to experiment and see if I can figure out a solution.  The problem is that the outermost calculation is performed before sending it to the API server.  I might be able to set up RecursiveTable to roll that back and re-perform it as part of its execution.
September 17 (7 years ago)
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator

Scott C. said:

 Still doesn't explain why it's always 0.

Oh, wait, yes it does, because the value of a recursive table is 0 if the option isn't explicitly a number.
September 18 (7 years ago)

Edited September 18 (7 years ago)
I guess I could just re-work the temperature table with just plain numbers instead of rolls.  The probabilities will be off, I suppose, but that's not a big deal.

EDIT: No, that's not working either.

EDIT: Yes it is, I made a different mistake in copying the formula for testing.  It's working with simple numbers in the Temperature table (not an inline roll).
September 18 (7 years ago)
The Aaron
Pro
API Scripter
To get proper distributions, you could expand out the possible values in your table. Here are the values and weights:
-20        1
-15        1
-10        1
 -5        1
  0        3
  1        3
  2        4
  3        4
  4        3
  5        4
  6        2
  7        2
  8        2
  9        2
 10        2
 15        1
 20        1
Thanks!
i am just wondering what is the proper syntax for the roll to be used in a rt vers using the roll in a macro. i have one currently set up to roll in a macro then combine it with a rt but what i would like to do is. use a macro to trigger table1 that can contain all possible loot for now say 4 elixirs and random sp,cp,gp,ep, random gem of various value. to see the test case example see https://app.roll20.net/forum/post/5622817/loot-drop-rolltable-and-macro-use fell free to answer there or here. 
Thanks again for your assistance script god... you have made my life so much easier once i fill in the loot table :D plus it helped me understand so many more scripts that my next steps are already done, easy xp , was next but that is done... torch will take time but i think i will set up token actions in my build game aka map generator, for it and simple have the script setup and running in my actual game. 
October 11 (7 years ago)
The Aaron
Pro
API Scripter
No problem! =D