-
July 14th, 2020, 20:11 #1
Surely there is something to covert "cr" (challenge rating) from text to number?
I can't seem to find anything in LUA (maybe I'm stupid) or Fantasy grounds code to convert a challenge rating to a number. The text fractions of 1/8, 1/4, and 1/2 will simply not convert with tonumber() and I can't believe I'm going to have to do direct comparisons to the text values. Surely there is a basic, real, true, conversion from text fractions to decimal numbers?
Yes, I know how I could write my own - but surely I don't have to, right?Free(Forums/Forge) Extension(FGU 5E):
Paid (Forge) Extension(FGU 5E):
-
July 14th, 2020, 20:36 #2
5e does have sortNPCCRValues in the data_library_5E.lua that converts the fraction text to numbers. Might need to be tweaked for your use. And there is also calcBattleCR in manager_combat2.lua which again might need some tweaking for your use.
Dominic Morta
Ruleset Developer
Smiteworks
How to zip up your campaign if the Developers ask for it-How to zip up your campaign if the Developers ask for it
How to provide an Unity Connection issue?-Connection Issues and What to Provide
Unity Updater issue?-Updater Issues
Classic and Unity Port Forwarding?-Fantasy Grounds Connections Explained
Comcast or Cox ISP User?-Comcast XFinity and Cox Users
Have a suggestion?-Feature Request
-
July 14th, 2020, 20:53 #3
Yeah, had seen the manger_combat2.lua one - it was doing some kind of proficiency thing and also does not handle fractions.
Well, I've done it brute force - turn it to number but if 1/8, 1/4, or 1/2 I override that number (0) to be 0.125, 0.25, or 0.5. Life goes on I supposeFree(Forums/Forge) Extension(FGU 5E):
Paid (Forge) Extension(FGU 5E):
-
July 15th, 2020, 05:00 #4
Yup sometimes have to make the tool we need. Good luck with your project.
Dominic Morta
Ruleset Developer
Smiteworks
How to zip up your campaign if the Developers ask for it-How to zip up your campaign if the Developers ask for it
How to provide an Unity Connection issue?-Connection Issues and What to Provide
Unity Updater issue?-Updater Issues
Classic and Unity Port Forwarding?-Fantasy Grounds Connections Explained
Comcast or Cox ISP User?-Comcast XFinity and Cox Users
Have a suggestion?-Feature Request
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks