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

Need a macro that makes an enemy token to say a random phrase.

Hi everyone, So I'm working on an RP macro that would allow a DM-controlled enemy token to have a token action assigned to it, that when clicked, would execute one of a number of /as commands. Example in Play: One of my players, targets an enemy of mine with an attack and misses. I press the "PlayerMiss" token action I've created. And it draws from one of the many witty replies, my enemy would retort back to my player. /as "@{selected | token_name}" C’mon, @{target | race}, you really think you can take us? /as "@{selected | token_name}" You’ll have to do better than that, @{target|race} weakling! /as "@{selected | token_name}" Did your mother teach you how to fight, @{target|race}, or are you just flirting with me? This macro works fine, one button at a time. Is there a way, I can have a macro that picks one of these /as commands, randomly? Thank you, Jake
I know in the above commands that I, the DM, would be promoted to select the target (in this case, the player's token) in order for this to work. I'm fine with that. I just want the ability macro to pick one of them randomly. Thanks, Jake
1437424368
Silvyre
Forum Champion
You could create a rollable table with any number of such phrases added as items. If you named the table 'Retort', your macro would look something like: /as "@{selected|token_name}" [[ 1t[Retort] ]]
I love that idea. I'll give it a shot. Thanks, Silvyre.
Hmmm.... sadly this will not work. I can't figure out how to incorporate the @{target|race} command into the table. There's only a place for images. Not any text or code. And when you type it into the name field, it just prints out all the code. It doesn't actually execute it. Oh well... back to the drawing board.
Plus, the formatting is all messed up. "rolling" "1t[Retort]", all that, doesn't need to be in there. I was hoping to get it to display just as if I had typed an "/as" command.
1437425599

Edited 1437425629
Do it like this or this: ^^ You need to add your inline brackets to do that Jakob. /as "@{selected|token_name}" [[1t[Retort1]]] @{target|race}! /as "@{selected|token_name}" @{target|race}, [[1t[Retort2]]]!
1437425743

Edited 1437425796
You guys are awesome! Thank you so much! EDIT: It is now working! [bows thankfully]
1437425914
Silvyre
Forum Champion
Thanks, Benson. Enjoy, Jakob—that's a very nice neat little macro to have. Let us know how it goes!
No problem. ^^
1437426135

Edited 1437426231
This is a good start. What do I do about the formatting issues? The table text is yellow, bold and has horrible leading. If there is a descender in the text, often times with "g" and "p", the second line cuts it off. The "@{target|race}" command is normal. How do I go about getting the table to output text like the regular console text?
API scripting or built into the character sheet, like I tried. Built into the character sheet removes it from ALL rolls. PowerCard script might be a solution.
1437430481
Gen Kitty
Forum Champion
Note: API scripting requires a Pro (formerly called Mentor) level subscription . For giggles, try this and tell us what you get: /emas "@{selected|token_name}" [[1t[Retort1]]] @{target|race}! /emas "@{selected|token_name}" @{target|race}, [[1t[Retort2]]]! I don't frequently used /emas, but you /may/ like the results better....
This is what we get...
1437432399
Gen Kitty
Forum Champion
Hm. This would give a slightly more natural look to it, but you'll still have the yellow background. You could use another table for the 'growls/yowls' bit :) Edit the punctuation and such so that it matches what your rolltable outputs. /emas "@{selected|token_name}" growls, "[[1t[Retort1]]] @{target|race}!" /emas "@{selected|token_name}" yowls, "@{target|race}, [[1t[Retort2]]]!" This may be the best that can be done without API.
Yeah, that sounds like it. And code make me depressed. So, this will have to do. Thanks a lot everyone for all your assistance and technical know how.
If we get a foregound map layer, rollable table text color flag will be my next battle cry for the suggestions.
1437436688
Silvyre
Forum Champion
One way to go might be using a table for each of your player's races while taking advantage of the fact that rollable tables allow HTML formatting. For example,