STAR TREK 2d20
Page 2 of 7 First 1234 ... Last
  1. #11
    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.

  2. #12
    Quote Originally Posted by Weissrolf View Post
    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.
    Is the updated version posted in the download link?

  3. #13
    Nah, I am not the original author and still testing and working on the modification.

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

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

  5. #15
    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.

  6. #16

  7. #17
    Of course, stupid me included the folder. Thank you for the hint!

    Here is the modified extension.

    Removed by request.
    Last edited by Weissrolf; February 15th, 2021 at 07:48.

  8. #18
    Quote Originally Posted by Weissrolf View Post
    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.

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

  9. #19
    Curiously Instant Dice turns off /die chat command animation in Classic, but not in Unity.

  10. #20
    Thx for your work Weissrolf :-)

    It is quite cool that the animation is off for hidden rolls in the dice tower too.

    Cheers Drantos

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