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 .
×
May your rolls be merry + bright! 🎄
Create a free account

Weirdly specific system I absolutely need to be automatic

Okay so, I'm currently working both on a weird system that would NEVER work IRL but could absolutely work fine with a computer. Basically, the idea is that you have a characteristic, let's say dexterity, and a competence, let's say stealth. If the GM asks for a stealth roll, you add the stealth and dexterity number, and that gives you a certain number of points. Let's say 250. What you would do is use a d100, and do it like that : First roll : 250-1d100. Let's say we have 50, so we have 200 points left. That's one success. Second roll, let's say we roll a 100, we have 100 points left. That's a total of two successes. Third roll, we have a 50, we have 50 points left. Three successes. Fourth roll, we roll a 20, we have 30 points left, four successes. Fifth roll, we have a 50, that's more than 30, we stop, four successes. That is EXTREMELY long and painful to do by hand. But, Roll20 gives us all kinds of possibility. Would it be possible to create some kind of macro that would do that automatically for me for any number of points I enter ? I know a few simple programation things, so with the right resources, I could probably do it. Basically, I know how to do it with Python, but I don't know how to do it in any other langage or on roll20. If using some kind of plugin that works with roll20 would help, I can totally install it, as long as it's on firefox, or maybe chrome.
1625935959
GiGs
Pro
Sheet Author
API Scripter
You'd need to use an API Script for this, and since you're a Pro user you can. A custom script could do it, but it sounds like it would be a simple task for the already existing ScriptCards script. I haven't built any ScriptCards macros, but I know it has loop functionality, so I think all you'd need to do is keep looping as long as the Points-[[1d100]] is positive. Check out the ScriptCards thread in the API subforum. Someone there will tell you how to do it.
GiGs said: You'd need to use an API Script for this, and since you're a Pro user you can. A custom script could do it, but it sounds like it would be a simple task for the already existing ScriptCards script. I haven't built any ScriptCards macros, but I know it has loop functionality, so I think all you'd need to do is keep looping as long as the Points-[[1d100]] is positive. Check out the ScriptCards thread in the API subforum. Someone there will tell you how to do it. Thank you for your answer ! I started reading the wiki and the thread a bit, and if I understand correctly, I would need to create my own character sheet in Roll20 if I wanted to use scriptcard, right ?
1625952401

Edited 1625952950
David M.
Pro
API Scripter
Scriptcards itself doesn't require a character sheet, but that is the likely way to go about your system since you need to reference attributes. Check out the character/token attributes section of the wiki for details how to reference these values.  EDIT - or, you can always reference character attributes like you normally would using @{selected|Attr_name} syntax.
1625954943
David M.
Pro
API Scripter
Here's a starting point for your macro. Assumed character attributes called "dex" and "stealth" (hardcoded). You could generalize it with queries for the attributes you wanted to check against. !script {{ --#title|Stealth Check --=maxPoints|@{selected|dex} + @{selected|stealth} --#leftsub|[$maxPoints] points available --=pointsRemaining|[$maxPoints] --=i|0 --:Loop| --=i|[$i] + 1 --=roll|1d100 --=pointsRemaining|[$pointsRemaining] - [$roll] --+Roll [$i]:|[$roll] [i]([$pointsRemaining.Raw] points remain)[/i] --?[$pointsRemaining] -ge 0|>Success --?[$pointsRemaining] -gt 0|Loop --?[$numSuccesses] -gt 0|>OverallSuccess|>OverallFailure --X|End macro --:PROCEDURES| --:Success| --=numSuccesses|[$numSuccesses]+1 --<| --:OverallSuccess| --+Result|[#009900][b]~~~[$numSuccesses.Raw] Successes~~~[/b][/#] --<| --:OverallFailure| --+Result|[#990000][b]~~~Overall Failure~~~[/b][/#] --<| }}
1625957612
GiGs
Pro
Sheet Author
API Scripter
Note that if you didnt want to use attributes or a character sheet at all, you don't need to. You could for example replace this |@{selected|dex} + @{selected|stealth} with |?{Score?|0} And that would give you a prompt to enter a number to enter everytime you run the above macro Or |?{Stat Score?|0}+?{Skill Score?|0} if you want to be prompted for the stat score and skill score each time.