DICE PACKS BUNDLE
  1. #1

    Bug with 'convertStringToDice' as part of 2022-02 Ruleset Updates

    Hi JPG etc,

    I can see you've refactored the function 'convertStringToDice' and this has broken damage/heal rolls in Traveller.

    Traveller dice are 'D6' or '2DD' meaning 2d6/2d6*10. When the data is built I do create is as 2D6, or 2DD. In LIVE everything is working as expected, but in TEST it no longer functions. I have found a work around and that's to convert the dice string to lowercase before passing it.

    But, if I don't get my other changes completed, if this goes live before then players will have the issue.

    Can this be fixed in CoreRPG please.

    Cheers,
    MBM
    Ruleset and much more content built for FGU.
    Come join me on Twitter at: https://twitter.com/MadBeardMan to see what I'm up to!

  2. #2
    I can't change it back, because the calculation code in the client already required a lower case 'd' to be the first character of any die asset and I moved the CoreRPG code to match. I'm working towards them working together.

    We'll have to get those minor code changes checked into MGT ruleset(s).

    Regards,
    JPG

  3. #3
    Alternatively, we could add a script like this to MGT1 and MGT2:

    <script name="StringManagerTraveller" file="manager_string_traveller.lua" />

    Code:
    local _oldConvertStringToDice;
    function onInit()
        _oldConvertStringToDice = DiceManager.convertStringToDice;
        DiceManager.convertStringToDice = newConvertStringToDice;
    end
    
    function newConvertStringToDice(s)
        s = s:lower();
        _oldConvertStringToDice(s);
    end

  4. #4
    Or even better, add a custom function for those fields (char_weapon.lua, damage_action.lua, npcs_weapons.lua, spacecraft_weapons.lua (x2)):

    <script name="StringManagerTraveller" file="manager_string_traveller.lua" />

    Code:
    function convertDamageStringToDice(s)
    	s = s:lower();
    	if s:match("dd") then
    		s = s:gsub("dd", "d6")
    	end
    	if not s:match("d6") then
    		s = s:gsub("d", "d6")
    	end
    	return StringManager.convertStringToDice(s);
    end

  5. #5
    I committed the last suggested change to SVN and the Test/beta channel for MGT2 ruleset.

    Can you check to see if the damage is working correctly again?

    Regards,
    JPG

  6. #6
    Quote Originally Posted by Moon Wizard View Post
    I committed the last suggested change to SVN and the Test/beta channel for MGT2 ruleset.

    Can you check to see if the damage is working correctly again?

    Regards,
    JPG
    Hi Chap,

    I'll give it a test tonight. I had already gone and lowercase() everything to get it working. As I've been adding the automation for damage effects so needed it working asap.

    But I like what you've done, so let's give it a whirl.

    Thanks for the quick and detailed series of replies!

    Cheers,
    MBM
    Ruleset and much more content built for FGU.
    Come join me on Twitter at: https://twitter.com/MadBeardMan to see what I'm up to!

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
  •  
5E Product Walkthrough Playlist

Log in

Log in