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

Custom Derived Attribute in Bar2 Not Updating, SpellPoints Bar [5E OGL]

November 16 (6 years ago)

Sorry if this is in the wrong place, and if I should post this in another forum I'd appreciate any direction.


I wanted to set up a 'Spell Point' bar on my token to give my party a general idea of how my character's spell slots were looking.

I created a custom Attribute I called SpellPoints and set the left box to be a weighted amount of spell points the character has. Basically the spell level * the number of slots of that level plus the same for all other levels. That was easy enough, and it resolves correctly. It looks like


Current Slots Remaining

(@{lvl1_slots_expended}*1+@{lvl2_slots_expended}*2+@{lvl3_slots_expended}*3+@{lvl4_slots_expended}*4+@{lvl5_slots_expended}*5+@{lvl6_slots_expended}*6+@{lvl7_slots_expended}*7+@{lvl8_slots_expended}*8+@{lvl9_slots_expended}*9)

Maximum Slots

(@{lvl1_slots_total}*1+@{lvl2_slots_total}*2+@{lvl3_slots_total}*3+@{lvl4_slots_total}*4+@{lvl5_slots_total}*5+@{lvl6_slots_total}*6+@{lvl7_slots_total}*7+@{lvl8_slots_total}*8+@{lvl9_slots_total}*9)


For a level 5 spell caster this resolves correctly to 4*1 + 3*2 + 2*3 = 16 in both cases at max spells. If I then edit the token and set bar2 to SpellPoints as defined above then it resolves, and shows a bar at 16/16. A full bar. Awesome!


If you then start expending spells by reducing the available count on the spell sheet however the bar stays at 16/16 and doesn't updat. So I go to check and see if something is wrong, and go to attributes, I check the text and no, the text is the same. I click out of the textbox under Attributes and instantly the Bar2 visual updates. It isn't clear if entering and exiting the Attribute is causing the attribute to update which then allows the bar to update, or if the attribute is updating but the bar isn't so I did another experiment. I changed the spells, and then unlinked the attribute, and relinked it causing the text in the token for bar 2 to refill from blank. It pulled the old attribute value, which means that the problem seems to be that setting an attribute to be a result of other attributes does not update unless you have something calling that value.


So I then tried moving the function into the other_resource attribute, which has a visual space, and therefore should be called if the sheet is open. Same exact problem, except the sheet didn't even try to display the values where other_resource is located on the sheet.

How can I make this attribute update in real time? I think the bar is working, it just isn't getting up to date information. I don't want to edit the bar directly as the whole point of this system was that it would account for a character leveling up, and would be manageable from the spells sheet.

I've enclosed it in brackets, I've tried a leading equal sign, I've tried including each discrete step of the math in parentheses. All of them resolve cleanly to the correct numbers at the time of resolution, but after that, no updates.


Any help would be appreciated. Would love to know what I'm doing wrong here, or if there is a workaround.

November 21 (6 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

Hi Dimglow, sorry for the late reply. I saw this issue this morning and have asked around a bit. The upshot is that custom attributes don’t automatically update. I've been told it’s why the PF 1e sheet has a special page for custom attributes so that sheet workers trigger on them. I don't think there's a workaround on this, as it's less a bug than the lack of a feature.

Because of this, I'm going to move your thread into Specific Use Questions and Macros. With luck, you're more likely to find suggestions from other users to achieve the effect you are looking for in some other way. Of course, I'll move it back if you prefer.