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

How to use a macro to output a randomly selected String.

November 02 (6 years ago)

I've been messing with ththe macros and I can use conditional (and a dice roll) to output a random number. From there I wanted to make it output a random string from a selection of different strings. the strings are different flavour texts such as "bastion uppercuts the enemy" etc...

I tried adding some strings in the attributes section of the character sheet, but again found no way to call one of them randomly.


Any ideas?

Make a Rollable Table containing the desired strings (note: The first character cannot be a numeral).

Then a macro like this will work:

/em attacks and hits with a [[1t[RollableTableName]]]!

November 02 (6 years ago)

Ah i'm aware of the table. Is there a way to do it without using a reliable table though? Any tricks etc

November 02 (6 years ago)

Edited November 02 (6 years ago)

An Apiscript could do it.

Why don't you want to use rollable tables? From what you said they do exactly what you want.

November 02 (6 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter


Danii said:

An Apiscript could do it.

Why don't you want to use rollable tables? From what you said they do exactly what you want.


If Lucky A. is not the GM, they cannot create their own tables. I can't think of anyway outside of tables or a script, either, though.

November 03 (6 years ago)

Yeah i'm not the gm. Besides everyone would have acess anything I'd make on a reliable table. If I have no choice i'll have to use it. Thanks for the replies!

November 03 (6 years ago)

Oh I see. I assumed you were gm. Well in that case...

Is it a bad thing if everyone has access to your content? Why?

If you're not the gm you could ask your gm to implement the tables for you or you could ask to get gm status just for the implementation. If he doesn't trust you (or you don't trust yourself) to not spoil the preparation, and if he is a promember, he could make an extra game, give you gm status there, you make the tables and he transmogrifies them to the actual game. 

November 03 (6 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

Good solutions, Danii!

November 04 (6 years ago)

Not necessarily the worst case scenario if everyone has access. I see hmm.. okay I guess ol go for one of those work around! Thanks so much guys (and Danii)!!

November 04 (6 years ago)

The final thing you could do, is make a query, wherein you enter a number, and it outputs your string for that number, then have your macro roll a number that is whispered to you, then calls that query, and you select the rolled number.

November 04 (6 years ago)

Aranador, I think that works  best. I've set up one macro to whisper me a random number and my other macro where it queries me a lost of numbers to choose from and get a string. Thanks ^,^