PDA

View Full Version : Table question



kalmarjan
December 26th, 2016, 06:34
I have two questions regarding tables:

Is it possible to have a value on the table for a natural 1 or 20 on the die roll?

Is there a way to add your level to the die roll?

If like to make a version of carousel tables that adds your level to the result of a d20 roll. I'd also like to make something special happen on the result of a natural 1 or 20 (whereas level won't matter.)

damned
December 26th, 2016, 08:11
I have two questions regarding tables:

Is it possible to have a value on the table for a natural 1 or 20 on the die roll?

Is there a way to add your level to the die roll?

If like to make a version of carousel tables that adds your level to the result of a d20 roll. I'd also like to make something special happen on the result of a natural 1 or 20 (whereas level won't matter.)

No. You can have different things on a 1 and a 20 but not once you introduce modifiers.

kalmarjan
December 26th, 2016, 08:28
Okay, makes sense.

Can you add level as a modifier?

Zacchaeus
December 26th, 2016, 09:55
Not that I'm aware of. You can add modifiers but only numbers, so you can do it manually.

Bidmaron
December 26th, 2016, 15:51
Okay, makes sense.

Can you add level as a modifier?

Kalmarjan, I am working on some improvements to the built-in table functionality, and I suppose I could add this in using the new [LVL] etc mods that MW is putting into CorePRG. As for the natural one or 20, I'd have to think about how that could possibly be done. There are several questions that arise:

So, if only a natural 20 made a certain result, what happens if you roll a modified amount that equals 20. What would the result be?
What if the natural roll were a one, but the modified roll was, say a four? Would the natural one result apply or the four?
Negative modifiers would result in opposite concerns.

In short, I don't see how you could define any kind of reasonable mechanic to handle 'naturals.'

kalmarjan
December 26th, 2016, 20:01
I guess I was thinking more in 3.5 terms, where a natural 1 or 20 meant something, regardless of modifiers.

Instead, I'd just prefer to be able to add the level modifier and forget the "natural" rolls.

Nickademus
December 26th, 2016, 20:32
In short, I don't see how you could define any kind of reasonable mechanic to handle 'naturals.'

If you are rewriting the xml class and lua code that operates tables, it would be quite easy. Have two special xml fields at the top and bottom of the table entry list for natural extremes where the creator can place special results. In the function that processes the result of the Roll, have it run the die result through two conditionals (if aRoll.roll == 1 then; else if aRoll.roll == 20 then), using the special results and breaking afterward. Then follow with the normal code dealing with the aRoll.result variable.

Bidmaron
December 26th, 2016, 22:08
so if you roll a one or twenty no matter what the mod is you ignore the mod?

The other issue is that if you use the fg modifier feature, you cannot trap that I don't think?

Nickademus
December 26th, 2016, 23:56
You can. I'm just assuming this based on the architecture of the rulesets, but when the button on the table is clicked, the lua code for the window gathers the data from the table for the roll (the die, the mod, hidden or not, etc.) then sends the request to one of the manager scripts (I don't remember which one). A table containing all the roll data along with a callback function is passed, usually called aRoll I think. The manager script grabs the data from the ruleset regarding dice rolls, grabs the data from the modifier stack, and checks to see if the passing objects can have effects that would affect the roll. A table can't have effects, so the last part is ignored. Then the die is rolled and the resulting number and total are added to the aRoll variable table.

The roll is then passed to the callback function containing all the bits of information (die, mod, hidden, roll result, total, chat message, etc.). You create this callback function for the table window, so you can take this aRoll variable and extract the roll without modifiers, the total with modifiers, the message for the chat window (to modify it), and so on. You have total control at this point.

Bidmaron
December 27th, 2016, 03:56
Thanks, Nickademus. The functions to which I believe you were referring are PerformRoll, onTableRoll, and processTableRow. They have a parameter that permits use of the modifier stack, but it looks like that is always turned off. I am definitely looking at doing some override here. I hadn't considered a natural roll specifier, but it sounds like a good add. What would you think about the syntax for that? I am thinking some kind of flag or perhaps a checkbox in the 'To' box that would indicate the 'From' box is a natural roll result. If you had a natural roll result, you'd also have to provide a second row covering the 'non-natural' result.

