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 .
×

Specific output from a macro?

Hello all, First off, I'm a player, not a DM, so everything I'm doing is in my characters Att & Abl tab.  I'm attempting to create a macro that will output from a selection after rolling, in this case the Wildbarian Rage Surge. I would like it to only show the specific result after the roll. I've gone through some tutorials, but I'm stumped on how to accomplish this without tables. Here's what I've drummed up so far: &{template:atk}{{rname=Rage Wild Surge}}{{r1=[[d8]]}}{{charname=Barsoon}}{{normal=1}}{{desc=Magical Effect 1 Shadowy tendrils lash around you. Each creature of your choice that you can see within 30 feet of you must succeed on a Constitution saving throw or take 1d12 necrotic damage. You also gain 1d12 temporary hit points. 2 You teleport up to 30 feet to an unoccupied space you can see. Until your rage ends, you can use this effect again on each of your turns as a bonus action. 3 ...etc... }} Which predictably outputs this just fine: What is the next step? I can't find any help that doesn't reference 'Tables' that need DM privileges.
Short answer: you won't be able to do this directly without a rollable table or a Mod script. (Because of the Roll20  Order of Operations .) But you could create a 2-step operation, and add a link into the surge result that could be clicked to output a specific surge result into chat. This takes a lot of up front work.  You would need to create a separate Ability for each surge result, and then create a link with an embedded query to output the Ability in the initial surge result (this is all air-coded and untested):  Surge1 &{template:desc} {{desc= Shadowy tendrils lash around you. Each creature of your choice that you can see within 30 feet of you must succeed on a Constitution saving throw or take 1d12 necrotic damage. You also gain 1d12 temporary hit points.}} Surge2 &{template:desc} {{desc= You teleport up to 30 feet to an unoccupied space you can see. Until your rage ends, you can use this effect again on each of your turns as a bonus action. }} And the embedded link would look like this: ?{Surge result?|1,%{CHARACTERNAME|Surge1}|2, %{CHARACTERNAME|Surge2}|...} Then the last step would be going into each of the Surge# results and swapping out any needed html entities  (right braces, commas, and vertical pipes) because the Surge Results are nested inside the Surge Result query: Surge1 &{template:desc} {{desc=Shadowy tendrils lash around you. Each creature of your choice that you can see within 30 feet of you must succeed on a Constitution saving throw or take 1d12 necrotic damage. You also gain 1d12 temporary hit points.}}
1673620215

Edited 1673620526
GiGs
Pro
Sheet Author
API Scripter
I didn't realise rollable tables needed GM privileges (I'm always the GM). I think the only way (without Pro subscriber scripting) to show one entry from a table is to create it as a rollable table, and then roll the table. That table can't include modifiers though. Edir: See also Jarren's response :) Jarren, with that approach could you have Surge 1 just be Shadowy tendrils lash around you. Each creature of your choice that you can see within 30 feet of you must succeed on a Constitution saving throw or take 1d12 necrotic damage. You also gain 1d12 temporary hit points. and have &{template:desc} {{desc= ?{Surge result?|1,%{CHARACTERNAME|Surge1}|2, %{CHARACTERNAME|Surge2}|...} }} be in the source to avoid html entities?
1673620649

