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] Calculating the cumulative value of a column of a repeating fieldset.

1451020581

Edited 1451020606
So what i'm trying to do is use two worker scripts in tandem. 1)  A worker script that adds up all values inside a repeating feildset and apply that to the total for the row 2) A second worker script, that adds up all the totals for each row, and applies it to the total. The game uses a vampire system system with flexible character points instead of levels for character advancement. I want to be able to have it keep track of a running total of all the characters earned character points.  The first script, that totals each row, works bueatifully. It only took me about 10 minutes to write it. The second script is not triggering at all however. My console.log doesn't show anything. It simply never runs.  My theoretical question is, under what conditions would that second script trigger? Does it consider the first script changing the repeating_exp_total value as a change, and thus run the second script?  However even if I edit repeating_exp_total manually, it still doens't trigger, so something is fundementally wrong. So i'm a bit confused as to what exactly is the best approach here. I'm also not 100% clear as to how to get to specific ID's. I 'think' my approach will work, but since i can't even get the script to execute I have no way to test it really. 
1451020881

Edited 1451021169
I realise now that the line (cptotal += value) might not work, or there may be other issues with this,  but the real issue i'd like to focus on is just getting the script to run at all. Once it runs I can figure out the rest with trial and error. 
1451027270
The Aaron
Pro
API Scripter
I can't see the sheet, but you keep mentioning  repeating_exp_total . Your event has change:repeating_exp:total , but should probably have change:repeating_exp_total .  Does that help?
1451028374

Edited 1451028637
According to the wiki I'm supposed to use something like this, when i'm referencing a specific feild.  on("change:repeating_spells:spelllevel", function() { getAttrs([ "repeating_spells_SpellDamage", "repeating_spells_SpellName" ], function(values) { //values.repeating_spells_SpellDamage and values.repeating_spells_SpellName will both be from the same repeating section row that the SpellLevel that changed is in. }); }); The repeating feild is denoted with class="repeating_exp" and it containts a name="attr_total" feild inside it. I'm using Jing for the screenshots. It can be stupid at times, so you may just need to reload your browser, and it should show. 
1451028755
The Aaron
Pro
API Scripter
Ah, that makes sense. Bummer, I was hoping that was it!