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

Macro for rolling down from 20?? Wild Magic

I have my own wild magic surge table as well as my method. I devised the idea that a surge will happen regardless its just a matter of when.  My sorcerer rolls a d20 every attack, and the target to trigger is 20.  If I didn't roll the a 20, the next target is 19 and so on until the dice roll hits that target and then it resets back to 20. Is there such a macro that when you select it, it rolls a d20 and does that countdown? Thank you
Since you want the number to be remembered from one roll to the next it is probably something that needs to be done with an API rather than a macro.
1610068557

Edited 1610068601
David M.
Pro
API Scripter
The easiest way I can think of without Pro subscription api access is to use a repeating resource on the character sheet called, say, SurgeMod. When you roll your surge, you would subtract the surge mod each time. You can easily increment the SurgeMod from the main character sheet as needed. Here's an example with the default template: &{template:default} {{name=Wild Surge}} {{Surge Value=[[1d20-@{selected|repeating_resource_$0_resource_right}[SurgeMod]]]}} Note you may have to play around with the resource number (e.g. $0, $1, etc) to find the right one on the sheet. The one I used was located here: Simple output:
David, I took your idea and modified it to be in-line with the 5E sheet templates. Instead of starting from 1 and going up, I start from 20 and go down, and the number in the box is then carried over into the roll as the Critical Success target. Of course you can do it the opposite as a critical failure starting with 1, depending on how you want it. &{template:simple} {{rname=Wild Magic Surge}} {{r1=[[d20cs>[[@{character|repeating_resource_$0_resource_left}]]]]}} {{normal=1}} {{charname=charname}}
So lets say that the first attack of the day, the surge will happen on a d20 roll of 20. She rolls a 2, and so there is no surge.  The magic number of 20 reduces to 19 now. She rolls a 13, and so there is no surge.  The magic number reduces to 18 and so on until her roll is equal to or greater to the magic number. She rolls a 17 and that is the magic number.  A surge happens and the whole thing resets. Is this possible?
1610079226
David M.
Pro
API Scripter
I like that, Dakota! Darren, I think we understood what you were trying to accomplish. The issue is that without api access (requires Pro subscription), this is not possible to automate. We were trying to get you as close as possible by having a macro that references a number on the 5e sheet that is easily manually updated to increment/decrement the surge modifier (or in Dakota's example, alters the target number and references it directly). Thinking about it some more, if you happen to have a spare token bar that you aren't using, you could use that instead of the repeating attribute. You would be able to modify it without opening the character sheet. I would recommend this if you have a token bar to spare. Let's say you have bar3 available on your character's token. Using Dakota's method: enter the target number in bar3 (starts at 20). Run the macro. The wild surge is triggered if the resulting number is highlighted green.  &{template:simple} {{rname=Wild Magic Surge}} {{r1=[[d20cs>[[@{selected|bar3}]]]]}} {{normal=1}} {{charname=charname}} If the surge is not triggered, just select bar3, type "-1", and press Enter key. This will decrement the target number in bar3 for the next time you run the macro. With api access you could make a custom script, use the ChatSetAttr script to automatically update a custom attribute, or use Token-mod to update a bar value, but with a Plus sub, it's going to have to be manual.
Darren, Another approach you can use — depending on how you play your game — is to use the Turn Tracker. If you create a character for your Wild Surge, you can do the same thing as a spell countdown by dropping the token and assign it an initial value of "20" in the tracker: /talktomyself @{selected|token_name}[[20&{tracker}]] /talktomyself I bracket mine with /talktomyself before and after so it doesn't spam the chat window, but you only really need the middle line. The value will remain in the Turn Tracker until you remove it. Have a token action to start it with the above macro, and another to decrement: /talktomyself [[1 &{tracker:-}]] /talktomyself If you do it as a character and ensure you make it the default token, it will retain the count across pages. Just an idea, M
David, that works amazing.  If the group buys into Pro, then we might get into a lot of other things. Thank you so much for your help, this is pretty neat. Now I need to trigger it to select a random wild magic surge in a table!