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
This post has been closed. You can still view previous posts, but you can't post any new replies.

Randomly generated text using Rolling Tables and Macros on free accounts.

1469140288

Edited 1469141652
Did you know you can use rolling-tables to create randomly generated text? Yes you can! Here's a short tutorial on how. Inside the macro we can run the Rolling Tables inline, producing the name of the randomly selected row in our macro's output to the chat by using this format [[1t[table-name]]] . After some searching before doing this I realised there was no documentation for what I wanted. I've since updated the Documentation to include this fun little tidbit <a href="https://wiki.roll20.net/Card_Decks_and_Rollable_Tables" rel="nofollow">https://wiki.roll20.net/Card_Decks_and_Rollable_Tables</a> . If you want to create random flavour text for your NPC's, or randomly generate quests, then this might be the solution for you too. I wanted to do something like tracery by Galaxy Kate , a javascript library for text expansion. In Roll20, on a free account you sadly do not have access to javascript scripting awesomeness. A challenge presents itself! I wanted to see if my programming skills could wrangle something useful out of the tools and hand to get the functionality I wanted. Turns out it's pretty darn easy and you can do it without programming skills! Using the Rolling Tables to store words like nouns, verbs, adverbs etc. and Macros to glue words into sentence you can generate random text, and even give weighting to certain words if you like using the Rolling Tables weighting. To try it yourself you can follow these steps then modify for your own needs. Tutorial Get some ingredients together... Create a new rolling table called animals . Enter a few rows with animal names: elephant, walrus, bat, snake, platypus, ostrich etc. Save your table. Create a new table called colours . Add a few rows of colour names to it: blue, green, purple etc.&nbsp; Now create another table called verbs , Add in a few rows like: bite, walk, sleep, drink, eat etc. Let's create yet another table, this time call the table places , Giving it a few rows like pond, river, clearing, inn, camp, lodge, bog etc.&nbsp; And finally in our table creation binge, we'll make a new table called feeling , giving it rows like angry, sad, confused, disatisfied, happy, ecstatic, etc. Ok, now that we've lots of stuff to work with, we shall move on to the macro part to glue together some randomly generating text! Write a recipe... Make a new macro and calll it whatever you want. I'm going to call it sentence1 . Write your sentence and call the rolling table for your random words using [[1t[table-name]]] . Here's an example for our new macro, #sentence1 The [[1t[colour]]] [[1t[animal]]] likes to [[1t[verb]]] at the [[1t[place]]] when [[t1[feeling]]].&nbsp; Bake it! Run your sentence macro! So when we run our tutorial macro by typing&nbsp; #sentence1 (or whatever you named your macro) in chat - or clicking it in the macro bar - it will output something like: The green walrus likes to sleep at the camp when sad . or The red elephant likes to eat at the inn when happy . Enjoy your delicious randomly generated word cakes! There you have it. If you make a few such sentences, then you can create randomly generated stories by linking them together. This way you can help bring more life to the npcs within the roll20 system. Currently the above tutorial's output still clearly shows that the Rolling Table words or roll results. If you have suggestions on how to make them appear as normal chat text let us know! I hope you've found this little tutorial helpful. Happy gaming! // Darren K
1469150917

Edited 1469150934
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Unfortunately, there isn't any way to make them appear normal as that is the formatting for inline rolls.
1469151625
Lithl
Pro
Sheet Author
API Scripter
Slab said: Currently the above tutorial's output still clearly shows that the Rolling Table words or roll results. If you have suggestions on how to make them appear as normal chat text let us know! Roll templates can customize the appearance of inline rolls with CSS. However, the default template available to all character sheets does not do anything to their appearance, so the only way to achieve that is to use a roll template from a character sheet that already does such a thing, or create your own character sheet. The only way to use a custom character sheet (and thereby use custom roll templates) is if the campaign creator has a Pro subscription. However, anyone can potentially submit sheets to the community character sheet repository, and those sheets will be selectable by anyone once they are incorporated into the repo.
1469185862

Edited 1469384078
Thanks Scott C & Brian! I must have a look at those community character sheets ;)