Die Roller

dierollerstill

Simulates 2, 4, 6, 8, 10, 12, and 20-sided dice in quantities up to 99 with special features for ease of use.

The Multi-Die Simulator program (play with it here) is designed to generate pseudo-random numbers based on different polyhedrons (differently-sided dice). It is capable of simulating a bi- (two sided), tetra- (four sided), hexa- (six sided), octa- (eight sided), deca- (ten sided), dodeca- (twelve sided), and icosa- (twenty sided) -hedron (solid figure) in any amount from one to ninety-nine.

The user may also select from a number of additional options that analyze the data generated by the program for ease of viewing. The user has the option to have the program show the numbers that were generated, as well as how many of those numbers are marked as a “success” according to a preset statistical average — a number that the user can change if so desired. The user can also have the program count high rolls as double successes to reflect the lower probability of rolling perfect. Furthermore, the program can automatically deduct successes for any occurrence of a 1, also known as a botch, and even if the program is not penalizing for every botch, it will report them in the absence of any successes; on the other hand, if the user does not wish to have the program report their successes, botches will not be reported either.

Design Notes:

Variables Movie Clip:
The Variables Movie Clip is a hidden element that handles all variables used in the application. Every piece of script that calls or changes a variable passes that information to and from this element. This may seem like a lot of extra work when I could just contain the variables to their respective scopes, but I do it this way to keep all the variables in one place so no matter where I am in the multiple levels of the application while coding, I know exactly where to find my variables.

Active Die Movie Clip:
The Active Die Movie Clip uses two horizontal arrows to control die selection. Using the left and right arrows, the time line advances appropriately, and each key frame then sets the variable “activeDie” in the variables movie clip… This application is capable is simulating D2, D4, D6, D8, D10, D12, and D20 only.

Die Pool Movie Clip:
The Die Pool Movie Clip uses four vertical arrows to control two number dials. Using the up and down arrows found to the left and the right of the dials, those dials are incremented appropriately, and each key frame sets their individual variables (“onesPlace” for the left dial, “tensPlace” for the right dial) in the variables movie clip; then the variables movie clip uses those numbers to calculate the two-digit variable “diePool” by simply adding the two-digit ten’s place variable to the single-digit one’s place variable every time the variables movie clip cycles through it’s only frame… This application allows die pools from 1-99 only.

The Roll Button:
When pressed, this button runs the script that generates the pseudo-random numbers based on the user’s input. After initializing each variable, it runs a complex series of what are called “if…then” statements to analyze and capture the necessary data. It also uses what is called a “for…while” loop to actually generate the numbers.

Known Bugs:

The number crawlers are a little glitchy if you’re fast with the mouse click. It you hit the arrows too fast, the numbers and the dial animation will fall temporarily out of sync. Further more, if you’re -REALLY- fast on the mouse, the entire dial will just twitch instead of move, so slow down a bit and take your time ~_~ Not sure how to fix that one.

When the program displays the dice you rolled, if you rolled an excessive amount, the readout will break the right side of the text field. You can see all of the rolls if you highlight and drag, but it’s best to disclude showing the dice on high volume rolls. If I find the time and motivation, I’ll go back and make the text wrap to the window and add a scroll bar so you can view all the data.

If you’d like to know more about the program and how it works, or if you find a bug with it, please feel free to leave a comment for us. We always love feedback ^^

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.