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

[PF by Roll20] Is there a way to sync the per day of a repeating ability on a token?

I'm trying to figure out if there is a way to sync the used/max per day of a repeating ability on the token so that if you edit one it edits both like syncing your HP to the token.  After a significant amount of digging I was able to learn how to find the RowID and everything for macro usage but I don't know how to sync it to the token bars.  Currently I can use these to call the used/max values in macros but I don't see any way to attach both of these values to a bar on the token. @{Peregrine "Grim" Scamp|repeating_abilities_-NNMbcs7rnKoajPSMJtO_perday} @{Peregrine "Grim" Scamp|repeating_abilities_-NNMbcs7rnKoajPSMJtO_perday_qty}
1677983697

Edited 1677983931
Gauss
Forum Champion
Short version, you cannot without a Mod (API script). Character sheets use a lot of behind the scenes magic (coding) to do what the HP bar does.  What you need is a Mod that will push the maximum value (perday_qty) from the row ID into an attribute. Then link the Attribute to the bar normally.  The Mod will also need to read the token bar and reverse the push to the perday row. (To keep the current total accurate.) Alas, Mods are not my territory, so I suggest posting this in the Mods (API Script) forum.  Alternately, just create an Attribute, put the values in the Attribute. It won't be connected to the sheet but you can use it on the token. 
Unfortunately I can't do it with an API script since it's not in one of my games, but thanks for the input at least.  I did try the attribute method and that will work just fine for some instances, but one of the main reasons I wanted to do this was to make it easier on another player and unfortunately that player's resource doesn't scale with an easily formatted formula...
1677988918
Gauss
Forum Champion
What is the player's resource mechanic? Perhaps I can come up with a formula.
1678028080

Edited 1678028127
It's MP from FFd20, specifically for the Scholar.  The problem is that the MP ramps up by different numbers as it goes up as does the bonus from your mental stat.  I can probably figure out the rate but I don't know how to translate it to a formula that Roll20 can use.
1678028779

Edited 1678028821
Gauss
Forum Champion
I don't know the game or the mechanic, I need more details please. How the bonus from the mental stat applies. How the "MP" ramps up, etc. As much detail as possible.  
Here's the class table that shows how much MP they get and when they gain access to new spell levels.  The second chart is bonus MP per day based on the character's mental stat.  For the Scholar in particular it gets bonus MP for each White and Black magic (Wis and Int respectively), so essentially it'll ramp up with two different mental stats.  The chart works on a "you get what it says" basis, not "you get the total of what it says" so someone with a 20 in their mental stat and access to 4th level spells gains 11 extra MP.
1678042201

Edited 1678043530
Gauss
Forum Champion
Short answer, there is a way to do this, but it is going to be....extensive. I will have to see if the PF sheet can even handle it.  For the first part (class) it would look something like this (not proper attribute format, this is just my shorthand):  1 +level +{level-5,0}kh1 +2*{level-8,0}kh1 + {level-11,0}kh1 +{level-14,0}kh1 +{level-17,0}kh1 +{level-19,0}kh1 Based on this: 01: 1+1+0+0 = 2 02: 1+2+0+0 = 3 03: 1+3+0+0 = 4 04: 1+4+0+0 = 5 05: 1+5+0+0 = 6 06: 1+6+1+0 = 8 07: 1+7+2+0 = 10 08: 1+8+3+0 = 13 09: 1+9+4+2*1 = 16 10 : 1+10+5+2*2 = 20 11: 1+11+6+2*3 = 24 12: 1+12+7+2*4+1 = 29 13: 1+13+8+2*5+2 = 34 14: 1+14+9+2*6+3 = 39 15: 1+15+10+2*7+4+1 = 45 16: 1+16+11+2*8+5+2 = 51 17: 1+17+12+2*9+6+3 = 57 18: 1+18+13+2*10+7+4+1 = 64 19: 1+19+14+2*11+8+5+2 = 71 20: 1+20+15+2*12+9+6+3+1 = 79 Haven't worked out the ability section yet. 
Yeah that looks quite intensive so far.  I really don't think this sheet can handle all that but you're free to try.
1678069092

Edited 1678069499
Gauss
Forum Champion
Yeah, got to testing it (had other things to deal with till now) and...the max # per day cannot handle keep/drop calculations for some reason.  I've seen this in a number of spots on the sheet. Not sure why, probably something to do with how the sheet was coded.  Sorry I wasn't able to come up with a solution for you.  If, in the future, your GM gains a Pro account a Mod (API script) should be able to solve this without too much difficulty. 
Not to worry, didn't really expect a very high chance of this working out anyways considering the sheet.  I prefer it on an aesthetic basis but I definitely recognize that it has some limitations to it.
Oof that's a table and a half! Doing Level minus Threshold with a minimum of zero can be accomplished without keep/drop calculations by doing abs(level-threshold-min)+(level-threshold+min). That implementation should be more compatible since it should be auto-calc safe. I'm sorry to inform you Gauss that you have an off-by-one error at level 8. 1+8+3 is 12 not 13. Easily fixed by swapping the 2*max(level-8,0) with max(level-7,0)+max(level-9,0). Finally since I cannot resist a challenge I stared at the bonus by ability score until I unlocked the surprisingly regular construction. Each spell level increases the MP by a multiple of the spell level. With the multiples increasing every 4 rows but using staggered starting rows. I used queries for prototyping so the bonus calculation ends up being [[ ceil((abs(?{Abi|12}-11)+?{Abi}-11)/16) [1st {{ ]+2*(abs(floor(?{Level|1}/4)-1)-(floor(?{Level}/4)+1))/-2*ceil((abs(?{Abi}-13)+?{Abi}-13)/16) [2nd ]+3*(abs(floor(?{Level}/7)-1)-(floor(?{Level}/7)+1))/-2*ceil((abs(?{Abi}-15)+?{Abi}-15)/16) [3rd ]+4*(abs(floor(?{Level}/10)-1)-(floor(?{Level}/10)+1))/-2*ceil((abs(?{Abi}-17)+?{Abi}-17)/16) [4th ]+5*(abs(floor(?{Level}/13)-1)-(floor(?{Level}/13)+1))/-2*ceil((abs(?{Abi}-19)+?{Abi}-19)/16) [5th ]+6*(abs(floor(?{Level}/16)-1)-(floor(?{Level}/16)+1))/-2*ceil((abs(?{Abi}-21)+?{Abi}-21)/16) [6th }}] ]] Roll label newlines used for clarity so be aware if you use this in a template you'd need to remove the template syntax {{ }}
1678165897
Gauss
Forum Champion
RainbowEncoder said: I'm sorry to inform you Gauss that you have an off-by-one error at level 8. 1+8+3 is 12 not 13. Easily fixed by swapping the 2*max(level-8,0) with max(level-7,0)+max(level-9,0). Oops, thanks for that. I thought I had them all right but oh well...an error crept in.