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

Implementing an Incremental "Catastrophe" Check

1771216254
Parka
Pro
Sheet Author
So I'm trying to figure out how to do a fairly specific thing. The character (a 5e custom Mad Doctor class) has an ability which modifies their spellcasting.  Whenever they cast a non-cantrip spell, they have to make a d100 check, adding a modifier, and if the result is under 100 their spell works and the level of the spell is added to the modifier going forward. If the result is 100 or more, the spell fails, something weird happens, and the modifier resets to 0. The idea is that they'll fail *eventually* but they should get some mileage in the meantime. There's not going to be a table of results to pull from, it's going to be improvised by the GM every time, so no table to worry about. I'm wanting to make a button (either a Macro or an Ability) which will let them choose the level of the spell they're casting as a drop-down, then take the value of the modifier off of their sheet, add their drop-down selection value to it, roll, give them the result of "Success!" (if they pass) or "Catastrophe!" (if they fail), and save/set the modifier to their sheet appropriately. I'm not sure if Macros/Abilities can accomplish this alone or if I need to make a Mod, and either way I'm not sure what it would fully look like. I'm not able to see how to get close right now. I want to make the result as simple and obvious for the player as possible. I have this Ability attached to their sheet at the moment: " If you roll 0, you're safe. Any other number is a Catastrophe. /roll {[[1d100+@{other_resource}+?{Level of spell|Level 1, 1|Level 2, 2|Level 3, 3|Level 4, 4|Level 5, 5|Level 6, 6|Level 7, 7|Level 8, 8|Level 9, 9}-99]] , 0}kh1  " But I'm really wanting to make the result a binary pass/fail "plain English" feedback to them, rather than having to parse a numerical result. Handling the modifier automatically from their drop-down feedback would be a huge bonus too, but if that's too much I can manually track that. I'm using "other_resource" from their sheet (5e's 2014 by Roll20) for visibility right now so they can see what their modifier is and decide what they want to risk using, but given the player's inclinations, that visibility may not be an important factor to keep.
Pretty quick and dirty, but here's an approach: Create two Rollable Tables, each with a single item: 0Catastrophe spell is successful! 1Catastrophe spell fails! Then add this as an Ability to the character: /em Casts a spell and the [[ 1t[[[{0, [[ [[1d100]]+@{other_resource}+?{Level of spell|Level 1, 1|Level 2, 2|Level 3, 3|Level 4, 4|Level 5, 5|Level 6, 6|Level 7, 7|Level 8, 8|Level 9, 9}]]}>101]]Catastrophe] ]] ($[[1]]) !modattr --silent --charid @{character_id} --other_resource|?{Level of spell} That will display an /em message with a success or failure message that also displays the final roll result, and will also add the spell level to the 'other_resource' attribute. You can also hover over the roll result to see the roll and modifiers.  There are other approaches that you could take, such as with either Scriptcards or Metascripts, to add conditional logic (only show a message on a success, automatically change the 'other_resource' attribute back to 0 on a failure, etc.). 
1771226420

Edited 1771226851
Parka
Pro
Sheet Author
Awesome. It's not incrementing the "other_resource", but I wonder if it's because I'm the DM and not the player whose sheet it is. We can fiddle with that manually if it doesn't work... the main goal is achieved for now. Thank you for the help!
Sorry I should have mentioned that the !modattr command requires the ChatSetAttr Mod script to be loaded into the game. If you do have ChatSetAttr loaded, try the command without the --silent argument and see if you get any output:  !modattr --charid @{selected|character_id} --other_resource|?{Level of spell}