Eposic Archive: JavaScript Animated D6 Dice Roller, Part One

This page is in the Eposic Archive. Web pages in the Eposic Archive are possibly out of date and will not be maintained, but are being retained for historical purposes. Thank you for visiting Eposic!

Installing the JavaScript Animated D6 Dice Roller Code and Images

This and the following pages describe how to install the JavaScript Animated D6 Dice Roller code and images on your web site, how to set up a dice roller on your web page, and how to instruct the dice roller to send your visitors to particular pages on your site (or call specified JavaScript functions) depending on the result of the dice roll. The code only supports six-sided dice. If you're JavaScript-savvy, you can upgrade the code yourself to handle other dice types.

To start, download the zip file and unzip it. Upload all of the unzipped files to a directory on your web site.

Download the JavaScript Animated D6 Dice Roller

Legal Matters

CC0
To the extent possible under law, Michael K. Eidson has waived all copyright and related or neighboring rights to JavaScript Animated D6 Dice Roller. This work is published from: United States.

Previously, the code and dice images were available separately under different licenses. Now they have been combined into one zip file, titled the JavaScript Animated D6 Dice Roller, and are freely redistributable. If you have previously downloaded the Open Source dice roller code or images, you should download the public domain version to replace it, because the Open Source license no longer applies.

With the code and images now released to the public domain, this means anyone can make any use of the code and images, even modifying them mercilessly, without the need for attribution or worrying about whether it is compatible with another license, for commercial or non-commercial purposes. If you make modifications to the code or images, you don't have to share them with anyone. So have fun with it.

Note that even though the JavaScript Animated D6 Dice Roller code and images have been released to the public domain, that does not give anyone else the right to claim ownership or authorship of it. If you make mods to it, you can claim ownership and authorship only of those mods. You can't stop anyone else from making use of the original dice code and images that I'm releasing to the public domain. I'm still the original author, and that fact won't change, even though I can't require anyone to give me attribution. Just don't perjure yourself and say that you wrote it. If you want to give me attribution, that would be appreciated—you can either state my name (Michael K. Eidson, as is stated in the .js and .html files in the download) or link to my web site (http://eposic.org, also as stated in the .js and .html files in the download).

If you are concerned about the legalities of this to any degree, read the CC0 FAQ on the Creative Commons web site. Scroll down and pay special attention to the section labeled Questions for those thinking about using a CC0'd work. Click on the Public Domain image above to reach the full CC0 legal code.

You will find a link to the tutorial below. The link to the documentation is found at the end of the tutorial, or over in the left margin of this page. Note that while the dice roller code and images are freely redistributable, the tutorial and documentation here on the Eposic site are not, so please respect the copyright of the tutorial and documentation, linking to it if you will, rather than copying it and posting it elsewhere. Feel free to write original documentation for the classes in your own words and post that, if you want to post documentation.

Verifying Your Installation of the Code

Before you start using the code, check out your installation. A test page, testdice.html, is included in the zip file. You can run the test on my eposic.org server first, to see what it's supposed to look like. Then enter the URL for the test file on your web site in your browser, and see if you get a page that looks and behaves like the test page on my site. If you do, then all is installed correctly. To double check the installation, visit the URL for the combat1.html file on your web site and check out that simplistic combat system.

Some browsers might have a problem animating the dice images. So I make an allowance for the code to perform animation using either the gif images or ascii text. The test file is set up to use the gif images.

If you have problems with the test page, make sure that all of the contents of the zip file are uploaded to the same directory, as the test page assumes the images and the code are in the same directory as the test file. Since I am relinquishing rights to the code and images, I'm also making no guarantees or giving any warranties, so if it doesn't work for you, you'll just have to figure it out or seek assistance from your friendly neighborhood software developer.

Once you get the test page to load, you should see a 'Roll Dice' button. Click the button, and a couple of dice should animate and roll numbers. Keep clicking, and the dice will continue to roll different random numbers. When that happens, you know you've installed everything correctly.

Note: It may take a while for the images all to load the first time. After that, if your browser caches the images properly, it shouldn't take any time for the images to load on subsequent visits to the page. But it's because of this caching problem that I allow for plain ascii text to be used instead of images, if caching becomes a problem for you in any given dice roller project.

Once you get the test pages to load and the dice to roll, you're ready to create or modify your own web pages to make use of the newly installed code and images! When you're ready, proceed to Part Two: Creating Your First Dice Roller.

Part Two: Creating Your First Dice Roller -->

Eposic web dude Michael K. Eidson