The other thing I am trying to figure out is the problem Myrdin discovered, where table column results are being rolled in backwards order (at least that is what it is consistently doing for me, although Myrdin claimed in his tables that it would roll out inconsistently. In one of my tables, I have the following in a column "[Relative Age of Sibling] dwarf [Birth Sex of Dwarf]" which consistently plays out in chat and story as 'dwarf,' followed by either 'brother' or 'sister,' followed by either 'younger,' 'older,' or 'twin.' What is supposed to come out is something like 'older dwarf brother.'

What I suspect is happening is that the asynchronous rolls are being processed LIFO. The code that calls the action manager appears to be making the rolls in the order they appear, but the output is coming out backwards. The fact that 'dwarf' comes out first is an artifact of the way the table roller builds its roll records, and I can fix that, but the asynchronous rolls I have to figure out. I need to look at the story templates because that functionality must occur in the listed order for the results to make sense. I suspect it is not using the action manager to do the rolls but directly producing results synchronously.

Nickademus
December 27th, 2016, 04:26
I'd have to look through the table code to give any advice on it specifically. I'd rewrite it to match the logic flow of the ruleset code, though. Look at the processing of a skill check for a good example of packaging roll information and retrieving it.

The other thing I am trying to figure out is the problem Myrdin discovered, where table column results are being rolled in backwards order (at least that is what it is consistently doing for me, although Myrdin claimed in his tables that it would roll out inconsistently. In one of my tables, I have the following in a column "[Relative Age of Sibling] dwarf [Birth Sex of Dwarf]" which consistently plays out in chat and story as 'dwarf,' followed by either 'brother' or 'sister,' followed by either 'younger,' 'older,' or 'twin.' What is supposed to come out is something like 'older dwarf brother.'

What I suspect is happening is that the asynchronous rolls are being processed LIFO. The code that calls the action manager appears to be making the rolls in the order they appear, but the output is coming out backwards. The fact that 'dwarf' comes out first is an artifact of the way the table roller builds its roll records, and I can fix that, but the asynchronous rolls I have to figure out. I need to look at the story templates because that functionality must occur in the listed order for the results to make sense. I suspect it is not using the action manager to do the rolls but directly producing results synchronously.

'dwarf' will come out first because it is a string and doesn't have to wait for the roll result to be added to the output message. Anything relying on a series of rolls will be unpredictable since the dice have to finish the roll physics before a result will be known. The amount of time for a roll might be very similar if initiated automatically (as opposed to a die being dropped on the chat window) but there will still be little variations that could affect the timing. Of course, if you are using a #d# that isn't a die model, it won't roll at all.

If you need a string in a certain order, intercept the message before it gets to the chat window and reorder it using regular patterns or the results table.

Myrdin Potter
December 27th, 2016, 07:29
I can assure you that is does last to first after the first string, except that sometimes it does not. I am outputting to a story entry and there are enough times that it is not last to first order that there has to be something else going on.

I just entered over 200 tables into a campaign and a few of them have sub-tables. All the results are simple but the order it appears in is not consistent when you are waiting for several tables results.

I did find if you want to output "2d6 orcs", then the die roll result (in square brackets in the table itself) always goes first in the line.

kalmarjan
December 27th, 2016, 09:33
Here's one that I am currently trying to figure out. Is there a way a player can roll against the table to get the results of a character's Persuasion check? automatically?

damned
December 27th, 2016, 11:00
Here's one that I am currently trying to figure out. Is there a way a player can roll against the table to get the results of a character's Persuasion check? automatically?

What ruleset? You should be able to do this. Mask_of_winter does something like that for PbtA games.

Bidmaron
December 27th, 2016, 13:10
Kalmarjan, will the rollon command not do what you want?

/rollon [table name] <-c [column name]> <-d [NdN+N]> <-hide>

It is documented in the wiki, and the help for it is being added in 3.2.2.

Bidmaron
December 27th, 2016, 13:57
Myrdin, I understand you are seeing different order of the rolls, but is the order consistent on a given row. That is, do the rolls always come out backwards in some rows and in a different order in other rows?

I haven't found a way to register a callback when a roll is finished, but maybe I just haven't looked in the right places. That would be one way to fix the problem.

The other way is not to use interactive dice. I am not sure why you even need that in a table roll. If the user institutes using the /rollon command, maybe the dice should be used, and if the output is to chat, I can see using dice. However, if the output is to anywhere else, why would you want interactive dice?

Thoughts anyone?

damned
December 27th, 2016, 14:22
At the present the only way to not roll dice - either thru the GUI or the /rollon command is to roll non standard dice - eg d7 or d5 or d18

Bidmaron
December 27th, 2016, 15:03
damned, it would be easy to override that in the table manager. Rather than call PerformAction (which ultimately calls comm.throwDice), the table manager would simply synchronously resolve the dice roll using the random function for the dice results. I really cannot see a downside to this.

Myrdin Potter
December 27th, 2016, 15:33
I can roll on the linked tables I have and get different results in different order. I have not tested just one row to see if the row is always the same but different rows coded in the exact same order have different results.

Bidmaron
December 27th, 2016, 15:38
Myrdin, I cannot duplicate. Can you tell me exactly a row doing that? I can duplicate that row in a new one row table and experiment and see if I can nail it down.
My own multi-row tables are all behaving in very consistent fashion

Also, can you address my idea of not using interactive dice? I cannot see why you would ever want them other than maybe a rollon command that outputs to chat window

Myrdin Potter
December 27th, 2016, 15:43
I don't care about the animated dice during a table roll. They are a visual reminder that the system accepted my mouse click, but otherwise they are glitz that looks like a table top die roll. If the timing of those dice mess up the table results, then I could do without them.

The triple linked table I sent you does not report in the same order every time for me. None of mine do. The issue is that the tables are all in the campaign where they were not designed and on my fast machine. If dice timing matter, then different machines might give different results.

Myrdin Potter
December 27th, 2016, 16:02
17071

If you look at the middle results, you will see different order for serpents.

Bidmaron
December 27th, 2016, 18:04
Since fg is single threaded and there is no onTime type of handler, I don't think there is a way to circumvent the problem while still displaying dice rolls. Here is what I am thinking:

1. Provide a global setting in options with the following options:(which #2 overrides):
A. Legacy-tables work exactly like they do now.
B. Chat interactive-any table outputting to chat will use video rolls. Other outputs use sychronous rolls.
C. Synchronous-All rolls performed synchronously.
2. When you open a table and control click the edit icon, the first click switches to chat interactive for that table and sub tables. Subsequent clicks cycle through settings above for the table and and table rolled from it.
3.Ability to replace dice specifications with [#table], which uses whatever the table roll was. If this is a top level table, this roll value will be zero.
4. Ability to use [#row], which uses whatever roll was made to get to the table row where it is used.
5. [#colx,y], where x is either an integer or omitted, to get the xth roll made in the yth column.
6. Ability to define natural result rows to implement things like criticals. I am thinking you do this by entering an asterisk in the 'to' column.
7. Ability to use <> substitution strings like in story templates.
8. Ability to use null tables with []. This would be useful to roll a number for use with the [colx,y] above.
9. Ability to create a set result by surrounding multiple columns entities with {}. Thus, [d2x]{[Relative Age of Sibling] dwarf [Dwarf Sibling Sex]} would result in one or two dwarf siblings either younger or older.
10. /rollon command lets you change dice and modifier to use on a table.

Zacchaeus
December 27th, 2016, 18:09
Here's a clearer picture of what Myrdin is talking about. When you make rolls on nested tables you can't guarantee the order that the results will fall since it depends on when the dice stop rolling. So as you can see whilst it will do things in the right order (result from table two and then table three) it will also be just as likely to finish table 3 then table 2.

Bidmaron
December 27th, 2016, 18:17
As you see in my previous post, I have given up on fixing this with built in dice. Do you think my proposal makes sense ?

Nickademus
December 27th, 2016, 18:20
I know very little about the code for tables, so this may not be helpful, but why can't you just collect the data and, instead of just sending it to a story entry, reformat it and then send it to a story entry?

Bidmaron
December 27th, 2016, 18:24
That is exactly what I am doing. I just want to see what folks want in new or improved over table functionality so I can design toward it instead of stumbling toward it.
It just needs to preserve what is there because you can bet someone wants it to work like it does now.

Nickademus
December 27th, 2016, 18:31
... because you can bet someone wants it to work like it does now.

Yeah. Me. *grumpy*

Zacchaeus
December 27th, 2016, 18:37
As you see in my previous post, I have given up on fixing this with built in dice. Do you think my proposal makes sense ?

Yeah, we both posted at the same time.

I'm not sure I follow all what you are trying to do, but what I would say is don't make it too complicated. Whilst trying to squeeze everything everyone would want in is admirable you may end up with way too many weird options and the basic functionality gets lost. For what Myrdin wants to do for example would be way easier to do in templates and there's no rules that I can see where a roll of a natural 1 or 20 would matter. Certainly I've seen chaps looking for a roll made on one table to then have the same value applied to a number of other tables; and that might be the most useful feature to try and figure out.

Bidmaron
December 27th, 2016, 18:48
Well the guy who started this thread wanted naturals, and the typical 3.5 crit mechanism needs it. I am not sure why anyone would want it in a table though. I don't intend to break or modify existing functionality in any way. That is primary design objective

Zacchaeus
December 27th, 2016, 18:58
Well the guy who started this thread wanted naturals, and the typical 3.5 crit mechanism needs it. I am not sure why anyone would want it in a table though. I don't intend to break or modify existing functionality in any way. That is primary design objective

Yes, I should have been clearer. I can't see why it's needed in a table.

Bidmaron
December 27th, 2016, 21:32
Kalmarjan would you like to chime in as to what your use case is buddy?

Myrdin Potter
December 27th, 2016, 23:41
The book I converted (over 200 tables) is just a book of tables. Most are not nested.

So, in theory since I have all the tables created, I can create a story template for each table, almost all of them just roll on the single table.

I am going to create some story templates anyways because there are groups of tables (some relating to dragons or dungeons or characters), so I can create just the nested ones there, but the main table of contents points to the tables.

If Bidmaron can make it so that table users know exactly what order it outputs in (as written Is best), then that solves my issue. I will read up on story templates but the output of the table is a bit messed up now, for even simple tables, so why not fix it?

Andraax
December 28th, 2016, 00:24
Err, if each is just a roll on a single table, and you want your output to be a story entry, why not just change the table's output to "story"?

Bidmaron
December 28th, 2016, 02:41
Andrax, story output has the same order problem as chat. Story templates do not because they do not use interactive dice. The trouble is that it is not intuitive to go to stories when you want to roll on a table.

Andraax
December 28th, 2016, 02:47
Andrax, story output has the same order problem as chat. Story templates do not because they do not use interactive dice. The trouble is that it is not intuitive to go to stories when you want to roll on a table.

If it's a single roll on a single table, how can there be an order problem?


The book I converted (over 200 tables) is just a book of tables. Most are not nested.

So, in theory since I have all the tables created, I can create a story template for each table, almost all of them just roll on the single table.

(Emphasis mine.)

Bidmaron
December 28th, 2016, 03:01
But some are not and hence the problem. And most would never think to go to stories to roll on a table. This software is great but putting up roadblocks to approachability is not the best interface design

Myrdin Potter
December 28th, 2016, 03:08
The single tables only produce one result and I already output to story. It is the tables that reference sub-tables that are inconsistent.

There is a solution in the story templates and I will learn them next, but I think the table code should be fixed as story templates are overkill for most simple table work.

Bidmaron
December 28th, 2016, 03:09
Working it myrdin.

Myrdin Potter
December 28th, 2016, 03:13
Which is why I always mention little quirks or issues I see because I know the developers (or developers without "the") read these forums and more bugs and quirks would be fixed if they actually knew they existed.

:-)

Bidmaron
December 29th, 2016, 13:26
OK, I think I have figured out a way to ensure the results come out in the right order even if you use dice rolls. You could probably do it like Nickademus suggested and intercept chat messages as they come, but I think the better way is to intercept the rolls as they are completed. When initializing a table roll, I will zero the number of rolls and the last roll number completed. In performTableRoll, I will record the sequential roll number into the rRoll record before dispatching the roll action to the action manager (which eventually hands off to the Comm dice roller). So, in onTableRoll, which the action manager calls as each roll is completed, I will check to see if the roll completed is one above the previous processed roll. If not, I will store the roll results and await the next result to come in. If it does match, I will process the roll, outputting where desired, and then I will check the stored results queue to see if the next roll I need is already completed, looping back to process it if so (and repeating for every already-queued result I stored if it is the roll I need).

I think that process will work. I will let you know as I test it.