Edited 1673620763
timmaugh
Roll20 Production Team
API Scripter
Do you want to select the Magical Effect, or have it rolled for you? If you want to select it, you have 3 options: Script Chat Menu Nested Query If you want to have it rolled for you, you have 2 options: Scripts Rollable Tables Regarding scripts, if scripts are available in your game (the game was created by a Pro user) and you can get a GM to install the right scripts, you can do this without requiring GM privileges. Tell us how you want to approach this and we can get you an example of any of the options. EDIT: Double ninja'd. But with good information, so I'll let it slide. This time. =D
1673621549
timmaugh
Roll20 Production Team
API Scripter
Metascript Solution using  Muler and ZeroFrame. Create a single ability on your character with the Wild Surge text arranged like this: 1= Shadowy tendrils lash around you. Each creature of your choice that you can see within 30 feet of you must succeed on a Constitution saving throw or take 1d12 necrotic damage. You also gain 1d12 temporary hit points. 2= You teleport up to 30 feet to an unoccupied space you can see. Until your rage ends, you can use this effect again on each of your turns as a bonus action. 3=...etc... For the purposes of this example, I'm assuming 1) the ability (or "mule") is on the character named Barsoon, 2) the ability with the above text is called WildSurgeText , and 3) that there are 8 entries in that mule. (I don't play DnD/Pathfinder, so I'm assuming your 1d8 would be the driving force for the Magical Effect.) With Muler 2.0 and ZeroFrame , you'd just need one other ability for this (your original ability, just slightly rewritten). It would be: !&{template:atk}{{rname=Rage Wild Surge}}{{r1=[[d8]]}}{{charname=Barsoon}}{{normal=1}}{{desc=Magical Effect get.Barsoon.WildSurgeText.$[[0]].value/get }}{&simple}
thanks for your help all! unfortunately a sub is not an option for me and, as I'm not DM, Tables aren't available either. I appreciate it anyway!
GiGs said: Jarren, with that approach could you have Surge 1 just be Shadowy tendrils lash around you. Each creature of your choice that you can see within 30 feet of you must succeed on a Constitution saving throw or take 1d12 necrotic damage. You also gain 1d12 temporary hit points. and have &{template:desc} {{desc= ?{Surge result?|1,%{CHARACTERNAME|Surge1}|2, %{CHARACTERNAME|Surge2}|...} }} be in the source to avoid html entities? Ah yeah, good call, GiGs! So, necronomicronic, if you still want to do this, I'll post another message with a detailed breakdown.  Should be pretty easy to cut-and-paste most of it and just swap out your character name.
1673625831

