Roller 1.0
Java Dice Rolling Program
Developed by Roger Tawa
Rogerta@microsoft.comCopyright © 1998 Roger Tawa
This software is provided freely and "AS IS". The roller-1.0.zip archive may be distributed freely, as long as it is not modified in any way. You shall not modify, decompile, disassemble, decrypt, extract, or otherwise reverse engineer the software. I (ROGER TAWA) MAKE NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. I SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY USERS AS A RESULT OF USING OR DISTRIBUTING THIS SOFTWARE.
Introduction
Roller is yet another dice rolling program for role playing games like Dungeons and Dragons. Roller's features include:
Figure 1 below shows the Roller window, as it appears running on a Win32 system.
Installation
To correctly install Roller, the following steps must be completed successfully.
Install Java Runtime Environment
If you already have a correctly installed JRE 1.1.5 or JDK 1.1.5, then you can go to the next step. If not, point your browser to http://www.javasoft.com/products/ jdk/1.1/jre/index.html and follow the instructions.
Install Java Foundation Classes
If you already have a correctly installed JFC 1.1 (or Swing 1.0.1), then you can go to the next step. If not, point your browser to http://www.javasoft.com/products/jfc/index.html and follow the instructions. In either case, make sure you have the file swingall.jar.
Unzip roller-1.0.zip
You can unzip this archive in any directory. The archive contains the following files:
You only need one of the last three files, depending on your system. You can delete the others if you like. On Unix systems, you should add the directory that contains these files to your path. On Win32 systems, you should create a shortcut to rollerw.exe in your start menu or on your desktop.
Install swingall.jar file
Copy the swingall.jar file from your JFC installation to the same directory that contains roller.jar.
That's it. There are no Roller-specific environment variables that need to be set or any configuration files that need to be modified. The only restriction is this: If you ever want to move Roller to another directory, all the files must remain together.
Roller was developed using JDK 1.1.5 and JFC 1.1 on a Windows/NT 4.0 system with Service Pack 3 installed. I have only been able to test it with this configuration, but given Java’s write-once-run-anywhere philosophy, this program should run on any system that supports JRE 1.1.2 or later. If you have any problems, send me some mail and I’ll try to help you out.
Note that the JRE and JFC are not bundled with Roller because they are extremely large, and would increase download times more than 70x. For those that already have JRE and JFC installed, this would be extremely inconvenient. For those that do not already have JRE and JFC installed, you end up downloading just as much stuff with separate downloads anyway. At least this is a one-time cost since you will not need to download them again to run other Java programs.
User’s Guide
The roller window is divided into three areas (see figure 2) each of which is described in detail below.
Result Area
The Result area shows the dice currently being rolled and the value of the last roll. The text field at the top of the result area (called the Spec field) serves two purposes:
The large button at the bottom of the result area (called the Value button) shows the last value rolled. Press the Value button to roll the same dice again.
Accumulator Area
The Accumulator area contains one button for each die in the standard dice set. Use these buttons to quickly roll any of the standard dice. Pressing a button updates the Spec field to show the die being rolled and updates the Value button with a new roll.
This area is called the Accumulator area because the buttons can also be used to increase or decrease the cardinality of the dice currently being rolled. If the control key is held down when a button is pressed, and the die of the button matches that of the dice currently being rolled, the cardinality of the dice is increased by one, the Spec field is updated, and the Value button is updated with a new roll.
If the control and shift keys are held down when a button is pressed, and the die of the button matches that of the dice currently being rolled, the cardinality of the dice is decreased by one, the Spec field is updated, and the Value button is updated with a new roll. The cardinality cannot be decreased below 1.
Preset Area
The preset area contains named dice specifications set by the user. Presets are useful when you often find yourself rolling a specific dice specification such as "2d4-1" and you don’t want to keep typing it in. Roller does not define any presets as shipped, so this area is initially empty.
To create a new preset, enter the dice specification in the Spec field, and then select the "Create Preset" item from the "File" menu. This opens a dialog box where you can enter a name for you preset. After entering the name and pressing the OK button, a new button is created in the preset area with the name you chose. Pressing this new button causes the Spec field to update with preset’s dice specification and the Value button to update with a new roll.
To delete a preset, press the button once and press the Delete key.
Note: On occasion, after creating or deleting a preset, the contents of the window become messed up. If this happens, simply resize the window (even just a little) and the window redraws itself correctly.
Presets are remembered when you exit Roller so that they are again available the next time you run the program. The presets are saved in a file called dice_presets in the directory that contains the program.
Keyboard Navigation
It is possible to use most of Roller’s functions without touching the mouse. The exceptions are creating new dice presets and exiting. This is based on the concept of "focus", where only one button or text field in the window can have it at any given time. You move the focus from button to button to text field by pressing the Tab or shift-Tab keys. The button with focus usually has a different border than all the other buttons. If the text field has the focus, its cursor is visible and usually blinks.
When a button has focus, pressing the space bar does the same thing as pressing the button with the mouse.
Dice Specifications
A dice specification is a description of the dice that you want to roll. For example, if you want to roll a 6-sided die 3 times adding the individual rolls together, the dice specification would be "3d6". If you want to roll a 4-sided die twice and subtract 1 from the sum, the dice specification would be "2d4-1". This notation should be quite familiar to anyone that plays role-playing games.
In the following paragraphs, dice specifications will be written enclosed in double quotes, but keep in mind that the quotes are not part of the specification and should not be typed into the Spec field.
A dice specification contains 3 parts in the following order: the cardinality (or number) of dice to be rolled; which die is to be rolled; and a constant modifier that is added to or subtracted from the sum of the individual rolls. All parts are optional and may contain spaces.
The cardinality is a positive number. The cardinality may not be zero. If omitted, 1 is assumed.
The die is specified as the letter ‘d’ (upper and lower case are allowed) followed by a positive number. The number may not be zero, but it is does not need to be one of the standard dice. For example, "d37" is allowed. If the die is omitted, "d8" is assumed.
Finally, the modifier is a plus (+) or minus (-) sign followed by a positive number that is either added to or subtracted from the sum of the individual rolls, respectively. The number may be zero, although this would not be too useful. If the modifier is omitted, none is applied.
The following are examples of valid dice specifications:
"1d6" "2D4" "d100+20" " d 12" "1 D64 - 8"
The following are examples of invalid dice specifications:
"-1d6" "1d" "2.3d20" "d1.0" "0d6"
"d0" "abc"
An interesting consequence of the fact that all parts of a dice specification are optional is that all of the following dice specifications are valid and equivalent:
"1d8+0" "1d8" "d8+0" "d8" "1+0" "1"
"1d8-0" "1-0" "d8-0" "+0" "-0" ""
Typing an invalid dice specification produces undetermined results. Try not to do this if you can.