[ Post Response ] [ Return to Index ] [ Read Prev Msg ] [ Read Next Msg ]

BGonline.org Forums

XG/XG2 and External Random Number Generators (random.org etc)

Posted By: Michael Petch
Date: Monday, 16 April 2012, at 5:18 p.m.

One question I get asked a lot about XG is whether there is a way to use random.org or other random number generator with XG/XG2. The Answer is actually yes, although it isn't completely obvious. This is documented under XG's help in the section "External Dice".

The section describes the mechanism by which a programmer can create a new source of randomness for dice rolls during match play, however there are a few example ones installed with XG, one of which is numbers from random.org.

To do this, go to the "Options" menu, "Settings" menu, "Main Settings" tab. At the bottom there is "External Dice Generator". Click on the radio button to select it. You must now select a DLL. TO the right of the DLL box there is a "..." (or a folder with green arrow) button. Click that. XG generally displays the directory it is installed into. In the short list of files is a folder called "dice dll". Double click it. There are a few entries but one should see "randomorg.dll". Double click to choose it. Click "Apply" button and then "Ok".

If for some reason there is a failure in the external random number generator (It isn't available or returns values that aren't between 1 and 6) it will pop up a box when there is an error warning you, and then it reverts back to the internal dice generator. If that happens you have to go back and select the external dice source again as described above.

There are two other samples. One is dicelib.dll and it uses the Borland random number generator (Not recommended), and an implementation of Mersenne Twister (mt199937.dll).

If you are a programmer, source code for the examples can be found in the same directory and help on the programmers API is available in XG's online help under "External Dice" as well.

 

Post Response

Your Name:
Your E-Mail Address:
Subject:
Message:

If necessary, enter your password below:

Password:

 

 

[ Post Response ] [ Return to Index ] [ Read Prev Msg ] [ Read Next Msg ]

BGonline.org Forums is maintained by Stick with WebBBS 5.12.