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 .
×

The new D&D 2024 sheet is now available!

Create a free account

Real Rollable Tables with natural roll

I am currently trying to use Lithl's Real Rollable Tables script to integrate all the tables from DCC RPG into the character sheets. It works perfectly, but I have one minor issue. The !rt returns the number rolled after all modifiers are applied, but doesn't show the actual die roll. Here for example: I've rolled a natural one, which has its own special rules, but it's very easy to overlook the natural 1 in play, especially when all those modifiers are larger numbers. Is there any way to make that visible? Thanks as always for all your help with my ham-fisted tinkering.
1686422459

Edited 1686422471
Gauss
Forum Champion
Jan K. said: I am currently trying to use Lithl's Real Rollable Tables script to integrate all the tables from DCC RPG into the character sheets. It works perfectly, but I have one minor issue. The !rt returns the number rolled after all modifiers are applied, but doesn't show the actual die roll. Here for example: I've rolled a natural one, which has its own special rules, but it's very easy to overlook the natural 1 in play, especially when all those modifiers are larger numbers. Is there any way to make that visible? Thanks as always for all your help with my ham-fisted tinkering. Depending on the macro you are using you could pull the roll out and display it separately via Reusing Rolls .
1686439135
timmaugh
Pro
API Scripter
Metascripts can help. Muler would let you use a roll against a table (so you could roll with modifiers). Whether or not you needed to roll against a table with modifiers, it would return the element from the table (in this case, it sounds like that would be an inilne roll). ZeroFrame will run a loop of metascript operations that would allow that inline roll to expand in your command line. That would give you the opportunity to present the roll with the roll tip (hover information), and/or to do other things with the roll. What is the table name, and what command line are you using to get the information? We might have to change the command line (in terms of using one script or another, or employing the metascript data into your existing command), but that will at least give me a starting point to show an example of what I'm describing.
timmaugh said: Metascripts can help. Muler would let you use a roll against a table (so you could roll with modifiers). Whether or not you needed to roll against a table with modifiers, it would return the element from the table (in this case, it sounds like that would be an inilne roll). ZeroFrame will run a loop of metascript operations that would allow that inline roll to expand in your command line. That would give you the opportunity to present the roll with the roll tip (hover information), and/or to do other things with the roll. What is the table name, and what command line are you using to get the information? We might have to change the command line (in terms of using one script or another, or employing the metascript data into your existing command), but that will at least give me a starting point to show an example of what I'm describing. In the above example the table is called magic-missile, and the command (using this script ) is just: !rt @{WizardSpell} @{ActionDie} + @{Level} + @{Intelligence_mod} + @{WizardSpellCheckMisc} + ?{Spellburn|0} I set that up as a button on the character sheet, and it just rolls on the table with the same name as the WizardSpell attribute using all the relevant modifiers from the character's attributes.
Gauss said: Depending on the macro you are using you could pull the roll out and display it separately via Reusing Rolls . Thanks for this tip - I've finally figured out how to add a Warrior's Deed Die to his damage roll using this! Whilst playing around trying to get this to help me with the spellcasting macro, I've kind of solved my problem - but I don't understand how. If the command is written like this: !rt @{WizardSpell} [[@{ActionDie}]] + @{Level} + @{Intelligence_mod} + @{WizardSpellCheckMisc} + ?{Spellburn|0}" It does display the number rolled on the Action Die, in a very odd way: The Action die result shows up a "1d0 + x". By experimentation the x is always a number in the range of the selected Action Die, so I think the roll is working correctly, but I don't really understand what I'm doing.
1686496569

