-
February 27th, 2022, 12:33 #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,
MBMRuleset and much more content built for FGU.
Come join me on Twitter at: https://twitter.com/MadBeardMan to see what I'm up to!
-
February 28th, 2022, 01:14 #2
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,564
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
-
February 28th, 2022, 01:23 #3
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,564
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
-
February 28th, 2022, 02:13 #4
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,564
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
-
February 28th, 2022, 04:12 #5
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,564
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
-
February 28th, 2022, 12:09 #6
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,
MBMRuleset 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