Edited 1673626917
(Assuming the character name is 'Barsoon' as depicted in your image above): Create the 'Rage Wild Surge' Trait on Barsoon with this: The magical energy roiling inside you sometimes erupts from you. When you enter your rage, roll on the Wild Magic table to determine the magical effect produced. If the effect requires a saving throw, the DC equals 8 + your proficiency bonus + your Constitution modifier. [Surge Roll](~Barsoon|SurgeResult) = [[1d8]] Edit: I missed that you were using a custom Ability to make the initial Rage Wild Surge Roll.  Replace it with this: Surge &{template:atk}{{rname=[Surge Roll](~Barsoon|SurgeResult" style="background-color: transparent; color: blue; text-decoration: none;)}}{{r1=[[d8]]}}{{charname=Barsoon}}{{normal=1}}  Create 9 more Abilities on Barsoon: SurgeResult &{template:desc} {{desc=?{Surge result?|1,%{Barsoon|Surge1}|2,%{Barsoon|Surge2}|3,%{Barsoon|Surge3}|4,%{Barsoon|Surge4}|5,%{Barsoon|Surge5}|6,%{Barsoon|Surge6}|7,%{Barsoon|Surge7}|8,%{Barsoon|Surge8}}}} Surge1 Shadowy tendrils lash around you. Each creature of your choice that you can see within 30 feet of you must succeed on a Constitution saving throw or take 1d12 necrotic damage. You also gain 1d12 temporary hit points. Surge2 You teleport up to 30 feet to an unoccupied space you can see. Until your rage ends, you can use this effect again on each of your turns as a bonus action. Surge3 An intangible spirit, which looks like a flumph or a pixie (your choice), appears within 5 feet of one creature of your choice that you can see within 30 feet of you. At the end of the current turn, the spirit explodes, and each creature within 5 feet of it must succeed on a Dexterity saving throw or take 1d6 force damage. Until your rage ends, you can use this effect again, summoning another spirit, on each of your turns as a bonus action. Surge4 Magic infuses one weapon of your choice that you are holding. Until your rage ends, the weapon’s damage type changes to force, and it gains the light and thrown properties, with a normal range of 20 feet and a long range of 60 feet. If the weapon leaves your hand, the weapon reappears in your hand at the end of the current turn. Surge5 Whenever a creature hits you with an attack roll before your rage ends, that creature takes 1d6 force damage, as magic lashes out in retribution. Surge6 Until your rage ends, you are surrounded by multi­colored, protective lights; you gain a +1 bonus to AC, and while within 10 feet of you, your allies gain the same bonus. Surge7 Flowers and vines temporarily grow around you; until your rage ends, the ground within 15 feet of you is difficult terrain for your enemies. Surge8 A bolt of light shoots from your chest. Another creature of your choice that you can see within 30 feet of you must succeed on a Constitution saving throw or take 1d6 radiant damage and be blinded until the start of your next turn. Until your rage ends, you can use this effect again on each of your turns as a bonus action. If you don't like the appearance of the button that shows up with the Rage Wild Surge output, you can format it with HTML Style Injection : The magical energy roiling inside you sometimes erupts from you. When you enter your rage, roll on the Wild Magic table to determine the magical effect produced. If the effect requires a saving throw, the DC equals 8 + your proficiency bonus + your Constitution modifier. [Surge Roll](~Barsoon|SurgeResult" style="background-color: transparent; color: blue; text-decoration: none;) = [[1d8]] And here's what the output will look like. (Edited to add , replacements in each of the Surge# Abilities.) The blue 'Surge Roll' text is a button that will output the result with a query (you'd have to select #5 from the query dropdown):
This is a perfect work-around, thankyou! Is there any way to tie it to a main screen ability in my "Attacks" or tie it to my "Rage" resource counter? Or is am I relegated to using the macro bar?
Ended up combining your two options for Surge Roll, Jarren. Final Result Some weird formatting in the result, but it I not a 'rogue' carriage return, so... no biggie, though! Thanks for your help, and any future help on my other follow-ups!
Ooops, found an error in the output of the "8" or max value. Suggestions?
I have apparently forgotten how to post images... here are the relevant images for my previous replies... sorry
necronomicronic said: Ooops, found an error in the output of the "8" or max value. Suggestions? Ah, that is due to rolling a 'crit' and there is a different field for crit values to be displayed. You can prevent that from happening by changing to a 'critical success' on a roll of 9 or higher (which is thus impossible, so you can ignore the crit result field): &{template:atk}{{rname=[Surge Roll](~Barsoon|SurgeResult" style="background-color: transparent; color: blue; text-decoration: none;)}}{{r1=[[1d8cs>9]]}}{{charname=Barsoon}}{{normal=1}}  If you did for some reason want a rolled 8 to do anything different, you would put a different macro in the 'rnamec' field: &{template:atk}{{rname=[Surge Roll](~Barsoon|SurgeResult" style="background-color: transparent; color: blue; text-decoration: none;)}}{{r1=[[1d8]]}}{{charname=Barsoon}}{{normal=1}}  {{rnamec=[Surge Crit](~Barsoon|SurgeResult" style="background-color: transparent; color: green; text-decoration: none;)}} This doesn't make sense for your use case, but it might be helpful for anyone else who is using this for something similar. 
necronomicronic said: Ended up combining your two options for Surge Roll, Jarren. Some weird formatting in the result, but it I not a 'rogue' carriage return, so... no biggie, though! Ah I use the Stylus extension and didn't realize it was hiding/changing some of the formatting. If you don't want the outline then you'll want to add ' border: none;' to the html styling: Surge &{template:atk} {{rname=[Surge Roll](~Barsoon|SurgeResult" style="background-color: transparent; color: blue; text-decoration: none; border: none;)}} {{r1=[[1d8cs>9]]}} {{charname=Barsoon}} {{normal=1}}  The set of parentheses are from the 'mod' value that is blank.  You could put something in there if you were so inclined by adding the field, but otherwise there's no way within the macro itself to hide them: &{template:atk} {{rname=[Surge Roll](~Barsoon|SurgeResult" style="background-color: transparent; color: blue; text-decoration: none; border: none;)}} {{r1=[[1d8cs>9]]}} {{charname=Barsoon}} {{normal=1}} {{mod=Kapow!}} Or another option would be to put the name in the Mod field: &{template:atk} {{rname=[Surge Roll](~Barsoon|SurgeResult" style="background-color: transparent; color: blue; text-decoration: none; border: none;)}} {{r1=[[1d8cs>9]]}} {{normal=1}} {{mod=Barsoon}}
1674541984

Edited 1674542345
necronomicronic said: This is a perfect work-around, thankyou! Is there any way to tie it to a main screen ability in my "Attacks" or tie it to my "Rage" resource counter? Or is am I relegated to using the macro bar? Unfortunately to tie it to a regular attack won't work (as far as I can tell), because anything in the Attacks & Spellcasting section is going to use the Core Die Roll that is listed on the sheet (which is a 1d20) for the 'attack' roll.  When you create your own faked roll using the Atk template, you are putting in a 1d8 dice roll instead. I would suggest simply checking the 'Show as Token Action' checkbox for the 'Surge' Ability on the Attributes & Abilities page, and then it will show up whenever you have the token selected. You can also rename the 'Surge' Ability to be something shorter, such as using an emoji: ( Anger Emoji Link ) 💢 The only way to tie it to your Rage counter is by using a Mod Script (such as the  5th_Edition_OGL_by_Roll20_Companion ), which requires the game creator to have a Pro subscription.
Thanks again for your help/guidance/patience with this addled fool. Cheers!