PDA

View Full Version : How to code in a table rolling a amount of on a random item from another table.



Shogar
November 16th, 2021, 20:03
Sorry Question was worded wrong.. chalk it up to being late and brain fried.

Not sure if this has been asked before (found nothing in search).

I want to create a table that has x many types of items off another table (i.e. random gear), but also have a random # of said selection.

[1d8+1][Random gear] will select 2-9 random items.

Say it rolls 3 items
Lantern
Bedroll
Iron Ration

Is there a way to tell it how many of the item selected such as 4 lanterns instead of just Lantern without having it in the selection rolled in the table called such as "Radom Gear"?
Otherwise I need to make a different table for each of the population sizes (thorp, village, etc.)

Moon Wizard
November 16th, 2021, 20:33
There's no way to pass a variable between tables as you're rolling. You can only specify how many times to roll on the next table, or how many items on the current table.

Regards,
JPG

Zacchaeus
November 16th, 2021, 21:12
You might find story templates are a better fit for what you want to do. Details here https://fantasygroundsunity.atlassian.net/wiki/spaces/FGCP/pages/996640973/Using+Story+Templates+to+Create+Random+Storiesand see this video https://www.fantasygrounds.com/forums/showthread.php?37400-Video-on-Story-Templates and video Twenty Two here https://www.fantasygrounds.com/forums/showthread.php?55797-How-do-I-in-Unity&p=492112#post492112

Shogar
November 16th, 2021, 21:54
OK, Thanks all