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

Cthulhutech Dice API

Hi I want to run a game of Cthulhutech but the dice are weird. it uses d10's and you can use the highest single die, double or stright.
1434565211

Edited 1434565221
The Aaron
Pro
API Scripter
Can you give some examples of how this mechanic works? 1 3 6 9 = uses 9 as the number? 2 2 4 4 8 = uses 8 or uses 4 4 ? 1 2 3 5 5 10 = uses 10 or 5 5 or 1 2 3 ?
1434567159

Edited 1434567271
esampson
Pro
Sheet Author
Those probably aren't great examples, but the answers for them are 9, 8, and 10. 8 and 10 could be either because of the highest number or because of the doubled 4 and doubled 5. It is sort of a 'poker' system. It isn't just doubles but any identical numbers. If we modify your last example to 1 2 3 4 5 6 6 6 10 then the total would be 21 (the sum of 1 through 6). If we were missing one of the 1-5 numbers (e.g. our dice are 1 2 4 5 6 6 6 10) then the total would be 18 because of the 3 6's. If we were also missing one of the 6's (i.e. 1 2 4 5 6 6 10) then our total would be 15 because of the straight of 4 5 6. A straight can be as small as two numbers so if we lose another 6 and the 4 (i.e. 1 2 5 6 10) then our total is 11 because of the 5 and 6. It really doesn't matter which method you use for getting a total. A straight and a single die are equal if they both produce the same total so in the last two examples you gave it would make no difference how you total 8 or 10. The numbers are all that matter. Make sense?
1434568251
The Aaron
Pro
API Scripter
Ah, definitely! How about the number of dice being rolled? Would it be sufficient to have an API script that you ran like this: !cd 7 Which would roll 7 d10s and then output something like: 1 4 5 6 6 6 10 = 18 (but probably with better formatting) Also, would you want to whisper the roll to the GM at any point, or have the roll only shown to the person running the macro and the GM, that sort of thing?
1434569231
esampson
Pro
Sheet Author
Yeah, the number of dice that can be rolled is variable. All the rest (whispering, formatting, etc.) I'll leave up to you and the original poster. :)
1434784215
The Aaron
Pro
API Scripter
CthulhuTechDice v0.1.1 Here it is! I styled it to match their website. =D There are two commands: !ct [[#d10]] -- Takes an inline dice expression and figures out the best result from the rolled dice. !wct [[#d10]] -- The same as !ct , except the result is whispered to the GM. Here are a few examples for !ct [[6d10]] : Here are a few examples for !ct [[3d10]] : Here are a few examples for !wct [[10d10]] : Enjoy! =D Git: <a href="https://github.com/shdwjk/Roll20API/blob/master/Ct" rel="nofollow">https://github.com/shdwjk/Roll20API/blob/master/Ct</a>...
Thank you so much this is great!!!
I'm such a goof I should have mentioned that you add one of your attributes to the rolls total. Aaron What you did is still awesome and i really like the look :D
1434785192

Edited 1434785324
The Aaron
Pro
API Scripter
No worries, I can add an attribute to the result. I'll add a 2nd parameter tomorrow that gets added to the result. It will look like !ct [[6d10]] 7 and I'll also add a place for it in the output. :). Edit: !ct [[6d10]] @{attrname} will also work.
your the best thank you
the only other thing I've found is that it is doing runs of 2 dice, it has to be three dice.
1434807826
The Aaron
Pro
API Scripter
Not a problem, I can fix that as well! =D
1434815402
The Aaron
Pro
API Scripter
Update v0.1.6 -- Runs are only considered for 3 or more: Now Supports a bonus: !ct [[6d10]] 6 !ct [[7d10]] @{attr_that_is_a_number}} !wct [[3d10]] [[@{attr_with_complex_logic_}]] Anything that isn't an integer is ignored. Let me know if there are any other issues! =D GIT: <a href="https://github.com/shdwjk/Roll20API/blob/master/Ct" rel="nofollow">https://github.com/shdwjk/Roll20API/blob/master/Ct</a>...
wow your quick, thank you.
1434839594
The Aaron
Pro
API Scripter
No worries! One more feather in my API cap. =D Alternate dice mechanics are a great use of the API, and also fun smaller scope problems to solve.
I'm glad you like what you do :D
I don't know much about Cthulhu Tech but the script/display looks superb.
1434898413
The Aaron
Pro
API Scripter
Thanks! The formatting took 4 times as long as the mechanics. =D
Yeah my players really like the look of it
Oh is there any way for it to let you know when you botch. It happens when half of the dice you roll come up 1s
1435067588
The Aaron
Pro
API Scripter
I can add that. What other details would you want to know at that point?
i think that's it, just the botch thing
1435122467
The Aaron
Pro
API Scripter
Botch added! See what you think! If half or more dice come up as 1s, it will show Botch. It still shows the dice rolled and what would have been the result, just in case you need it. (but you'll have to figure out for yourself if it was sets/runs/high num). GIT: <a href="https://github.com/shdwjk/Roll20API/blob/master/Ct" rel="nofollow">https://github.com/shdwjk/Roll20API/blob/master/Ct</a>...
Awesome as always lol
1435144444
The Aaron
Pro
API Scripter
=D Glad you like it!
I was just about to start a thread asking for this exact mechanic, and here it is. So, I'm three weeks late, but...awesome work The Aaron. Thanks!
1437404391
The Aaron
Pro
API Scripter
Cool! I always love to hear back when some of these more obscure scripts are getting used. Glad you like it! Let me know if it needs anything added to it. This script was particularly fun to write, as I was trying to match the style of the game as much as possible (and using some more advanced CSS whatnots. =D ). Happy rolling!
Okay, got a couple some of questions: &nbsp; Can I pull just the result and use it some where else, such as a roll template? Can I put the API output into a roll template? Is there a way to add some emote lines after/before the API output? Thanks for you time!&nbsp;
1437892868
The Aaron
Pro
API Scripter
No, there isn't a way to use the output in a roll template, result or otherwise.&nbsp; You on can certainly as emote lines around it in a macro: /em does something !ct [[6d10]] 6 /em did something THe API can output Roll Templates, so what have you got in mind, I might be able to suggest a solution?
Not exactly sure yet. &nbsp;Right now the beautiful script you wrote does the roll, but not who is rolling it (other than the chat box), what they are rolling (which skill, attribute, weapon, etc), and I'm not absolutely positive on how to add that information. If I can line break after/before (or both) I am pretty sure I can put a template above and/or below the API output to cover that requirement. &nbsp;I do know I can style API (cuz, ya know, power cards) but I'm not quite ready to jump into that pool.
1438095979
The Aaron
Pro
API Scripter
Ah, I could certainly include the speaking as in the output or take it as a parameter, could take the skill as well.
I know you are up to your gills with real life and other folks stuff, but you could add a "parameter" (I think) for the character name and the skill or weapon used, it would make me very pleased. &nbsp;To be clear, I want to hit the API button, and the acting character's name and the skill/weapon used appears with the die results. Thank you for the work you've done already.
1440591817
The Aaron
Pro
API Scripter
I will see about doing this over the weekend. &nbsp;Should be a pretty simple change. =D
The Aaron said: I will see about doing this over the weekend. &nbsp;Should be a pretty simple change. =D Just staring, not asking, implying, or making any inquires of any kind. &nbsp;Just staring...
1441051012
The Aaron
Pro
API Scripter
hahahaha, yeah, I get that a lot... &nbsp;not yet. &nbsp;I'll put a bug report in github just to be sure I follow up on it... &nbsp;=D
Yep. &nbsp;Just staring. &nbsp;Staring at that over there...for while. &nbsp;Now looking over here. &nbsp;Maybe a little looking over there...
1441508459
The Aaron
Pro
API Scripter
Updated 1.8 -- Added optional labels/text. &nbsp;You can append as many arguments of the form --&lt;RED&gt;|&lt;WHITE&gt; as you like and have the prepended to the roll: !ct [[8d10]] 6 --Name|Bob the Hero --Weapon|Plasma Rifle You can omit either side as well, if you'd like to choose a line or red or white: !ct [[8d10]] 6 --|Bob the Hero --Plasma Rifle Inline Rolls are expanded: !ct [[8d10]] 6 --Additional Help|[[1d6]] Drones Let me know how it goes! <a href="https://github.com/shdwjk/Roll20API/blob/master/CthulhuTechDice/CthulhuTechDice.js" rel="nofollow">https://github.com/shdwjk/Roll20API/blob/master/CthulhuTechDice/CthulhuTechDice.js</a>
I was showing off a character sheet I made, and then showed them the cool dice script. &nbsp;They said that was neat, and asked "How do you do API scripts?" I answered "I go to the API forums and hope like mad that The Aaron is bored..." Thank you for your work.
1441658705
The Aaron
Pro
API Scripter
Hahaha. You're welcome! &nbsp;Hope it works works you.&nbsp;
1441659292

Edited 1441659319
vÍnce
Pro
Sheet Author
He's on a roll the last 24hr. Aaron's "Moby Dick", Char-mod still eludes capture.
1441660931
The Aaron
Pro
API Scripter
Man, you're hitting that one pretty hard! &nbsp;:). It's next on my list, I swear!
Just to be sure, when you said "anything not an integer is ignored", I cannot use (floor(@{x}/2))d10 in the script, correct?
1442891883
The Aaron
Pro
API Scripter
You're talking about for the bonus? &nbsp;You should be able to use an inline roll there, you'd just need to put the [[ ]] around it. If that doesn't work, let me know and I'll fix it. :)
I meant the place where you put the dice. &nbsp;Using this example, I mean the 8d10. &nbsp; !ct [[8d10]] 6 --Name|Bob the Hero --Weapon|Plasma Rifle In my game, I am using:&nbsp; !ct [[ (@{skill} + @{skill_bonus}) ]] @{static_bonus} --Name|Bob the Hero --Weapon|Plasma Rifle I would like to be able to use&nbsp; !ct [[ floor(@{skill} /2) ]] @{static_bonus} --Name|Bob the Hero --Weapon|Plasma Rifle But its not that important. I was wondering if I was messing up the html/math part, or if the script doesn't play well with rounding.
1442920014
The Aaron
Pro
API Scripter
The script expects the first part to be an inline role of the dice to examine for sets and runs and such. You could do something like this: !ct [[ [[ floor(@{skill} /2) ]]d10 ]] @{static_bonus} --Name|Bob the Hero --Weapon|Plasma Rifle and everything would be copacetic.
You get extra points for using the word "copacetic"
...however....its not working.
1442927749
The Aaron
Pro
API Scripter
WEIRD!! &nbsp; Just looked into it. &nbsp;Apparently they changed the way the inline rolls are represented, specifically they now give us all the nested inline rolls along with the inline rolls (that didn't used to happen). &nbsp;I've adjusted the script to account for that. Update 0.1.9 - Respect offsets for inline roll position. &nbsp; <a href="https://github.com/shdwjk/Roll20API/blob/master/Ct" rel="nofollow">https://github.com/shdwjk/Roll20API/blob/master/Ct</a>...
...already? &nbsp;That is not possible... Wait, did you write a script to see the future and know I was going to ask for that, made the script, and simply waited until I asked? &nbsp;
1442934901
The Aaron
Pro
API Scripter
=D &nbsp;Nah, was an easy fix. 3 line change. &nbsp;=D