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

If/Then Triggers on Tables

I'd love to be able to make it so that if a Rollable Table got a certain result it triggered a Macro (specifically another set of rollable table). Is this possible?
Unfortunately not with access to the API, a pro level perk.
1488898796

Edited 1488898829
If I were to get pro, how would I go about it? EDIT: Chaining the tables, I mean.
1488899102
The Aaron
Pro
API Scripter
If what you want to do is build something like a Treasure Roll system, where each row in one table corresponds to several rolls in another table, etc., you can use Recursive Tables: &nbsp; <a href="https://app.roll20.net/forum/post/2845333/script-r" rel="nofollow">https://app.roll20.net/forum/post/2845333/script-r</a>...
You would need to make a script that would roll on the first table, check the result, then roll on the second table if the requirements are met.
Essentially I'm building an atmosphere generator for me to spitball off, and I want to make it so, if, for example, a certain result is an Advertisement, it then rolls the Advertisement table.
1488900803

Edited 1488901418
The Aaron
Pro
API Scripter
You can do that with Rollable Recursive Tables quite easily.
I'll have to disagree with you there, I &nbsp;can't do it quite easily ;) I can't see the way to do it in the Rollable Tables section of the wiki.
1488901405
The Aaron
Pro
API Scripter
Sorry.. I mistyped.. I meant to say with Recursive Tables. &nbsp;The API script I linked..&nbsp;
Bearing in mind that my coding experience is basically just knowing coding logic, am I just being dense? Do I need to edit the API to add in the tables somehow? Or is it just commands I'm missing in the client?
1488904402
The Aaron
Pro
API Scripter
It operates off of regular Rollable Tables. &nbsp;However, whenever the Result contains an Inline Roll, it replaces it with the result of the roll recursively until there aren't any more, or it hit's the maximum depth. So, if you had something like atmosphere : Inner City: [[ 2t[inner-city-atmosphere] ]] Suburbia: [[ 1t[suburbia-atmosphere] ]] and inner-city-atmosphere : Trash fills every space the wind doesn't carry it in the air. [[3d12]] large rats scurry out from under foot. A car burns on the side of the road. and suburbia-atmosphere : [[2d3]] dogs roam in a small pack. A small child is crying nearby There is an over abundance of ravens, at least [[23d3]] on the roofs alone. You could do: !rt [[ 1t[atmosphere] ]] and get: Inner City: 13 large rats scurry out from under foot., A car burns on the side of the road. Inner City: Trash fills every space the wind doesn't carry it in the air., 21 large rats scurry out from under foot. Suburbia: There is an over abundance of ravens, at least 43 on the roofs alone. Suburbia: 3 dogs roam in a small pack. The easiest way is to also use TableExport (which also imports tables). &nbsp;Look at the&nbsp; Dwarf Surname example.
Thank you so much! I really appreciate it. I have one more question. Is it possible to make it so that these are "silent" i.e. the players do not see the results?
1488924880
The Aaron
Pro
API Scripter
Yup! !rt /w gm [[ 1t[atmosphere] ]]