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

Replacing Numbers with Text

Hello all, I am trying to create a macro or possibly api script that changes a number output from a modified role into a text.  I am trying to automate the results tables from the rolemaster game system.  So if a character roles within a certain range of numbers certain text will appear in the chat log. I use macros extensively in my game to automate a lot of the game play and I am familiar with conditional mathematical statements and queries.  I have never written or edited an api script before, although I use a few community-created scripts in my games.  I think the script I need to use for this function is maybe "meta macro" which can make textual substitution macros, but I can't figure out how to make it work. The help page for this script is not very descriptive. Any advice?
1563339149
GiGs
Pro
Sheet Author
API Scripter
I've never used meta macro, but you dont need it.  One way to do this would be to use a Rollable Table. If the rolls are rolled as is, and never subject to modifiers, that would be the way to go. Just create each entry in the table, and give it a weight equal to the range it comes up (a 96-99 would have a weight of 4). Since you're a Pro user, this has the advantage that you can make the table outside of roll20 in, say, excel, and use the Script: ImportTable to get it into roll20. If you ever apply bonuses or penalties to the roll, that wont work, because rollable tables are really that bad. In that case, you need to use an API script. But this isnt that hard. The tricky part would be creating the data. But handling the roll and printing the result would be easy.  But the rollabletable is simpler, as long as you dont need to handle modifiers. Will that work for you?
1563339374
The Aaron
Roll20 Production Team
API Scripter
I'm pretty sure Rolemaster requires adding values.&nbsp; Brian's old Real Rollable Tables script can probably handle it, if it still works:&nbsp; <a href="https://app.roll20.net/forum/post/1408851/slug%7D" rel="nofollow">https://app.roll20.net/forum/post/1408851/slug%7D</a> Otherwise, a custom API script is probably the way to go.
GiGs, thanks for the advice.&nbsp; Yes I need to add a lot of modifiers to the table.&nbsp; I think api is the way to go, I have just never written an api script before and don't know how. Aaron, thanks for the link, I will try it out and see if it still works.
Thanks for the tip Aaron. This seems to be the right script for what I need, but the original thread does not give codes for how to add modifiers to the rollable table. What format should I use to create a macro that adds modifiers to a table?
1563393386
GiGs
Pro
Sheet Author
API Scripter
It looks like it accepts an inline roll, or a math expression. So you can do !rt table-name [[1d100+5]] !rt table-name +5 If you only supply an expression (bonus, penalty, whatever), it assumes a die size equal to the size of the table. A table with a total weight of 100 will get&nbsp; d100, then the modifier will be applied. That's untested, just what I gather from reading the instructions.
1563396258

Edited 1563396267
Amazing!!!! Works perfect! Thanks so much!
1563399041
The Aaron
Roll20 Production Team
API Scripter
Sweet. =D
1563400907

Edited 1563401055
Ok, you guys have been super helpful.&nbsp; Couple more troubleshooting problems. I can't seem to enter the command into a template or use open ended rolls with this api.&nbsp; My current script for one of the skills is as follows.&nbsp; Any idea how to edit it to do either of those two things? I've tried rolling on the table with the template only, without the open ended instructions and with the open ended instructions without the template.&nbsp; Can't seem to figure out the right code.&nbsp; Thanks! &amp;{template:RMSSStdRoll} {{skillflag=true}} {{name=@{character_name}'s Athletic Games (Brawn)-@{athleticgamesbrawn1name}}} {{check=Check: }} {{checkroll=!rt movingmaneuverroutine [[1d100!&gt;96cf&lt;5cs=100+?{Other bonus/penalty?|0} +[[@{athleticgamesbrawn1}]] ]]}} {{oedownroll= -[[1d100!&gt;96[open ended down roll; subtract from previous roll] ]]}} {{critroll= **Check for Nat 100!!!!**}} {{highlight66= [[66 +?{Other bonus/penalty?|0} +[[@{athleticgamesbrawn1}]] ]]}} {{highlight66roll=**Natural 66.** }} Note: just having this script inside a macro seems to work just fine, without any open ended rolls or template, but it isn't that pretty and it doesn't roll crits or fumbles. !rt movingmaneuverroutine [[1d100+?{Other bonus/penalty?|0} +[[@{athleticgamesbrawn1}]] ]] Also, fixing the inability to roll fumbles and crits is more important to me than the template.&nbsp;