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

EasyExpierence bug

I am having a problem with EasyExpierence 1.12 5e by Roll20, Firefox, no extensions. Lately I have not been able to use it because it doesn’t keep track of experience point correctly. It appears that instead of adding point to the total it sometimes concatenates them thus giving a he number of points. Example: if I collect 50 points from a creature and then later collect 50 points from a second creature It should add 50 to the total fir a sum of 100 points but sometimes it concatenates the 50 and adds 5050 points to the total. This makes it impossible to use as intended. I will speculate that this is somehow due to the lack of strong data types in Javascript but I don't know. This especially happens after restarting the API. Thank you. Normal 0 false false false EN-US X-NONE X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin-top:0in; mso-para-margin-right:0in; mso-para-margin-bottom:8.0pt; mso-para-margin-left:0in; line-height:107%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri",sans-serif; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;}
1636748628
The Aaron
Roll20 Production Team
API Scripter
You're basically right there.  Adding a <string> + <number> converts the <number> to a string and concatenates.  What needs to happen is the script should treat all input sources as if they are strings and force a conversion to a number before doing arithmetic on it. 
1636777225
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Thanks for the report KoS. This is a bug that I have thought I've fixed about 5 times now. I'll see if I can finally stamp it out for good this weekend.
Thanks Scott C. I'll be looking for it.
1636854622

Edited 1636854696
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Should have an update for this out in time for the next merge. In other news, looking back at your old code is scary! I think I'm gonna have to add a more general refactor of EE to my to do list once this bug is finally squashed.
1636911482
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Fix for this issue has been submitted to the Github repo. There's some larger issues with the script that I'm going to try to find time to address with a full refactor, but this should get it working in the meantime. If you need the updated code before the next merge, you can find it here .
Scott, I am a retired software engineer, don't write code any more. I do have this advice for anyone writing code: Put in lots of comments because there is nothing worse than the code you wrote some time ago and the comments help you regain that train of thought. Thank you for your indulgence.
1636913708
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Hah, that is something I learned later. Easy Experience was like the second script I ever wrote. Looking back at it 5 years later is terrifying and makes me realize how far I've come, and likely how far I have to go.
" What was I thinking?"
1636935100
Andreas J.
Forum Champion
Sheet Author
Translator
" Was I thinking?"
Andreas J. said: " Was I thinking?" Perhaps not.