5E Character Create Playlist
  1. #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):

  2. #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

  3. #3
    Quote Originally Posted by superteddy57 View Post
    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.
    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 suppose
    Free(Forums/Forge) Extension(FGU 5E):
    Paid (Forge) Extension(FGU 5E):

  4. #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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
DICE PACKS BUNDLE

Log in

Log in