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

Making complex custom dice roll (Tracking 6 or 1 results and partial rerolls) using character attr_

Hello. I am about to start a game of Mutant: Year Zero But non of the current roll macros can handle the types of rolls we need to do. The player rolls a number of dice for Stat(yellow), Skill(green), optional item(black). The dice are D6 but in this case the values are irrelevant if they not 6 or 1. This is due to 6 being a success, and any success is a success, more successes equals better results, 1 does not count as a fail or a negative, but it does have speciall meaning if the character push him/her/self. When pushing one self, the player get to reroll all non 1,6 results in the hope of getting more 6, but now the 1 have a negative effect. equipment breaks, the body breaks etc. This requires some fancy javascripting me thinks, and I am not sure if the api can handle this, or to what extent the java script is limited. The dream would be to be able to have one of those nice dice icons next to each skill, and when it's clicked it ask you for your item bonus. It then spits out Lets say the character have 5 Strength, 3 in the relevant skill, and a nice 3 dice crowbar to convince the dune beatle who is boss. Stat: success(1), biohazard(2), other(2) Skill: success(1), other(2) item: success(1), broken(1). other(1) Total Succes(3) here the player in question should be able to type !push Where upon it rerolls all the "other" dices adding them to the total Stat: success(2), biohazard(3) other(0) Skill: success(2), other(0) item: succes(1), broken(2). other(0) Total Succes(5), Trauma(3), Broken(2) But now outputing Trauma and damage to the equipment. You with the great knowledge of the API might help me with a difficulty estimate and if the system could truly handle this.
1421040153
The Aaron
Pro
API Scripter
It can handle that, it would require a few more advanced concepts, but is not overly difficult.
Can one incorp jquery?
1421069926
The Aaron
Pro
API Scripter
No. Underscore is available though.
Ok. Need to read up a bit. define some datatypes etc. Will return with more specific questions if I got any problems.
1421075564

Edited 1421075602
Is there a good example script for interacting with a characters attr_ values?
1421081744
The Aaron
Roll20 Production Team
API Scripter
Items in the character sheet that are named attr_&lt;something&gt; are stored in attribute objects which are tied to the character object . There are also some helper functions for reading the values of attributes. Pretty much any script that deals with character attributes would probably be a good resource. Here is one of mine that deals with character attributes: <a href="https://app.roll20.net/forum/post/1067109/script-c" rel="nofollow">https://app.roll20.net/forum/post/1067109/script-c</a>...
1421188001

Edited 1421188870
Be warned that the actuall textout put is in Swedish. But all varaible names are English. Things that are going to change is actually moving variables into the YearZero namespace and have one Dice roller instance per player, it's the quickest way I think to prevent players from effecting another players dice result. And then lots of gui layout stuff. So Early early early version. <a href="https://gist.github.com/anonymous/8a3191a99e113b2905e4" rel="nofollow">https://gist.github.com/anonymous/8a3191a99e113b2905e4</a>
1421188187
Lithl
Pro
Sheet Author
API Scripter
<a href="https://gist.github.com/" rel="nofollow">https://gist.github.com/</a> is the standard. Post a link to the gist, and the forum will display the code as a collapsible preview.
Right now I use the format !mzroll [BaseStat] [Skill] [Item] each a integer defining the number of dice. and !mzpush will reroll all dices that got a result that is not a success or possbile failiure. What I actually want to do (based upon possiblity) is that when a player write !mzroll a popup dialog appears, with three selection boxes. Where the player can actually select the base stat, a skill and an item that are defined in the character sheet. Press roll, and get the output to the chat window. But as an early step I would just be glad to pop up a box with three empty input fields.
1421192236
The Aaron
Pro
API Scripter
Swedish? Are you sure? I didn't see a single "Bork, Bork, Bork!" =D What you're describing is not currently possible. The best you could hope for is three consecutive prompts via ?{query} syntax.
But i can return hmtl tags for rendering to the chat right? I am considering using specific dice images instead. "Radiation" "BioHazard" "Explosion" as well as colors. Something looking like the original dice /roll output, is there a way/example to get that effect.
1421242036
The Aaron
Pro
API Scripter
Yes, html to chat is possible. /direct writes html to the chat log for everyone. You can also just include whatever html you want in regular messages and in /w &lt;person&gt; calls, but more of it gets broken by the sanitizer. You our may be able to dump out input fields for an html form, but you won't have a way to read/submit them.