Seems like I made it work. Instead of issuing a new math.randomseed with every roll I did so only during initialization of the extension. This at least leads to different rolling results every time FGU is restarted.
Printable View
Seems like I made it work. Instead of issuing a new math.randomseed with every roll I did so only during initialization of the extension. This at least leads to different rolling results every time FGU is restarted.
Nah, I am not the original author and still testing and working on the modification.
Here is how to fix this. Just replace the following function (textblock) with my modification. This adds a seed that should work on Windows, Linux and OS X and discards the first three random numbers to get better results on early rolls.
I am working on getting a Multiply-with-carry random generator working with this instead of the default math.random (same as /die). Since I lack LUA coding experience and the LUA engine in FGU is somewhat limited this may or may not work out.Code:function onInit()
ActionsManager.roll = roll_override;
--ActionsManager.onDiceLanded = onDiceLanded_override;
actionDrop_old = ActionsManager.actionDrop;
ActionsManager.actionDrop = actionDrop_override
registerOptions_dice()
math.randomseed( tonumber(tostring(os.time()):reverse():sub(1,6)) )
math.random() math.random () math.random ()
end
I would love to upload a modified extension file, but I cannot find out what kind of ZIP files FGU expects? Neither Windows Sendto nor 7z ZIP Deflate seem to work.
Windows Send To - but dont include the parent folder - just the contents.
Of course, stupid me included the folder. Thank you for the hint! :)
Here is the modified extension.
Removed by request.
This may explain the issue with math.randomseed used within LUA: https://stackoverflow.com/questions/35455489/difference-between-math-random-and-math-randomseed-in-lua
Curiously Instant Dice turns off /die chat command animation in Classic, but not in Unity.
Thx for your work Weissrolf :-)
It is quite cool that the animation is off for hidden rolls in the dice tower too.
Cheers Drantos