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

{SCRIPT HELP] LazyExperience Rounding

Hello, script wizards! I have had a recurring problem with Robin Kuiper's Lazy Experience not triggering the charactermancer properly.  Firstly, when XP is divided, any decimal portion automatically triggers the level+ mancer, even if characters have not reached the next milestone. Is there any way of rounding the allotted xp to prevent this? Secondly, it does not seem to update the XP threshold when characters level up, so I have to go in and manually update it on each of their sheets. Are there easy answers to these problems?  I know I have seen a couple posts along the way that mentioned these problems, but I can't seem to find them now. Thanks!
1610420115

Edited 1610420222
Oosh
Sheet Author
API Scripter
It looks like the 5e sheet is ignoring the decimal point completely and seeing 33000.5 as 330005 - it has this problem in a few places, like item mods, leading to errors. It just grabs all the integers it can find and ignores everything else. The easiest fix would be a manual install (which it might already be, not sure) and changing line 223 so it's rounded: attributes[state[state_name].config.experience_attribute_name] = Math.round (new_experience); Change that to Math.floor or Math.ceil as you see fit, obviously. I'm not sure I follow your second issue. Which XP threshold do you need to update? I wasn't aware of any value apart from the total XP on the sheet, and I've never used the script.
Thanks, Oosh. I think the problem has already been solved before it was put in one-click repository, and I had a lingering issue from when I was running the manual install several months ago. Either way, getting rid of the decimal solved the problem.