PDA

View Full Version : Nested Tables



Trancekat
January 10th, 2017, 17:14
Hi All,
I have been working to create a list of vicious mockery insults. I came across some clever lists that utilize a 3 word progression for an on the fly insult.

I created 5 tables.
Table 1 - Vicious Mockery
This table has 101 entries; 100 regular line insults, and 1 row that calls Table 2.
Table 2 - 3 Word Progression
This table has 3 columns that reference tables A, B, C
Table A - First word of the "3 Word Progression" insult
Table B - Second word ...
Table C - Third word ...

When I roll 101 on Table 1, it then rolls on Table 2. It outputs to chat with 3 separate rolls for Tables A, B, and C. The output is on a different line, which makes it much less readable and impactful.

Is there a way to have the random rolls create a sentence on one line of output, please? (...and also to maintain the order of the roll?)

Thank you!

JohnD
January 10th, 2017, 17:31
Don't think so. What you're doing is essentially the same thing I put together for my random potion description tables and I was told I could not get the results to output to the same line.

Trenloe
January 10th, 2017, 17:45
Look at story templates: https://www.fantasygrounds.com/wiki/index.php/Story_Templates

Zacchaeus
January 10th, 2017, 18:12
You are going to struggle with nested table output even with Templates. Templates at least will allow you to construct a meaningful story which you can drag to chat but you are going to have to organise your tables so that each is rolled individually rather than being called from anther table.

Nickademus
January 10th, 2017, 18:33
Just play a gnome.

JohnD
January 10th, 2017, 18:37
17347

Trancekat
January 10th, 2017, 18:39
Thank you all for the responses!

jonathanscullen
January 23rd, 2017, 05:04
hi

If there is no way to concatenate the outputs of tables is there a way to import data. You could wright a quick program to give you all the permutations and rolls and just input that. Not an elegant solution but if there is a way to input that should work. I purchased some nice generators and want to enter them. So I am looking at the same sort of problem.

jonathanscullen
January 23rd, 2017, 05:59
hi

If there is no table import function build in I found a way to do it anyways. I've been doing some digging and you can find all your tables in your campaign folder. Just navigate to your data folder open campaign, open the name of your campain and you will see a file called db.xml. That file looks like it holds everything. It also looks simple enough to modify. Just open it up in an your fave XML editor I used notepad++.

The procedure I am going to use is: Create a new table in FG so It generates most of the XML, Enter one thing into the table that is unique to quickly search the XML for that line, exit FG, open the db.XML, search for your unique string, copy and past it (look bellow), increment id(look bellow), add dice rolls and the text that you want to display for that roll(look bellow). This may initially look like it is way more work but it can be done programmatically.

Sorry the tabs is not being displayed properly(past into XML editor to get a clear formatted picture.)

<description type="string">From Lee's Lists at drivethrurpg.</description>
<dice type="dice"></dice>
<hiderollresults type="number">0</hiderollresults>
<labelcol1 type="string">Slurs</labelcol1>
<locked type="number">0</locked>
<mod type="number">0</mod>
<name type="string">100 Fantasy Slurs</name>
<notes type="formattedtext">
</notes>
<resultscols type="number">1</resultscols>
<table_positionoffset type="number">0</table_positionoffset>
<tablerows>
<id-00001> <-----------------------------------------Copy every thing from here
<fromrange type="number">1</fromrange>
<results>
<id-00001>
<result type="string">Lemoncrabs</result>
<resultlink type="windowreference">
<class></class>
<recordname></recordname>
</resultlink>
</id-00001>
</results>
<torange type="number">1</torange>
</id-00001> <-----------------------------------------------To here
<id-00002> <----------------------------------------------- Past underneath your last table entree and increment the id(00001 goes to 00002)
<fromrange type="number">2</fromrange> <----------this is your bottom most roll of the die
<results>
<id-00001>
<result type="string">Tunnel Humpers</result> <---- --this is your string
<resultlink type="windowreference">
<class></class>
<recordname></recordname>
</resultlink>
</id-00001>
</results>
<torange type="number">2</torange> <-------------------this is your top most roll of the die
</id-00002> <-------------------------------------------------don't forget to change the id on your closing tag to it matches the opening tag

damned
January 23rd, 2017, 06:06
You can nest/chain them but they will output the result of each table onto its own line.

Nylanfs
January 23rd, 2017, 16:59
Note, make sure to make a backup before editing your db.xml, I know this shouldn't NEED to be said but...