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

Using API to create Dice pools

I am trying to create a character sheet that can roll dice pools of various different abilities with different dtypes. Ideally I would want the player to be able to click a button by each attribute and then submit that to roll all the dice together. I have had a look through some sheetworkers stuff but I am very new to this and I can't quite work out how I could achieve this. I would also be interested if this could be something that works for the attributes in repeating sections. Thanks everyone!
1605156089
timmaugh
Forum Champion
API Scripter
Not sure about whether it works for repeating sections from the character sheet, but I did want to share that the Chronicles of Darkness character sheet does something similar to this, so that might be a place to look for inspiration. On the sheet I'm using, you can click to "engage" certain attributes. For the engaged attributes, you are adding the attribute value in d10 to the final pool of dice you will roll. There's no reason why this would have to be d10, of course... the idea is just that you click a sheet item to have it in a "selected" state, and the button that executes the roll simply gathers all of the dice from the items so-selected. I know those with more sheet experience will be along to give you more direct suggestions, but maybe having another sheet to look at could help you learn it.
1605173095
GiGs
Pro
Sheet Author
API Scripter
If I'm understanding you correctly, it is possible, and being in a repeating section is fine. Can you describe in a bit more detail (with specifics) what you want to happen, and include any html you have for the attributes you want to be part of this.
Sorry for the late reply, but I now have a version of the sheet with all the different attributes I want. the stress section at the top isn't filled out because I haven't perfected the checkbox script I want for it (probably a question for another time). <a href="https://github.com/abyssalLegate/Cortex-Drama-Sheet" rel="nofollow">https://github.com/abyssalLegate/Cortex-Drama-Sheet</a> one thing that I want to do is on attributes that have a rating and a current value I would like the current value to be rolled rather than the basic.
1605257512

Edited 1605257569
GiGs
Pro
Sheet Author
API Scripter
You're asking the people who want to help you to do much work. Most people aren't going to read through an entire character sheet and try to figure out what parts of it actually apply to the question you're asking.&nbsp; At the very least, if you're posting a character sheet, link the range of line numbers that are relevant to your question, and describe in your question what you want to do with them. But it's better to post a relevant snippet of the sheet code here, and describe what you want to do with it.
Sorry GiGs, thanks for bringing that up to me, you guys have been very patient with me so I'm sorry for being a pain. I think I may leave this question for now and focus on some other stuff so I can post some code that I'm properly happy to build off from. I think I was being a bit hasty in wanting to do everything as fast as possible. Thank you again for being so helpful and understanding.
1605272490
GiGs
Pro
Sheet Author
API Scripter
Remember you dont have to post good &nbsp;code. In fact, posting bad code is better than nothing, and its easier to see how to fix it :) We all started writing bad code, and on occasion, some of us still do... What I'm saying is, don't feel self-conscious about your code. The vast majority of people here are beginners.
Thank you! That's reassuring to hear. I think I will neaten some stuff up just because while looking at how to pretty things up with CSS I've found a better way of formatting things, which hopefully make things easier for finding solutions with.
1605369662

