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

Modifying Critical Hit Script

Now I have no prior knowledge of programming nor am I a smart person in general, but wanting to do something new for my game I tracked down the source code for the "Critical" option in the script library and after fiddling with the code I found out how to change it without breaking. (Took much longer than I am willing to admit, because again I'm not a smart person). Now with what little information and skill I have acquired from fiddling with the code I was wondering is there a way to set it up so it asked what kind of damage the critical is from when you input the !critical command that way you could incorporate different damage types done from spells? I have the skills to just add to the script to include everything on the base command but I don't think it would be pleasant to look at if you type !critical and a giant wall of text shows up. If this is the wrong place to ask I apologize, I just want to get better at this for not only the group but because I think its really cool. If it helps here is the link to the github:&nbsp; <a href="https://github.com/Roll20/roll20-api-scripts/tree/master/Critical" rel="nofollow">https://github.com/Roll20/roll20-api-scripts/tree/master/Critical</a>
1582108524
GiGs
Pro
Sheet Author
API Scripter
To clarify: you want to be able to enter something like !cr slash and it gives you the critical damage roll for a slash damage type? Also what change have you already made to the script? If I were to change the original script, it might not help you much because you've already changed it.
For the command yeah exactly what I was looking for. And the GitHub I linked is the base that was found in the default library. It has no changes since not knowing anything just played around with it seeing what each thing did. After posting I realized I could do something what I wanted with a bunch of rollable tables, but that seems way less elegant. What now but at this point I kinda want to know if it is possible more than trying to do it, but this event has certainly sparked an interest in learning how to code.
1582645771

Edited 1582647200
GiGs
Pro
Sheet Author
API Scripter
Here's a tweaked version that lets you declare the hit type, and uses the default roll template for print out <a href="https://gist.github.com/G-G-G/893deea785cf341d08e64bed41ddddab" rel="nofollow">https://gist.github.com/G-G-G/893deea785cf341d08e64bed41ddddab</a> Any of these are valid: !critical 25 slash !critical slash !critical 25 !critical slash 25 !critical slash [[1d100+25]] Regarding that last one: the script also accounts for the max and min of the critical table, so if your critical rolls above 100, it uses 100. I'd like to tweak it further to allow for more descriptive info (like a user-created title, or the character as opposed to player rolling), but dont have time right now. It does report which play rolled the critical. You can edit the critical tables, and add extra hit types, as long as you keep the "low" "high" and "type" sections as first 3 items in each critical result.