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] 13th Age Icon Rolls

1444704016

Edited 1444704245
Wanted to play around with the API a bit so I threw together a script my players could use to get their icons rolls handled.&nbsp; <a href="https://github.com/jgerman/roll20scripts/blob/mast" rel="nofollow">https://github.com/jgerman/roll20scripts/blob/mast</a>... Probably not idiomatic javascript (or Roll20 api for that matter, maybe I could have done it without the api) but it does what I need. I just have the players create macros that call the script with json tailored to their icons.&nbsp; Forgot to add an example use: !iconroll [{"name":"Great Gold Worm", "dice":2, "relation":"positive"}, {"name":"Crusader", "dice":1, "relation":"conflicted"}] The relation field isn't used yet, but I'll add it later on.&nbsp;
1444733745
The Aaron
Pro
API Scripter
Great start on a new contribution! &nbsp;It's true that you could pretty much do this with the dice engine, but you're just getting started and there are other cool things you could add to it. If you want to talk through the code and discuss idiomatic JavaScript or Roll20 API code, I'm happy to chat about it! =D
If you could point me in the right direction for doing this with the dice engine I'd appreciate it, if I can simplify it that'd be cool.
1444743468
The Aaron
Pro
API Scripter
Sure! &nbsp;With Icon rolls, you're looking for the number of successes on some number of d6s with success being a number greater than 4. &nbsp;You can express that as: /r 2d6&gt;5 In this context, &gt; means greater than or equal to (The syntax was inherited from an earlier dice roller, as I understand it). &nbsp;The above will result in something like: with inline rolls, you can further enhance the look: Great Gold Worm: [[2d6&gt;5]] successes Crusader: [[1d6&gt;5]] successes which will look something like: With some additional formatting tricks, you can make it look even a little better: /em checks standing with the Icons **Great Gold Worm:** [[2d6&gt;5cs&gt;5cf&lt;4]] successes **Crusader:** [[1d6&gt;5cs&gt;5cf&lt;4]] successes /em adds the orange banner (emote) the ** ** demarks bold cs&gt;5 tells it to be a critical success at 5 or higher (green outline) cf&lt;4 tells it to be a critical failure at 4 or lower (red outline) This doesn't let you do anything with relationship, but you could list it in the text as well, or whisper it to the GM as a reminder. See more details on the dice roller: &nbsp; <a href="https://wiki.roll20.net/Dice_Reference" rel="nofollow">https://wiki.roll20.net/Dice_Reference</a>
Ah, cool. Yeah I did play with that a bit but simply counting successes isn't quite what I was after. On the icon roll 5s and 6s are qualitatively different. What I wanted was to see the rolls that came up 5 or 6 with anything else thrown out. I also like seeing discrete tables for stuff like this rather than chat messages. I'm assuming the roll template is the right choice for that? Can you format as a table directly into the chat window as opposed to using a template? The default template works and looks the way I want, but feels kludgy, and doesn't seem customizable.&nbsp; For instance I might want to change the header color or left justify the table data.
You might also be interested in what my new script can do. It is for The Adventure Game, a dungeon crawler/rpg I've been tinkering with off and on for five plus years. It's nowhere near ready for use by anyone however. The dice images/text are static at the moment instead of collapsing together. What I have done so far was mostly just proof of concept, so that I didn't forget my idea in the meantime.
Looks great, and definitely along the style I was looking for.
1444771289
Gen Kitty
Forum Champion
I've done mine similarly, except I only flag 5 and 6: Elf Queen (Conflicted): [[1d6cf5cs6]] [[1d6cf5cs6]] Orc Lord (Negative): [[1d6cf5cs6]] Emperor (Positive): [[1d6cf5cs6]] 5s are flagged in red, 6s are flagged in green, any other number is normal.&nbsp; (This is all wrapped in Powercard code in the actual macro, but I stripped that for this conversation) Congrats on joining the API crowd! :)
I like that, though there's a little piece of me that still wants to be able to drop anything that's not a 5 or a 6 ;)&nbsp;
1444800235
Andrew R.
Pro
Sheet Author
You've forgotten the Bard's&nbsp;Balladeer talent, which uses Cursed Icon rolls where 1 & 2 are interesting.
Good point, I'll likely modify my script to add an option to that in the json config at some point.