Edited 1605377191
Okay, So I've made some improvements to my sheet and am ready to tackle this problem again with full force. This is what a section of my script currently looks like. I would like to be able to click the button at the start of the row and the selected value for 'rlshipcurr' would be added to either a macro or a text box, so I can then roll those together with another action&nbsp; or roll button. &lt;div class="relationship"&gt; &lt;div class="relationship-row"&gt; &lt;h4 class="relationship-header"&gt;Relationships&lt;/h4&gt; &lt;/div&gt; &lt;div class="relationship-row"&gt; &lt;h4&gt;&lt;/h4&gt; &lt;h4 class="relationship-menu"&gt;Rating&lt;/h4&gt; &lt;h4 class="relationship-menu"&gt;Current&lt;/h4&gt; &lt;h4 class="relationship-menu"&gt;Statement&lt;/h4&gt; &lt;/div&gt; &lt;fieldset class="repeating_relationship"&gt; &lt;div class="relationship-row"&gt; &lt;button class="relationship-button" type="act" name="act_relationship"&gt;&lt;/button&gt; &lt;select class="relationship-main" name="attr_relationship"&gt; &lt;option value="0" selected&gt;-&lt;/option&gt; &lt;option value="d4"&gt;d4&lt;/option&gt; &lt;option value="d6"&gt;d6&lt;/option&gt; &lt;option value="d8"&gt;d8&lt;/option&gt; &lt;option value="d10"&gt;d10&lt;/option&gt; &lt;option value="d12"&gt;d12&lt;/option&gt; &lt;/select&gt; &lt;select class="relationship-main" name="attr_relationshipcurrent"&gt; &lt;option value="0" selected&gt;-&lt;/option&gt; &lt;option value="d4"&gt;d4&lt;/option&gt; &lt;option value="d6"&gt;d6&lt;/option&gt; &lt;option value="d8"&gt;d8&lt;/option&gt; &lt;option value="d10"&gt;d10&lt;/option&gt; &lt;option value="d12"&gt;d12&lt;/option&gt; &lt;/select&gt; &lt;input class="relationship-main1" type="text" name="attr_relationship_statement"&gt; &lt;/div&gt; &lt;/fieldset&gt; &lt;/div&gt; I'm guessing the best start for this would be to format the button as a checkbox, which I think I could possibly manage, but I have no idea how to go from there to what I want the button to do.
1605373612
GiGs
Pro
Sheet Author
API Scripter
The biggest problem here is you dont have a clear description what you want to do with the attribute value - where do you want in a macro? if its in a textbox, is it the entire contents of the textbox? Also, is the target location inside the same fieldset, or is it outside? If the target location is inside the fieldset, you dont need to a button for this. A really simple way is to refer to an attribute using its name like @{rlshipcurr} . You can just put that wherever you want it to show up. So lets say want to roll it in a macro, you'd put it in a button like so: &lt;button&nbsp;type="roll"&nbsp;name="roll_rlshipcurr"&nbsp;value="/roll&nbsp;@{rlshipcurr}"&gt;&lt;/button&gt; When that button is clicked, it gets the rlshupcurr value, and rolls it. Some suggestions: when you use a select that contains a value that will be rolled, always include selected option like so: &lt;select class="relationship-main" name="attr_rlshipcurr"&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;option value="0" selected&gt;-&lt;/option&gt; &lt;option value="d4"&gt;d4&lt;/option&gt; &lt;option value="d6"&gt;d6&lt;/option&gt; &lt;option value="d8"&gt;d8&lt;/option&gt; &lt;option value="d10"&gt;d10&lt;/option&gt; &lt;option value="d12"&gt;d12&lt;/option&gt; &lt;/select&gt; The change above does two things: by using selected , it ensures that the attribute always has a value. This avoids errors when trying to roll an attribute that a player hasnt selected yet. And it also prompts players to select a value = they see the "-" value and know they should have a proper dice value there so they select one. Another suggestion: always use full words for attribute names. Don't use rlship , use relationship .&nbsp; You dont have a limit on character length, and some players will want to make their own macros. They'll need to guess the name of the attribute, and if you use its actual name, it's easier for players to guess and remember. So, the above will work if you want to use the attribute inside a repeating section. If you want to set a value outside the repeating section, you need to use a sheet worker. I can show the code for that, but I'll wait to see if you actually need it.
1605376241

