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

Automatically update readonly fields upon adding a new repeating section?

With the current setup I have, when a player opts to add a new repeating row, the readonly values within that are placed with their default values and not their calculated ones. How would I go about addressing this issue?
1506087012
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
I'm nterested in this as well. There doesn't seem to be an event for attribute creation.
1506092165
Jakob
Sheet Author
API Scripter
I think the problem is that a new repeating row does not really exist until you create an attribute within it by changing something. I think that the earliest time that you can do calculations is the first time any input in the row is changed.
1506096394
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Yep, that's what I'm doing atm, but was hoping for a better solution.
1506098592
Lithl
Pro
Sheet Author
API Scripter
Until you change a value to trigger the readonly field's calculation, all of the other fields will be their default values, too. Why not make the readonly field's default equal to what your calculation would  produce with default values for all the other fields...?
1506098852

Edited 1506098861
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Can't speak for Justin, but in my case, it's because the fields are affected by multiple other fields (in and out of the repeating section) that have a wide (sometimes essentially infinite) range of possible values.
1506122002

Edited 1506122044
Azurift
Sheet Author
Basically, what I'm trying to do is implement a weapons repeating section for players to add their weapons with their associated attack and damage rolls using the Pathfinder system. I have a dropdown menu to specify which ability score the attack bonus will be based off of (STR, DEX, CON, INT, WIS, CHA), but the default for a newly created section is STR, and the problem is that it does not update the attack bonus readonly field, which is just set to 0 at creation. So you have a newly created row with STR selected as their ability score, but an incorrect 0 in the attack bonus readonly field. I know I can circumvent this dilemma by throwing in a "null" default value for the ability score dropdown box (something like a "---" value), but I was just wondering if there actually was a way to address this before I did that.
1506124605
vÍnce
Pro
Sheet Author
Can't you have the mod calculated outside of the repeating section and then just use that attribute as the default value within your attack?