PDA

View Full Version : For tables, is there a way to loop over a list and roll on each item?



alloowishus
January 18th, 2023, 15:07
I have a table which represents an Herbalist with Herbs on each row. I am generating random herbs that the herbalist has in stock. THe herbs have predefined difficulty of finding (i.e., medium, hard, absurd etc). For each herb in the list, I want to roll to see if it is in stock, so I will have to create table for each Herb I suppose, which two rows for each herb, one with the result of "None" and one with "Found x doses". So for example, an Herb that is "medium" would be 1-25 "None" and 26-100 "[1d10] doses found". Is there a way to loop over every single Herb in the list and roll on it's table?

LordEntrails
January 18th, 2023, 15:51
I don't think so, but look here for examples: Content generator 2020! (fantasygrounds.com) (https://www.fantasygrounds.com/forums/showthread.php?54306-Content-generator-2020!)

Zacchaeus
January 18th, 2023, 16:16
I think your best bet here would be to have a master table which rolls an intermediary table which is set up with the % chances of each herb appearing. And that table then rolls a random number of times on each herb table. So you'd have three tables one each for each of the herb rarities with a random number of herbs being rolled on each line. Link these tables to a three row table which has (say) 1-50 Common 51-85 Rare and 86 to 100 very rare. Then link that table to a master table which rolls a random number of times on the rarity table. (Note; this would be a lot of rolls so you might want to make sure that your tables have an odd number of rolls so that the dice animation doesn't appear - so for example each of the herb tables might have 21 rows rather than 20; that way the random number generator takes over to determine the result rather than a dice roll).

In answer to your question; no you can't cycle through every row in a table.

alloowishus
January 18th, 2023, 16:40
I see what you are saying, but the chances are really on a herb by herb basis, the overall percentage for the herb appearing doesn't quite work when you have a mixture of all different kinds of rarities.

Griogre
January 18th, 2023, 16:48
I'd segregate the herbs by rarity, ie for the med herb if you had 40 of them roll 10 times on the medium table. For the rares if they have like a 5% chance of each and you have 10 of them then have a 50% chance of one roll on the rare table.

alloowishus
January 18th, 2023, 18:04
I don't think so, but look here for examples: Content generator 2020! (fantasygrounds.com) (https://www.fantasygrounds.com/forums/showthread.php?54306-Content-generator-2020!)

Hey that's pretty cool. Most of it seems to be templated stuff, however the town/city/village images are very well done!

alloowishus
January 18th, 2023, 18:24
I'd segregate the herbs by rarity, ie for the med herb if you had 40 of them roll 10 times on the medium table. For the rares if they have like a 5% chance of each and you have 10 of them then have a 50% chance of one roll on the rare table.

Ok I will try that.

As a seperate question, is there a way to roll on a table and pass a customer mod to the roll? So similar to addind [3x] if you want it to roll 3 times is there a way to do something like "[+30] if you want it add 30 to the roll? Sort of like using the tables as functions.

Nylanfs
January 18th, 2023, 18:30
Squareware might have what you want also. https://www.fantasygrounds.com/store/?search=SQUAREWARE

Zacchaeus
January 18th, 2023, 19:11
Ok I will try that.

As a seperate question, is there a way to roll on a table and pass a customer mod to the roll? So similar to addind [3x] if you want it to roll 3 times is there a way to do something like "[+30] if you want it add 30 to the roll? Sort of like using the tables as functions.

No you can't add a custom modifier to a roll. You can manually enter a modifier into the table (or use the modifier box at the bottom left). You can also drag and drop dice onto a table. So you could set things up so that results 1-12 gives something; then 13-20 does something else and then 21-100 does another thing. You can then drop a 12, 20 or percentage dice onto the table to roll either 1-12; 1-20 or 1-100.

Griogre
January 18th, 2023, 21:01
So to follow up on Zacchaeus, that means you can have modifiers for the top level table easily but its more difficult on the nested ones.

Also I don't know if you know you can import table data. Since how you order and call tables can make a difference when I make complex interrelated tables I will do the data in Excel and then just import it because its a lot easier to modify Excel than the tables in FG. Once you make your modification you just then delete the old table and import it again.

Obviously you can use Google sheets if you don't have Excel.