Edited 1605377712
Those tips are super useful and I will implement them! Okay so what I want to achieve is the player wants to roll multiple stats at once, so for example in this relationship example this person might have three relationships and want to roll 2 of them. What I would like is some kind of script that means the player can select say 'relationship1' and 'relationship3' (I don't know how repeating fields format stuff that well) and then it would create a line of text that was like '/roll @{relationshipcurrent_1}+@{relationshipcurrent_3}' What I'll do to make it easier for myself and anyone who wants to help is make those adjustments you suggested and edit the post. Also I will have stats that I want the ability to roll that aren't in repeating sections. Here is one example: &lt;div class="value-container"&gt; &lt;h4 class="value-header"&gt;Values&lt;/h4&gt; &lt;h4&gt;&lt;/h4&gt; &lt;h4 class="value-header2"&gt;&lt;/h4&gt; &lt;h4 class="value-header1"&gt;Rating&lt;/h4&gt; &lt;h4 class="value-header1"&gt;Current&lt;/h4&gt; &lt;h4 class="value-header1"&gt;Statement&lt;/h4&gt; &lt;button class="value-button" type="action" name="act_duty"&gt;&lt;/button&gt; &lt;div class="value-menu"&gt;DUTY&lt;/div&gt; &lt;select class="value-main" name="attr_duty"&gt; &lt;option value="0" selected&gt;-&lt;/option&gt; &lt;option value="d4"&gt;d4&lt;/option&gt; &lt;option value="d6"&gt;d6&lt;/option&gt; &lt;option value="d8"&gt;d8&lt;/option&gt; &lt;option value="d10"&gt;d10&lt;/option&gt; &lt;option value="d12"&gt;d12&lt;/option&gt; &lt;/select&gt; &lt;select class="value-main" name="attr_dutycurrent"&gt; &lt;option value="0" selected&gt;-&lt;/option&gt; &lt;option value="d4"&gt;d4&lt;/option&gt; &lt;option value="d6"&gt;d6&lt;/option&gt; &lt;option value="d8"&gt;d8&lt;/option&gt; &lt;option value="d10"&gt;d10&lt;/option&gt; &lt;option value="d12"&gt;d12&lt;/option&gt; &lt;/select&gt; &lt;input class="value-main1" type="text" name="attr_duty_statement"&gt; &lt;button class="value-button" type="action" name="act_glory"&gt;&lt;/button&gt; &lt;div class="value-menu"&gt;GLORY&lt;/div&gt; &lt;select class="value-main" name="attr_glory"&gt; &lt;option value="0" selected&gt;-&lt;/option&gt; &lt;option value="d4"&gt;d4&lt;/option&gt; &lt;option value="d6"&gt;d6&lt;/option&gt; &lt;option value="d8"&gt;d8&lt;/option&gt; &lt;option value="d10"&gt;d10&lt;/option&gt; &lt;option value="d12"&gt;d12&lt;/option&gt; &lt;/select&gt; &lt;select class="value-main" name="attr_glorycurrent"&gt; &lt;option value="0" selected&gt;-&lt;/option&gt; &lt;option value="d4"&gt;d4&lt;/option&gt; &lt;option value="d6"&gt;d6&lt;/option&gt; &lt;option value="d8"&gt;d8&lt;/option&gt; &lt;option value="d10"&gt;d10&lt;/option&gt; &lt;option value="d12"&gt;d12&lt;/option&gt; &lt;/select&gt; &lt;input class="value-main1" type="text" name="attr_glory_statement"&gt; &lt;button class="value-button" type="action" name="act_justice"&gt;&lt;/button&gt; &lt;div class="value-menu"&gt;JUSTICE&lt;/div&gt; &lt;select class="value-main" name="attr_justice"&gt; &lt;option value="0" selected&gt;-&lt;/option&gt; &lt;option value="d4"&gt;d4&lt;/option&gt; &lt;option value="d6"&gt;d6&lt;/option&gt; &lt;option value="d8"&gt;d8&lt;/option&gt; &lt;option value="d10"&gt;d10&lt;/option&gt; &lt;option value="d12"&gt;d12&lt;/option&gt; &lt;/select&gt; &lt;select class="value-main" name="attr_justicecurrent"&gt; &lt;option value="0" selected&gt;-&lt;/option&gt; &lt;option value="d4"&gt;d4&lt;/option&gt; &lt;option value="d6"&gt;d6&lt;/option&gt; &lt;option value="d8"&gt;d8&lt;/option&gt; &lt;option value="d10"&gt;d10&lt;/option&gt; &lt;option value="d12"&gt;d12&lt;/option&gt; &lt;/select&gt; &lt;input class="value-main1" type="text" name="attr_justice_statement"&gt; &lt;/div&gt; This section technically goes on for longer, but I didn't want to take up a load of space to explain.
1605377279
GiGs
Pro
Sheet Author
API Scripter
George B. said: Okay so what I want to achieve is the player wants to roll multiple stats at once, so for example in this relationship example this person might have three relationships and want to roll 2 of them. You can do this, but you'll need a sheet worker. Repeating sections can be tricky. What does the section of the sheet where the button will be rolled look like?&nbsp; Is there a limit to how many relationship attributes can be chosen?
So in this system by default you can choose 1 of each type of stat, for example one relationship and one value. However, you can spend points to add another to your roll. If this makes it tricky I am fine with having you only being able to select one per roll and then players would just make a separate roll when they spend points. This is what this section of the sheet looks like (I've yet to do translations but hopefully that's enough information). The idea is clicking the button on the left side will add it to your roll. Thank you for helping so much by the way.&nbsp;
1605381421
GiGs
Pro
Sheet Author
API Scripter
It's possible to do what you want (selecting multiples of each stat). Do you have a place on the sheet where the selected values and rolls are displayed, and what does the code for that look like? Are relationships the only ones in a repeating section? Can you post the code for the stat section pictured above, so i can see the attribute names for duty/glory/etc, their checkboxes and dice scores.
1605382163

Edited 1605382201
GiGs
Pro
Sheet Author
API Scripter
Also, when you have collected the dice to use in the roll, how is the roll made? Do you just roll all the dice and total them, or do you need to check which is highest, or what? Knowing this is necessary to understand how to arrange the dice output from the sheet worker I'm going to create.
Okay, so yes. Let me post the html of all the bits that need to part of this roll. So as for what happens with the roll, top two highest dice are kept and added together and 1s are crit fails, there's not much more fancy than that. As for displaying the information, I was thinking that the results would be displayed in the chat like most rolls but ideally I would like it to be obvious which stats have been selected. I know you told me not to, but I am going to link to my character sheet here, just because this pertains to the whole sheet apart from the character details section at the very start. What I will do however is list all the stats that are being used to hopefully make this simpler. <a href="https://github.com/abyssalLegate/Cortex-Drama-Sheet" rel="nofollow">https://github.com/abyssalLegate/Cortex-Drama-Sheet</a> Attribute Names list: Stress: name="attr_afraid" name="attr_angry" name="attr_exhausted" name="attr_insecure" name="attr_injured" Values: name="attr_dutycurrent" name="attr_glorycurrent" name="attr_justicecurrent" name="attr_lovecurrent" name="attr_powercurrent" name="attr_truthcurrent" Relationships: Repeating Section name="attr_relationshipcurrent" Assets: Repeating Section name="attr_asset" Extras: Repeating Section name="attr_extra" Locations: Repeating Section name="attr_location" Those are all the attributes I would like the ability to roll into this dicepool. I'm sorry if this is like way too much for you to do, I don't want to be a burden. I would be more than happy for you to show me how it's done in one instance and then I can do my best to expand on that to repurpose it for the rest. Thank you again GiGs, you are highly appreciated.
1605394000
GiGs
Pro
Sheet Author
API Scripter
I'm about to go to bed. I'll look at this in the morning - and will have a question or two in the next post. First though, I looked at the sheet and noticed your sheet workers could be a bit optimised. You have a bunch of arrays of dice values, and they all have the same values. You can simplify that work like this: const&nbsp;diceValues=&nbsp;['0','d4','d6','d8','d10','d12']; diceValues.forEach(function(value)&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;on(`clicked:afraid_${value}`,&nbsp;function()&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;setAttrs({ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'afraid':&nbsp;value &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}); &nbsp;&nbsp;&nbsp;&nbsp;}); &nbsp;&nbsp;&nbsp;&nbsp;on(`clicked:angry_${value}`,&nbsp;function()&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;setAttrs({ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'angry':&nbsp;value &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}); &nbsp;&nbsp;&nbsp;&nbsp;}); &nbsp;&nbsp;&nbsp;&nbsp;on(`clicked:exhausted_${value}`,&nbsp;function()&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;setAttrs({ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'exhausted':&nbsp;value &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}); &nbsp;&nbsp;&nbsp;&nbsp;}); &nbsp;&nbsp;&nbsp;&nbsp;on(`clicked:insecure_${value}`,&nbsp;function()&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;setAttrs({ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'insecure':&nbsp;value &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}); &nbsp;&nbsp;&nbsp;&nbsp;}); &nbsp;&nbsp;&nbsp;&nbsp;on(`clicked:injured_${value}`,&nbsp;function()&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;setAttrs({ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'injured':&nbsp;value &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}); &nbsp;&nbsp;&nbsp;&nbsp;}); }); You only need one forEach loop, and just reuse the same array. But you can improve on this. The structure of each sheet worker is exactly the same - the only thing that varies is the name of the condition (afraid, injured, etc). So you can use a second array and a nested forEach loop to streamline this like so: const&nbsp;diceValues=&nbsp;['0','d4','d6','d8','d10','d12']; const&nbsp;conditions&nbsp;=&nbsp;['afraid',&nbsp;'angry',&nbsp;'exhausted',&nbsp;'insecure',&nbsp;'injured']; conditions.forEach(function(condition)&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;diceValues.forEach(function(value)&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;on(`clicked:${condition}_${value}`,&nbsp;function()&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;setAttrs({ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[condition]:&nbsp;value &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}); &nbsp;&nbsp;&nbsp;&nbsp;}); });
Thank you so much GiGs. I kind d assumed that could be done but I could not fathom how
1605394541
GiGs
Pro
Sheet Author
API Scripter
Back to your actual problem. In the picture above there is what looks like a checkbox at the left of each stat (duty, glory, the relationships, etc), but in your html sheet there isnt a checkbox. You have an action button there though in many of them - is that button styled like a checkbox?&nbsp; For what you want to do, you will need to change those to checkboxes. And for easier coding, it would be best if the name of that checkbox is the same as the stat, with _check or some other consistent suffix after it. Also with stats like duty and dutycurrent, and releationship and relationshipcurrent, I recommend reversing that naming a bit. Since the current value is the one that is used most, drop the current, and the other ones add something like base to the name. So duty becomes duty_base , and dutycurrent &nbsp;becomes duty . And the checkbox it will need be therefore something like duty_check , or duty_active . PS: I noticed the fieldset name for Locations is repeating_extra. Is that supposed to be repeating_location?
1605394570
GiGs
Pro
Sheet Author
API Scripter
George B. said: Thank you so much GiGs. I kind d assumed that could be done but I could not fathom how You're welcome :)
Thank you for the advice, with the name changes I had been thinking about that but I shall go do that now and make it easier on everyone including myself for later on. With the button, I basically put those in as placeholders because I hadn't figured out how to make them do what I want yet, but yeah, they probably do need to be styled as checkboxes. seeing as you'll be going to sleep soon I'll probably see if I can manage that on my own.I'll make sure to do the naming thing like you said though!
I have made the changes you suggested. I adapted the checkbox formula from the CSS wizardry section, so I hope that's okay. <a href="https://github.com/abyssalLegate/Cortex-Drama-Sheet" rel="nofollow">https://github.com/abyssalLegate/Cortex-Drama-Sheet</a> I used the suffix ' _flag ' just because that was easiest. The checkbox formatting is there for the repeating sections but it doesn't work as is because I don't know the secret magic words to make it work yet, but hopefully that's something you can work with?
1605553385
GiGs
Pro
Sheet Author
API Scripter
I didnt have time to do anything yesterday :) I didnt mean to style the buttons as checkboxes, but to replace them with checkboxes. So this entire thing &lt;div class="toggle-container"&gt; &nbsp; &nbsp; &nbsp; &lt;input type="hidden" class="toggle" name="attr_duty_flag" /&gt; &nbsp; &nbsp; &nbsp; &lt;button type="action" name="act_duty" class="toggle"&gt; &nbsp; &nbsp; &nbsp; &nbsp; &lt;span class="checked"&gt;?&lt;/span&gt; &nbsp; &nbsp; &nbsp; &lt;/button&gt; &nbsp; &nbsp; &lt;/div&gt; would become &nbsp; &nbsp; &nbsp; &lt;input type="checkbox" class="toggle" name="attr_duty_flag" value="1"/&gt;
1605555815

