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

[Script] RollMaster D100 Roll Generator (and it's meta -- it will work in other scripts!)

1655162566

Edited 1655485486
timmaugh
Pro
API Scripter
RollMaster d100 Roll Generator FILE LOCATION:   My Personal Repo  (one-click submission pending as of 17 June 2022) PLUGGER PLUGIN:  In addition to being a stand-alone script, this script will work with  Plugger  as a meta-script to modify  other  scripts' API commands and return the resulting roll to the command line interpreted by other scripts. See  Using With Plugger , below. ABSTRACT:  Generates and returns an inline roll structure following RoleMaster explosion guidelines (otherwise unavailable within Roll20 roll syntax). Allows for the inclusion of any number of modifiers to the roll. You can also set the base die type, and/or the upper and lower explosion thresholds. Finally, it also works with Plugger to allow you to return the resulting roll to the command line of other scripts (or, with ZeroFrame installed as well, to a roll template output). Updated Instructions (BELOW) With the Production Release of this script, certain script behaviors have changed -- mostly around roll mechanics and storing script options in the state. After reading this post, please review the Production Release post for these changes. Introduction RoleMaster is a d100 system with an explosion mechanic not otherwise buildable using standard Roll20 syntax (though I am open to seeing how it can be done, if anyone -- say, RainbowEncoder -- can come up with a way to do it). =D The mechanic is: You roll 1d100, and explode on a 96 or above. However, you can also explode negatively on a 5 or less. On subsequent rolls, the same mechanic applies, so that on a 5 or less you flip again so that you are now positively exploding. As an example, rolling 96 results in rolling again and adding the result. That roll results in 4, so you roll again and subtract. You roll a 97, which explodes, and you roll again. The next roll results in 64, which does not explode. Your final roll output is: 96 + 5 - 97 - 64 = -60 As a part of the final value of the roll (representing a skill attempt, for example), you can add other modifiers (i.e., skill attributes, bonuses, etc.). The script accommodates those modifiers. Command Line Use  !rmd100  to trigger the script. This will produce a simple roll depicting the various explosions that happened along the way. Modifiers as Command Line Arguments Add any modifiers to the roll as arguments to the line prefaced by a double hyphen. Any number of such modifiers can be used. !rmd100 --20 !rmd100 --@{selected|Blacksmith} --@{selected|CraftingSkillGroup} !rmd100 --@{selected|Blacksmith} --@{selected|CraftingSkillGroup} --?{Bonus|0} If the argument represents a number, it will be included in the roll. Include Labels for Modifiers If you want to include a label for the value in the roll, include that label immediately after the double-hyphen, and separate it from the value by a hash ( # ) or a pipe ( | ) character. !rmd100 --Blacksmith|@{selected|Blacksmith} Labels will appear in the resulting roll: Script Output (Whisper, Value Only) Whispering Include a --whisper argument to limit who can see the output of the roll. To whisper to yourself, leave the argument without a value: !rmd100 --whisper If you wish to whisper the result to someone else (for example, the GM), include the target after a delimiter: !rmd100 --whisper|ActualCannibal !rmd100 --whisper|gm Outputting the Roll Value, Only The typical output of the script is an inline roll equation (i.e. '[[90 + 20[Blacksmith] + 10]]'). If you wish, instead, to output the value of the roll only (which can be important when you use the script in combination with Plugger -- see below), you can use the special argument  --value : !rmd100 --Blacksmith|@{selected|Blacksmith} --value The resulting output to chat will not have roll-tip available on-hover, but it will display the correct value. Script Behavior (Base Dice, Explosion Thresholds, Reset, Report) Base Dice & Explosion Thresholds You can control the base die type of the roll, as well as the upper/lower explosion thresholds, using special arguments to the command line. These changes will persist for game sessions (or API sandbox reboots). These are not currently saved to the state (to persist between sandbox restarts), however if that feature is desired, it can be added. While there is no reason that I'm aware of in the RoleMaster system to change these values, the ability to change the script's behavior allows it to potentially adapt to house rules or even to a system with a similar explosion mechanice but different starting values (i.e., d20, lower explosion of 2, upper explosion of 19). These special arguments are as follows: --die --lowx --highx Follow these with an argument delimiter (hash or pipe), followed by a number. For instance, to set the d20/2/19 rule mentioned just above, the command line would be: !rmd100 --die|20 --lowx|2 --highx|19 Report If you want to see what values the script is currently using, you can use a  --report  argument: !rmd100 --report This can be paired with the  --whisper  argument. Reset If you wish to reset the  die ,  lowx , and  highx  settings to their original values, you can use the --reset argument: !rmd100 --reset This can be paired with a  --whisper  argument. Using With Plugger (Return a Value to the Command Line) Plugger is a metascript that dispatches calls to secondary scripts when the Plugger syntax is included in a primary script's command line. If that secondary script registers itself to Plugger to be a 'plug-in', Plugger will actually return a value to the command line before the primary script ever receives the command. In other words: to use the roll produced by RoleMasterD100 in another script, use the Plugger syntax to embed it in the command line. The appropriate syntax for use as a plug-in is to take the original  rmd100  command line but leave off the exclamation mark, and enclose the arguments in parentheses. Then, enclose the whole thing in the  {&eval}  tags from Plugger. !somescript --Skill|Blacksmith --Result|{&eval}rmd100(--Blacksmith|@{selected|Blacksmith}){&/eval} Remember that what is typically returned from RoleMasterD100 is the  equation  of an inline roll, (i.e. [[90 + 20[Blacksmith] + 10]]). This might not work for you as a Plugger plug-in, since inline rolls are processed by Roll20 before the message is given to the set of API scripts. There is no opportunity for Roll20 to process the new inline roll returned by RoleMasterD100  before  it is handed off to the primary script where the Plugger syntax is embedded. In such a case, you should include the  --value  argument to have RoleMasterD100 instead return the result of the roll to the command line. !somescript --Skill|Blacksmith --Result|{&eval}rmd100(--Blacksmith|@{selected|Blacksmith} --value){&/eval} Another way to solve this is to have ZeroFrame (another metascript) installed, as well. ZeroFrame will detect the inline roll equation (the default return from RoleMasterD100), and add it to the message that the secondary script receives. Using ZeroFrame in this way will preserve the roll  as  an inline roll, so you will be able to see the on-hover roll-tip.
1655162644

Edited 1655485512
timmaugh
Pro
API Scripter
Reserved for Versioning Notes v1.0.0 (Production Release) v0.0.1 (Beta release)
1655292190
Oosh
Sheet Author
API Scripter
timmaugh said: RollMaster is a d100 system with an explosion mechanic not otherwise buildable using standard Roll20 syntax (though I am open to seeing how it can be done, if anyone -- say, RainbowEncoder -- can come up with a way to do it). =D I mean.... how are you going to feel when Rainbow strolls past and flicks a one line macro into the thread? Why would invite this on yourself?
1655294475
David M.
Pro
API Scripter
1655295568
timmaugh
Pro
API Scripter
1655295594
timmaugh
Pro
API Scripter
David M. said: LOL... that's awesome.
1655298345
GiGs
Pro
Sheet Author
API Scripter
timmaugh said: You roll 1d100, and explode on a 96 or above. However, you can also explode negatively on a 5 or less. On subsequent rolls, the same mechanic applies, so that on a 5 or less you flip again so that you are now positively exploding. As an example, rolling 96 results in rolling again and adding the result. That roll results in 4, so you roll again and subtract. You roll a 97, which explodes, and you roll again. The next roll results in 64, which does not explode. Your final roll output is: 96 + 5 - 97 - 64 = -60 That's interesting. We never allowed the dice to reverse direction after that first roll, and only now, many years later, do I realise that was probably incorrect.
1655310851
Diana P
Pro
Sheet Author
GiGs said: That's interesting. We never allowed the dice to reverse direction after that first roll, and only now, many years later, do I realise that was probably incorrect. I just double checked and the directions in RMSS at least, the examples do not appear to allow it to reverse direction after the first roll; they just end the roll series there:  Low Open-ended Roll — To obtain a “low open-ended roll” first make a 1-100 roll. A roll of 01-05 indicates a particularly unfortunate occurrence for the roller. The dice are rolled again and the result is subtracted from the first roll. If the second roll is 96-00, then a third roll is made and subtracted, and so on until a non 96-00 roll is made. The total sum of these rolls is the result of the low open-ended roll. Example : The GM asks a player to make a low openended roll, and the initial roll is a 04(i.e., between 01 and 05). A second roll is made with a result of 97 (i. e., between 01 and 05); so a third roll is made, resulting in a 03. Thus, the result of the low open-ended roll that the GM requested is -96 (= 04 - 97 - 03). High Open-ended Roll — To obtain a “high open-ended roll” first make a 1-100 roll. A roll of 96-00 indicates a particularly fortunate occurrence for the roller. The dice are rolled again and the result is added to the first roll. If the second roll is 96-00, then a third roll is made and added, and so on until a non 96-00 roll is made. The total sum of these rolls is the result of the high open-ended roll. Example : The GM asks a player to make a high open-ended roll, and the initial roll is a 99 (i.e., between 96 and 100). A second roll is made with a result of 96; so a third roll is made with a result 04. Thus, the result o f the high open-ended roll that the GM requested is 199 (= 99 + 96 + 04). Is there an easy way to change the behavior so it acts more like this? I do appreciate the ability to change the high and low values since there are ways on a per character basis (generally) to affect that (some talents if used, some items possibly, maybe others). Thank you for this!
1655311362
GiGs
Pro
Sheet Author
API Scripter
Diana, that does look like the way we used to play it was correct. Whew!
1655314905
timmaugh
Pro
API Scripter
Hey, Diana... my book is currently in storage, and I coded this from memory, but I admit that the way we played might have been a "house rule" of sorts, passed down through the generations of players. =D That said, I called a friend with a copy of the rules, and there's a simple "open-ended" roll listed after the 2 types of rolls you mention. It doesn't list any example, but allows that the roll can explode in either direction. I could see either interpretation of this type of roll from the text, honestly, so I see your point. I searched for errata about this type of roll, and so far haven't found anything "official". Still, you're probably right. I'll change the script to allow for single-direction explosion, and I'll add switches to limit the roll type to a high-open-ended or a low-open-ended. Given all of that potential configuration, it would also make sense to preserve the script's settings in the state object so that you don't have to reset it after you reboot your sandbox. Also, you should be able to change the break points or die type for a given roll (versus changing it for the script), so that you can accommodate a character with certain peculiarities without changing the script's overall behavior. I'll get all that added as soon as possible.
1655325878

Edited 1655358189
I'm in the lineage of players that Timmaugh referenced. I agree. I don't remember when we started doing it, and it may have been acknowledged as a house rule at the time. I could easily see it starting out as a way to recover from a fumble. Roll low - oh no. Oh, you rolled low again. Interesting. Let's say you miraculously recovered mid-fumble, now roll again and add! Hey, you rolled high, roll and add! Oh, you rolled low. You thought you were doing something epic. But now, you're just trying to hold onto a success. Roll and subtract. Having checked the rules, I agree with Timmaugh. It makes easily as much sense to see the Open Ended Roll as intending to allow both a Low Open Ended Roll and a High Open Ended Roll, but not to mix them . * * * MADNESS FOLLOWS * * * Also, I tried to think my way around whether the result set would be that different. While I think there might be some small mathematical quirks that might render specific ranges slightly less common than others (i.e., if a 96 followed by a 4 is not a 100, but instead requires another roll, you might not get as many results of 100 over all), it probably doesn't matter that much. You can still go just as far negative and just as far positive. In related note, I wondered if it might not be easier to simply roll an explody roll, always positive, then check to see if it should be turned negative (5% chance). I figured, if everything is mathematically close, that probably is as well, and might be easier to code. (Timmaugh, the example of the -1 still works. You could roll 3, then 4. That would be +3 and -4, so, a -1. It would be represented by rolling a 1, then making it negative in the 5% check.)
1655391932

Edited 1655393112
Paraphrasing from the Rolemaster Standard Rules , section 1.4 Dice Rolling Conventions (p14): 1. 1-100 Roll : this is a regular 1d100 roll i.e. /r 1d100 2. Low Open-Ended Roll :  To obtain a "Low open-ended roll" you first make a 1-100 Roll (option 1, above). A roll of 01-05 indicates this is a "Low Open-Ended Roll". Roll again and subtract the result from the original roll. If the second roll is a 96-100, you roll again and keep rolling until you don't roll a 96-00.  Example : The GM asks the player to make a low open-ended roll. The player rolls a 04, then a 97 then a 03. The final result is 04 -(97 +3) = -96. 3.  High Open-Ended Roll :  To obtain a "High open-ended roll" you first make a  1-100 Roll  (option 1, above). A roll of 96-100 indicates this is a "High Open-Ended Roll". Roll again and add the result to the original roll. If the second roll is a 96-100, you roll again and keep rolling until you don't roll a 96-00.  Example : The GM asks the player to make a high open-ended roll. The player rolls a 99, then a 96 then a 04. The final result is 99 + 96 + 4 = 199. 4.  Open-Ended Roll : An open-ended roll is both "High Open-Ended" and "Low Open-Ended". This means that if the first roll is a 01-05 you now follow the rules for a Low Open-Ended Roll, if it's a 96-100 you follow the rules for a "High Open-Ended" roll and if it's 06-95 it's the result as rolled. NB : You cannot flip-flop between Low Open-Ended and High Open-Ended rules for the roll. Once you are in one or the other, you stay there. Edit : I see Diana already quoted the rules haha! Well, I second her comment - spot on :-)
1655398034
timmaugh
Pro
API Scripter
I appreciate the input, Manny. It seems very likely that my gaming group has been playing a house rule lo-these-many-years! In any case, I've rejiggered the script to default to the mechanic you and Diana describe, but with the option to employ the house rule to allow more than one flip. I'm putting the final touches on it, and should have it released today or tomorrow, I'd think.
1655485254
timmaugh
Pro
API Scripter
Production Release - v1.0.0 June 17, 2022 FIXED : Corrected default roll mechanic to allow only a single direction of explosion in open-ended rolls FIXED : Misspellings ADDED : Command line arguments for limiting a roll to "high open-ended" or "low open-ended", only ADDED : Script configurations now committed to state for preservation between sessions; requires GM privileges ADDED:  Information panels in chat for About, Config, and Help ADDED : Option to allow multiple direction changes of exploding rolls (house rule) Release Notes One-Click Submission The script has been submitted to the one-click repository with this release. It should be available after next week's merge. Roll Mechanics Based on the discussion above, the default mechanic for open-ended rolls (where both high/low explosion is possible) has been changed to only allow an initial setting of direction. That is, after the first roll, rolling a 5 or less will not reverse the direction of explosion. The first roll determines the applicable explosion direction (up/down), and after that only rolls of 96 or more will explode. The script is defaulted to use this rule, though there is the ability to change this configuration at the script level (see Script Configuration / State Commitment , below), or for a given roll (see Roll Options , below). Script Configuration / State Commitment Options for the base die, the high-explosion threshold, the low-explosion threshold, and the option to apply the multiple direction changes rule are now stored in the state, preserving them between sessions. These are defaulted to be: die : 100 highx : 96 lowx : 5 multi : false To set these for the script (affecting all future rolls), use the --set|  argument (or just use the Config panel, see Information Panels , below). The argument can take any/all/multiple of the above properties (along with their values, separated by a hash (#) or pipe (|) character). The list of properties should be separated by spaces, for example:  !rmd100 --set| highx|94 lowx|4 Configurations of the script require the user to be a GM of the game where the change is being made. Non-GMs will not see the options in the information panels, and they will receive a message alerting them to they are attempting a GM-only action if they directly try to alter the script's configuration from the command line. Roll Options Command line arguments for die , highx , and lowx now only affect the roll generated by that command (not the overall script configuration). For instance, to alter the roll to use a high threshold of 98, use the --highx argument: !rmd100 --highx|98 Roll Type Argument A new argument is available to control the kind of roll mechanic to use: low open-ended, high open-ended, open-ended (default), or multi-ended. Use the --open argument to control this behavior. The options are as follows: OPTION | RESULT | DEFAULT =============|===================|============ --open|low | low open-ended | --open|high | high open-ended | --open|both | open-ended | <== --open|none | no explosion | --open|multi | multi-ended | Information Panels The script now has chat outputs that organize important information. The panels also include buttons to easily handle tasks such as setting configuration values, resetting the script to RoleMaster defaults, or navigating between panels. These panels can be reached by entering: !rmd100 --about !rmd100 --config !rmd100 --help The Config panel will display the current configuration options of the script. Non-GM users will see a truncated set of information and options. The panels link, one to the others, via buttons at the bottom of the panel.
Manny, I think your interpretation is certainly justified. I also think the other interpretation is valid. In the end, it doesn't matter, because the range of results really is the same. I just want to get to a roller that produces both open ended high and open ended low results. :)
Thanks for your work timmaugh, much appreciated! I don't suppose anyone has done any work along the lines of automatically resolving a Rolemaster attack? That would include: looking up the combat result in the weapon table then being able to look up the related critical result(s). I did most of this in MERP but it's very involved and Rolemater weapons are roughly 20 times more complex!
1656007082
timmaugh
Pro
API Scripter
I don't know of a script that handles this natively (as the purpose of the script) -- it would probably amount to a breach of ICE intellectual property rights to post a script that replicates the associated tables. ...however... Another one of my metascripts, Muler, can read from "mules" (like Roll20 tables, except that they can be accessed directly -- not just by randomly rolling against them). If you're willing to type up (or OCR) the tables to your own game, the metascript toolbox (including Muler) can help. And since both Muler and the RoleMasterD100 generator scripts are both meta, they can work together.