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 .
×
Create a free account

Help with Macro: Use result in a Rollable Table.

Hello, I am currently trying to create a macro that utilizes the result of a roll to call up an item name in the rollable table. For example: I roll a 2d6, and it results in 11. the rollable table has a name with weight 11, and it outputs; "You gravely wounded the enemy!". Another example: I roll a 1d4, and it results in 1. It outputs; "you scratched the enemy!". I am going to use a drop down query, so it knows which roll I am using.
Not quite the way you are describing. if I am understanding you correctly.  You can however, have your tables to be "You did 1 damage, you scratched the enemy!" and make tables for all possible damage range expressions.  But I do not think you can call out a specific table entry.
Naming an item in the table ain't the problem, is calling out that specific item. For example: I can do something like this: &{template:default} {{name= Wounds}} {{[[1t[Wounds]]]}} This allows me to roll the table, and get the name, but I cant get a specific item, the table rolls for me. And I do not know how to handle cases of 2d6. If it was just 1d6 or 1d10's then yea, easy.
1545087405
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Rollable tables are very simple in that regard. They can give random (though weighted) results, but you cannot call out a specific result, nor can you weight the roll. I.e., you can't 1d10+10 to get only the results 11-20.
Darn, I guess il have to figure out some other way to get this macro to work, else il have to create a program just for this. Thanks for the info Keith.
1545088145
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I think there is a table API that allows you some control, but I'm on my way out the door right now. It might be worth a look-see. I think it's pretty old, though.
You would need to build all of the results tables, then build a macro with a dropdowns that call the appropriate table. Aaron the Scriptomancer did a recursive table API a while back that would probably do everything you want. You would need a Pro level subscription. You might want to look up his Recursive Table Script and see if it will work for your needs.
Thanks for the info al e. It seems his table would work for what I want. But I currently play at a rhythm of once a month, I do not know if paying for pro for 1 time use a month is alright for me.
1545109538
Kraynic
Pro
Sheet Author
While it would be a pain to set up, but you could probably use rollable tables alone.&nbsp; There is a trick in the Stupid Tricks thread that was intended for treasure tables, but you could probably do damage with a corresponding message.&nbsp; There would be no dice rolled, it would just use the weights you build into the tables for probability. <a href="https://app.roll20.net/forum/post/5899495/stupid-roll20-tricks-and-some-clever-ones/?pageforid=6948596#post-6948596" rel="nofollow">https://app.roll20.net/forum/post/5899495/stupid-roll20-tricks-and-some-clever-ones/?pageforid=6948596#post-6948596</a>
Kraynic said: While it would be a pain to set up, but you could probably use rollable tables alone.&nbsp; There is a trick in the Stupid Tricks thread that was intended for treasure tables, but you could probably do damage with a corresponding message.&nbsp; There would be no dice rolled, it would just use the weights you build into the tables for probability. <a href="https://app.roll20.net/forum/post/5899495/stupid-roll20-tricks-and-some-clever-ones/?pageforid=6948596#post-6948596" rel="nofollow">https://app.roll20.net/forum/post/5899495/stupid-roll20-tricks-and-some-clever-ones/?pageforid=6948596#post-6948596</a> How do I handle cases where something like 1d10 get rolled, and someone else rolls a 2d6 (where minimum is 2)? This looks fine, but I need to solve that problem.
1545172819

Edited 1545173310
You solve that problem by having one table with all the weights for a 1d10, and a different table with all the weights for 2d6.&nbsp; You could call one table wundeeten and the other twodeesix. As a way out there alternative, you could roll a 1d10, then add narratively the effects.&nbsp; Roll20 was not built to create automated games, just facilitate player moderated gaming across the internet - the crux of your problem is you are wanting a degree of automation that will require a lot more effort on your part to get working within the limitations of the program. You could go a sort of half degree, and create a single macro that will query you for the damage that was done, and you type it in and the output of the query options matches your narrative.&nbsp; You can then set this up as a macro button, so when ever someone rolls a damage roll, you hit the button, select the damage result from the drop down, and the macro chats out the description. If you do wind up going the script route, it might be possible to create a very fancy script that will 'listen' for a damage roll, and announce the narrative of that roll via a query - but the base roll20 has no way to pass arguments to functions, or even functions for that matter - even this script idea is basically setting up a 'bot' element who is simply looking for a specific text dialogue in chat to trigger, as opposed to an actual function call.
This seems too much work, I used as an example, 1d10 and 2d6. But theres many many more, just look at all different type of weapons and ways of attacking. I think im better off creating an external program than creating a table for all damage dices.
1545188511
Kraynic
Pro
Sheet Author
Anything that isn't a standard part of their focused games is going to be a fair amount of work.&nbsp; A benefit of putting in that time is that if you build a base game with stuff like this, you can copy it any time you want to start a new game.&nbsp; Then you only have to do it once, and you are keeping everything in the same interface.
I think im better off making an external program and wait until roll20 adds something that can help me with my case. Literally the only thing I would benefit off would be from having everything in the same interface if I did it in roll20. If I do it with an external program it becomes a heck of a lot easier (Javascript).
Hi I have a question. Is there for the roll20 macros a way to roll xd4 and discard&nbsp; the last dice?
The M. said: Hi I have a question. Is there for the roll20 macros a way to roll xd4 and discard&nbsp; the last dice? Yes, Although, I have not touched it, you can roll and discard either last dice or lowest dice. Check keep and drop in this webpage. <a href="https://wiki.roll20.net/Dice_Reference#Grouped_Roll_Modifiers" rel="nofollow">https://wiki.roll20.net/Dice_Reference#Grouped_Roll_Modifiers</a>
1545340321

Edited 1545340378
vÍnce
Pro
Sheet Author
Abner said: The M. said: Hi I have a question. Is there for the roll20 macros a way to roll xd4 and discard&nbsp; the last dice? Yes, Although, I have not touched it, you can roll and discard either last dice or lowest dice. Check keep and drop in this webpage. <a href="https://wiki.roll20.net/Dice_Reference#Grouped_Roll_Modifiers" rel="nofollow">https://wiki.roll20.net/Dice_Reference#Grouped_Roll_Modifiers</a> AFAIK, keep/drop operation's (khN/klN/dhN/dlN) only evaluate the rolled values (N).&nbsp; I don't believe there's a dice handling method to drop the "last dice". ;-(
Why is it called keep and drop then :(. Thanks for the clarification Vince.
1545370479

Edited 1545370535
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
It keeps and drops dice based upon their values, not the order rolled. For instance, 4d6kh3 or 4d6dl1 will "keep" the highest three results and "drop" the lowest result: (5 +&nbsp; 2 &nbsp; + 4 + 6) = 15 Abner said: Why is it called keep and drop then :(.