Edited 1605575031
GiGs
Pro
Sheet Author
API Scripter
Whew, here's a sheet worker that might do what you need if I have written it correctly. It's complicated by the fact you have multiple repeating sections to check, which creates problems for putting it all in one sheet worker (there is an easier way to write this that depends on having multiple intermediate hidden inputs). But here goes: This absolutely requires &nbsp;that every attribute listed in the dicepool_attributes variable near the top has a matching '_flag' checkbox. I think your sheet does have that. It also requires &nbsp;that you have an input or span to recieve the output if the sheet worker, named dice_pool . &lt;input type="text" name="attr_dice_pool" value='' readonly&gt; The sheet worker will generate results that look like this: 0&nbsp; '1d4' '1d6 + 1d8' '1d10 + 1d4 + 1d6' and so on. The worker will read all of the attributes, and repeating sections, check which ones have their flags checked, and get the dice value for all &nbsp;of the checked stats and store them as above. To use that stat, you can have a button with a value something like value="/roll {@{dice_pool}kh2" Since I dont know the format of your roll, i had to guess what output would work. If some of your dice work differently (like the conditions, afraid, injured etc) you havent told me, so i couldnt incorporate that. Here's the sheet worker. const &nbsp; int &nbsp;=&nbsp;( value ,&nbsp; error &nbsp;=&nbsp; 0 )&nbsp; =&gt; &nbsp; parseInt ( value )&nbsp;||&nbsp; error ; const &nbsp; dicepool_attributes &nbsp;=&nbsp;[ 'afraid' ,&nbsp; 'angry' ,&nbsp; 'exhausted' ,&nbsp; 'insecure' ,&nbsp; 'injured' ,&nbsp; 'duty' ,&nbsp; 'glory' ,&nbsp; 'justice' ,&nbsp; 'love' ,&nbsp; 'power' ,&nbsp; 'truth' ]; const &nbsp; dicepool_sections &nbsp;=&nbsp;[ 'relationship' ,&nbsp; 'asset' ,&nbsp; 'resources:extra' ,&nbsp; 'resources:location' ]; const &nbsp; dicepool_changes &nbsp;=&nbsp; ` ${ dicepool_attributes . reduce (( result , stat )&nbsp; =&gt; &nbsp; ` ${ result } &nbsp;change: ${ stat } &nbsp;change: ${ stat } _flag` ,&nbsp; '' ) } &nbsp; ${ dicepool_sections . reduce (( result , stat )&nbsp; =&gt; &nbsp; ` ${ result } &nbsp; ${ stat . includes ( ':' )&nbsp;?&nbsp; `change:repeating_ ${ stat . split ( ':' )[ 0 ] } : ${ stat . split ( ':' )[ 1 ] } &nbsp;change:repeating_ ${ stat . split ( ':' )[ 0 ] } : ${ stat . split ( ':' )[ 1 ] } _flag` &nbsp;:&nbsp; `change:repeating_ ${ stat } : ${ stat } &nbsp;change:repeating_ ${ stat } : ${ stat } _flag` } ` ,&nbsp; '' ) } ` ; on ( dicepool_changes ,&nbsp;()&nbsp; =&gt; &nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp; console . log ( dicepool_changes ); &nbsp;&nbsp;&nbsp;&nbsp; getSectionIDs ( 'repeating_relationship' ,&nbsp; id_relationships &nbsp; =&gt; &nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; getSectionIDs ( 'repeating_asset' ,&nbsp; id_assets &nbsp; =&gt; &nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; getSectionIDs ( 'repeating_resources' ,&nbsp; id_extras &nbsp; =&gt; &nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; getSectionIDs ( 'repeating_resources' ,&nbsp; id_locations &nbsp; =&gt; &nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const &nbsp; fieldnames &nbsp;=&nbsp;[]; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id_relationships . forEach ( id &nbsp; =&gt; &nbsp; fieldnames . push ( &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; `repeating_relationship_ ${ id } _relationship` , `repeating_relationship_ ${ id } _relationship_flag` )); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id_assets . forEach ( id &nbsp; =&gt; &nbsp; fieldnames . push ( &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; `repeating_asset_ ${ id } _asset` , `repeating_asset_ ${ id } _asset_flag` )); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id_extras . forEach ( id &nbsp; =&gt; &nbsp; fieldnames . push ( &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; `repeating_resources_ ${ id } _extra` , `repeating_resources_ ${ id } _extra_flag` )); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id_locations . forEach ( id &nbsp; =&gt; &nbsp; fieldnames . push ( &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; `repeating_resources_ ${ id } _location` , `repeating_resources_ ${ id } _location_flag` )); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dicepool_attributes . forEach ( stat &nbsp; =&gt; &nbsp; fieldnames . push ( &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; stat ,&nbsp; ` ${ stat } _flag` &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; getAttrs ( fieldnames ,&nbsp; values &nbsp; =&gt; &nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; let &nbsp; diceout &nbsp;=&nbsp;[]; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dicepool_attributes . forEach ( stat &nbsp; =&gt; &nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const &nbsp; flag &nbsp;=&nbsp; int ( values [ ` ${ stat } _flag` ]); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( flag )&nbsp; diceout . push ( values [ stat ]); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const &nbsp; getDiceFromSection &nbsp;=&nbsp;( section ,&nbsp; stat ,&nbsp; ids )&nbsp; =&gt; &nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const &nbsp; output &nbsp;=&nbsp;[]; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ids . forEach ( id &nbsp; =&gt; &nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const &nbsp; flag &nbsp;=&nbsp; int ( values [ `repeating_ ${ section } _ ${ id } _ ${ stat } _flag` ]); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( flag )&nbsp; output . push ( values [ `repeating_ ${ section } _ ${ id } _ ${ stat } ` ]); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return &nbsp; output ; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const &nbsp; relationships &nbsp;=&nbsp; getDiceFromSection ( 'relationship' ,&nbsp; 'relationship' ,&nbsp; id_relationships ); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const &nbsp; assets &nbsp;=&nbsp; getDiceFromSection ( 'asset' ,&nbsp; 'asset' ,&nbsp; id_assets ); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const &nbsp; extras &nbsp;=&nbsp; getDiceFromSection ( 'resources' ,&nbsp; 'extra' ,&nbsp; id_extras ); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const &nbsp; locations &nbsp;=&nbsp; getDiceFromSection ( 'resources' ,&nbsp; 'location' ,&nbsp; id_locations ); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; diceout &nbsp;=&nbsp;[... diceout ,&nbsp;... relationships ,&nbsp;... assets ,&nbsp;... extras ,&nbsp;... locations ]; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; setAttrs ({ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dice_pool : &nbsp; diceout . length &nbsp;===&nbsp; 0 &nbsp;?&nbsp; '0' &nbsp;:&nbsp; diceout . join ( '&nbsp;+&nbsp;' ) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}); &nbsp;&nbsp;&nbsp;&nbsp;}); });
1605556414
GiGs
Pro
Sheet Author
API Scripter
Also you have a sheet worker that doesnt work properly, and should probably be deleted when using the above one: The code below doesnt properly account for how repeating sections are addressed. You'd be ebtter off spliting it into two workers, once for for the normal stats and another for the repeating sections. But with my previous post, and replacing all the _flag buttons with checkboxes, you dont need this worker any more. const toggleList = ["afraid","angry","exhausted","insecure","injured","duty","glory","justice","love","power","truth","relationship","asset","extra","location"]; toggleList.forEach(function(button) { on(`clicked:${button}`, function() { const flag = `${button}_flag`; // Check the current value of the hidden flag. getAttrs([flag], function(v) { // Update the value of the hidden flag to "1" for checked or "0" for unchecked. setAttrs({ [flag]: v[flag] !== "1" ? "1" : "0" }); }); }); });
Can I just say that you are an absolute star! I haven't implemented this script yet but That's a hell of a lot of work you've put in for me that I absolutely could not have fumbled my way to create in a long long time. I have reformatted all my buttons into checkboxes with the flag marker so hopefully everything is good to go. Thank you so so so much, going to fiddle and see if I can't get this working!!
1605559530