Edited 1686503785
timmaugh
Pro
API Scripter
What are the contents of @{WizardSpell}? I'm guessing that's where the reference to the magic-missile table is...?
timmaugh said: What are the contents of @{WizardSpell}? I'm guessing that's where the reference to the mafic-mussile table is...? Yes, the WizardSpell attribute is set by a text box on the character sheet. Type there 'magic-missile' and it rolls on the spell table named magic-missile.
1686505301
timmaugh
Pro
API Scripter
OK, so if I understand what that script is doing, it is using the info you supply: @{ActionDie} + @{Level} + @{Intelligence_mod} + @{WizardSpellCheckMisc} + ?{Spellburn|0} ....to create a roll. The value of the roll is the item it then pulls from the rollable table. What you need it to do is to ALSO show you the value of the result of your math/roll. If I have that correct, I could approach it 2 ways. Option 1 - ZeroFrame Batching ZeroFrame batching lets you share roll values from one command line to another. Your tinkering with the script command line shows that it likely is set up to handle inline rolls, so that means you could construct your roll in one line (giving you a breakdown of the component parts), and then re-use it in the script line... !{{   {&template:default}({)name=Components(})({)Table=@{WizardSpell}(})({)Action Die=@{ActionDie}(})({)Level=@{Level}(})({)Int Mod=@{Intelligence_mod}(})({)Misc=@{WizardSpellCheckMisc}(})({)Spellburn=?{Spellburn|0}(})({)Final=[[ @{ActionDie} + @{Level} + @{Intelligence_mod} + @{WizardSpellCheckMisc} + ?{Spellburn|0}]] (})   !rt @{WizardSpell} $[[0]] }} Air-coded caveats apply. That would give you a templated output above the output from the script, which would break down your roll parts. I used the default template, but if you understand how to do that one, you could change it to another template if you like. Also, I used your equation, assuming that the parts were all numbers and therefore OK to put in an inline roll. If they are not, we might have to tweak the above. Finally, each reference comes without a character component (as your initial version showed); that of course means that the above version will have to also be placed on a character sheet (e.g., it wouldn't work from a Collections tab macro). REQUIRED SCRIPTS: ZeroFrame (and all supporting scripts from 1-click install),  Lithl's Real Rollable Tables Option 2 - ZeroFrame + Muler Muler lets you get an item from the same table using a roll/modifiers, and ZeroFrame lets you output it to chat. Using those two scripts (and associated/supporting scripts that come when you install from the 1-click), you could use something like: !&{template:default}{{name=Table Retrieval Proof of Concept}}{{ Table=@{WizardSpell}}} {{ Action Die=@{ActionDie} }}{{ Level=@{Level} }}{{ Int Mod=@{Intelligence_mod} }} {{ Misc=@{WizardSpellCheckMisc} }} {{ Spellburn=?{Spellburn|0} }} {{ Final=[[ @{ActionDie} + @{Level} + @{Intelligence_mod} + @{WizardSpellCheckMisc} + ?{Spellburn|0}]] }}{{Retrieved Item=get.Table.@{WizardSpell}.$[[0]].value/get}} Air-coded caveats apply. That again assumes you are putting this on a character sheet, that the name of a valid table is in the @{WizardSpell} attribute, and that the result of the table retrieval would work in a template. If the contents do not lend themselves to being included in a template, we could put a Muler get statement on its own line. REQUIRED SCRIPTS: ZeroFrame (and all supporting), Muler (and all supporting)
Using both of the above approaches, the API scripts stop working (error message below). The tables should work fine in a template, if I try just something basic like &{template:default}  {{[[1t[magic-missile]]]}} it works, but anything more complicated goes wrong somewhere. While I do appreciate all the help, for my purposes I'm satisfied with the half-arsed solution in post #5, so please don't waste any more time on this unless it's bothering you! For reference, the error message generated was: TypeError: Cannot read properties of undefined (reading 'substring') TypeError: Cannot read properties of undefined (reading 'substring') at handleInput (apiscript.js:291:35) at eval (eval at <anonymous> (/home/node/d20-api-server/api.js:168:1), <anonymous>:65:16) at Object.publish (eval at <anonymous> (/home/node/d20-api-server/api.js:168:1), <anonymous>:70:8) at /home/node/d20-api-server/api.js:1762:12 at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560 at hc (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:39:147) at Kd (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:546) at Id.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:489) at Ld.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:94:425) at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:111:400