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

Help with adding extra attribute with every max dice

Hello Everybody, I'm developing a charachter sheet for a homebrew game. In this game we roll d6 and sum an attribute, but when we roll a crit (when the die is 6) we sum this attribute again. Basicaly not a crit: d6 + attribute. When the die is 6: d6 + 2x(attribute). But some mechanimics make me abble to roll more d6 and when this d6 is rolled a 6 I should be abble to add the attribute again. So if i roll 2d6 and hit 6 in both I sum [6]+[6]+3x(attribute) I tried do it using throug macro and API script but I can't figured out how to do it. How can I emulate this behavior through roll20?
1689800961

Edited 1689801092
GiGs
Pro
Sheet Author
API Scripter
I don't understand your description, can you try again? It's d6 + attribute, but if you roll a 6, you add the attribute again? If you roll any more dice, any 6s on those also add the attribute? You might need to do this with Custom Roll Parsing.
That's Its. If i roll a 6 in a d6 I add the attribute again, if I roll more dice any 6 on those I also add the attribute. Thanks for your help, I found the article in the Docs about the CRP. Didn't know this existed.
1689813708

Edited 1689813908
GiGs
Pro
Sheet Author
API Scripter
Yes, I think you'll definitely need CRP for that. If you're looking at the wiki, the Button page contains information about CRP I consider essential. Not sure why it isn't included in the CRP page: <a href="https://wiki.roll20.net/Button#Roll_Parsing" rel="nofollow">https://wiki.roll20.net/Button#Roll_Parsing</a> Also, in another thread, I gave an example of CRP. See the last post here: <a href="https://app.roll20.net/forum/permalink/11549443/" rel="nofollow">https://app.roll20.net/forum/permalink/11549443/</a>
1689814180

Edited 1689814306
GiGs
Pro
Sheet Author
API Scripter
It occurs to me you could also do that with a bunch of rollable tables. You'd need a separate table for each attribute value, and they'd all include 1, 2, 3, 4, 5, and 6 values. But instead of a 6 value, you'd enter 6+ (attribute for that table). Then your roll would be (number of dice}t[name-of-table] + (attribute-value} Since every die adds the attribute value on a roll of 6 this is doable, but tedious. With carful naming of the tables, you might be able to make a universal macro. Or maybe you'd need a dropdown query where someone enters the number of dice and the roll for that number is made. If the custom sheet is just for your own group, this is a simple solution since you only need to create it once. But if you intend to share the sheet to the roll20 community, a CRP solution would be better since GMs don't need to create their own tables to make the sheet work.
1689818928
Gauss
Forum Champion
Couldn't the dice roller almost handle this?&nbsp; This comes close to working but doesn't finish the math: {[[d6]],0}&gt;6*@{attributename} +@{attributename} + $[[0]] Then couldn't sheet magic pull the dice rolls and add them together or something?&nbsp; If not I seem to remember the API should be able to do that.&nbsp; Note, it doesn't address rolling additional sixes though, but either the API can do that (I think, I am not a scripter) OR you could have a chat menu button to roll it again if you have an ability that allows you to add more 6s.&nbsp;
1689819683
GiGs
Pro
Sheet Author
API Scripter
The API can do it (anything you can do with CRP you can also do with the API), but I never give an API solution unless the person is marked Pro or has stated their GM is Pro. That roll is a clever construction. It does work properly with the /roll syntax, but doesn't appear to work with inline rolls. But as you point out, there are issues (handling extra dice), which the CRP and rollable tables methods do work with.
Thanks guys for all help. Sometimes i feel a little lost reading the wiki and can't find some of resources I could use. At the weekend I will start coding for this CharacterSheet and will be using the CRP (started to read about it already). I have access to a PRO account, but it is not mine so I didn't used it to post here. I tried to use the API, but the soluctions I found didn't fit for me... I think I just don't know all roll20 resources yet haha
1689864301

Edited 1689864322
GiGs
Pro
Sheet Author
API Scripter
If you have Pro, you should get the TokenMod Script. For this particular issue, I'd check out Scriptcards. It lets you build rolls and include programming in a way that might be simpler than CRP. That said, I posted a fairly complex CEP example over here: <a href="https://app.roll20.net/forum/permalink/11549443/" rel="nofollow">https://app.roll20.net/forum/permalink/11549443/</a> For general sheet construction, the Roll20 wiki is helpful, but you might also find useful stuff at my blog too: <a href="https://cybersphere.me/roll20-sheet-author-master-list/" rel="nofollow">https://cybersphere.me/roll20-sheet-author-master-list/</a>
Certainly, I will be following your blog. In the last year I started to code some character sheets and always I find asking myself "How is the better way to do it?" Thanks again for all help, GiGs.
1689865294
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Heh, my advice is the opposite. Use crp. It is vastly simpler than script cards, and will make your sheet usable by anyone if you decide to publish your game and sheet.
+1 on CRP, and it should be pretty easy, too.&nbsp; Something like this should work: const n_dice = 1; const roll_template = `&amp;{template:default} {{roll1=[[${n_dice}d6]]}}`; startRoll(roll_template, results =&gt; { &nbsp;&nbsp;&nbsp;&nbsp;const sixes = _.chain(results.roll1.dice).map(d =&gt; { return d === 6 ? 1 : 0; }).compact().value(); &nbsp;&nbsp;&nbsp;&nbsp;const computed = results.roll1.result + ((sixes.length || 0 + 1) * attribute); &nbsp;&nbsp;&nbsp;&nbsp;finishRoll(results.rollId, { roll1: computed }); });
1689878173

Edited 1689992232
GiGs
Pro
Sheet Author
API Scripter
Whenever someone says CRP is easier than absolutely any alternative, I think it's because they are looking only at the end product, and only at a small part of what is actually needed for it to work (remembering that it needs the base HTML, CSS, rolltemplate, javascript generally and CRP javascrift specifically (which are different things)), and forgetting that they already know how to create CRP and the person asking for help probably doesn't. That said, the javascript in this case does look fairly simple - if you already know how to write CRP. I do agree that if the goal is to make the sheet shareable, a CRP approach is better than a Script-based sheet, which should really only be used when creating a sheet for your own group's use only.
Fair point.&nbsp; I did struggle quite a bit with CRP at first, but it was well worth jumping down that rabbit hole.&nbsp; Because once I was able to wrap my mind around it, CRP did become easy (for me).&nbsp; So, I'll recant my 'easy' remark and instead say I believe it is well worth investing the time to understand and structure your sheet so that you can take advantage of CRP.&nbsp; ;)
1689990951
GiGs
Pro
Sheet Author
API Scripter
I agree with that. It is powerful, and I'm still finding new ways to do things with it that you can't do any other way. I just have a kneejerk reaction to people saying it's easy :)