Edited 1605569787
GiGs
Pro
Sheet Author
API Scripter
Good luck! I just noticed I had a minor glitch in one line (didnt stop it working, but wouldnt work when using the output as a dice roll). Change this line &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dice_pool : &nbsp; diceout . length &nbsp;===&nbsp; 0 &nbsp;?&nbsp; '' &nbsp;:&nbsp; diceout . join ( '&nbsp;+&nbsp;' ) to the line below (I've updated the post above): &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dice_pool : &nbsp; diceout . length &nbsp;===&nbsp; 0 &nbsp;?&nbsp; '0' &nbsp;:&nbsp; diceout . join ( '&nbsp;+&nbsp;' )
Hey GiGs. Unfortunately I'm having a bit of trouble getting it to work for me. I changed all the buttons to checkboxes and made the little fix you sent most recently, but I cannot make the roll work. I made the input box for the dicepool attribute visible to see if it worked and when I check a checkbox nothing appears from there and no value can be rolled from the box either. I took out all of my code except for the following lines and just tried to see if I could get one attribute working but no dice (pardon the pun). &lt;div&gt; &lt;input type="checkbox" class="toggle" name="attr_afraid_flag" value="1"/&gt; &lt;h4&gt;AFRAID&lt;/h4&gt; &lt;input type="text" name="attr_afraid" value="1d4"&gt; &lt;/div&gt; &lt;input type="text" name="attr_dice_pool" value=''&gt; I also opened up a new campaign and copied the code over to that and still got the same result. I'm assuming I'm doing something wrong on my side of the code if you managed to get it working for you, but I don't know what. I've put the updated code at:&nbsp; <a href="https://github.com/abyssalLegate/Cortex-Drama-Sheet/blob/master/Cortex%20HTML" rel="nofollow">https://github.com/abyssalLegate/Cortex-Drama-Sheet/blob/master/Cortex%20HTML</a> &nbsp;but if you can spot anything wrong with the small test segment I've made then I can probably extrapolate out what I've done wrong with the rest of the actual html. Thank you for bearing with me.
1605569756
GiGs
Pro
Sheet Author
API Scripter
I had an error on one of the early lines of the function, I've fixed and tested the code now - I've updated the code in my earlier post: <a href="https://app.roll20.net/forum/permalink/9500456/" rel="nofollow">https://app.roll20.net/forum/permalink/9500456/</a>.
YES!! Oh my God! Thank you so much!!! This is really incredible.&nbsp; Is there anything I can do to say thank you other than gush about how cool this is that it works?
1605573007

Edited 1605573157
GiGs
Pro
Sheet Author
API Scripter
hehe, your adulation will suffice. Also, I noticed you started on sheet workers to set the current values of the attributes. Here's a sheet worker loop to do all of them: const&nbsp;stats&nbsp;=&nbsp;['duty',&nbsp;'glory',&nbsp;'justice',&nbsp;'love',&nbsp;'power',&nbsp;'truth']; stats.forEach(stat&nbsp;=&gt;&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;on(`change:${stat}base`,&nbsp;()&nbsp;=&gt;&nbsp;{&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;getAttrs([`${stat}base`],&nbsp;(values)&nbsp;=&gt;&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;let&nbsp;base&nbsp;=&nbsp;values[`${stat}base`]; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;setAttrs({&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[stat]:&nbsp;base &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}); &nbsp;&nbsp;&nbsp;&nbsp;}); });
You are way too good to me! Also, Sorry, I didn't do rigorous enough testing, I'm having some trouble making the repeating section rolls work for me. Is that a problem on you're end too.
1605574982
GiGs
Pro
Sheet Author
API Scripter
I just noticed you changed the way locations and extras were built - putting them in a new repeating section, resources. This was stopping the repeating section code from working properly because I'd built it from an earlier version of the sheet where they were in their own sections. I've just updated the code above for the new layout.
Oh yeah, that would do that wouldn't it! Sorry for messing around with that, I had just been working on making the page look nicer the last couple of days. It's working perfectly now! Thank you!