Die Roll

Version 1.3

DieRoll & DieRollPod

Basic die roll applications for RPGs with basic scripting. Support for local networking also present.

Requirement: iOS 7 & MacOS 10.8 (10.10 required for networking).

Sections

OS X

Main Screen

Left Sliders : number of dice. Range is 1 to 20.

Right Sliders : number of times XdY is rolled. Range is 1 to 20.

Popup menu : list of standard dice types.

Roll : dice are rolled N times and the results outputted. If N is not one, a line feed will be added.

Roll & Total : dice are rolled N times. If N is greater than one, a '+' will be inserted between each dice roll and a '=' sign will be inserted before the total. And a line feed will be added.

Import : user chooses a script to add to their collection. The script is COPIED and placed in a private directory. If you make changes to the script, it will have to be imported again. (Future addition : automatic import directory).

Execute : execute the currently selected script. If there is no script, 'Could not execute script' will be outputted. If there are script errors, various messages may appear.

Group : open group settings window (see below).

Send to : show connections window (see below).

Script... : opens the sheet below.

Script Sheet

The popup is a list of available scripts.

Delete : deletes the script from the private directory. This is not reversible.

Export : copies the script to any place the users chooses.

Group Settings

Group Window

How networking works

An individual DieRoll application is either the Master or it isn't (a Player). The Master is the one who advertises itself for others to join. The master decides who can join. Once an individual joins, they will be added to all those currently in the group. Currently, you cannot kick individual members. If you D/C, you kick all. Other players automatically connect to any master nearby. The master either accepts or rejects you.

Do Not Group : if this is checked, you cannot join any new groups and cannot invite anyone else. If you are in an existing group, you will stay in it. But if you disconnect for any reason, you cannot reconnect until you turn off 'Do Not Group'.

If you change your Master status or change your name, you will be automatically disconnected from the current group. You name can only consist of alpha-numeric characters plus the underscore (_) and hyphen (-). Try to keep it short, it will be chopped at 7-8 characters.

The colour is how others will identify you at a glance. When you send a result to or receive a result from others, your name will be prepended and coloured.

This window is not visible on OS 10.8 or 10.9.

Group Send

Group Send

This window lists all currently connected players. The top is always yourself. The green button on top is a toggle button and the alternate colour is red. If the button is red, your results are not sent to others and only added to your own output. If the button is green, your results are only sent to other players you have selected (each button is a toggle button). If you have not selected yourself, you will not see your own result.

D/C disconnects you from the current group.

This window is not visible on OS 10.8 or 10.9.

Top

iOS

iPad

iPad Main Screen

Not so obvious

iPhone/iPod

iPod Main Screen

Not so obvious

Group Send

Strip of buttons along the bottom.

The red square toggles to green.

The remaining buttons are players in your group. The first button is always yourself.

If it is red, rolls and scripts function like always : the results can shown on your output view.

If it is green, the results are only sent to those who are selected. If you don't select yourself, you won't see your own roll/script execution. (See below).

Double tapping the red button will disconnect you from the current group.

Save Screen

iPod Save Screen iPod Script Screen

Not so obvious

iPod Dice Type

Group Settings

iPad Group Settings iPod Group Settings

How networking works

An individual DieRoll application is either the Master or it isn't (a Player).

The Master is the one who advertises itself for others to join. The master decides who can join.

Once an individual joins, they will be added to all those currently in the group.

Currently, you cannot kick individual members. If you D/C, you kick all.

Other players automatically connect to any master nearby. The master either accepts or rejects you.

Do Not Group : if this is checked, you cannot join any new groups and cannot invite anyone else.

If you are in an existing group, you will stay in it. But if you disconnect for any reason, you cannot reconnect until you turn off Do Not Group.

If you change your Master status or change your name, you will be automatically disconnected from the current group. You name can only consist of alpha-numeric characters plus the underscore (_) and hyphen (-). Try to keep it short, it will be chopped at 7-8 characters.

The colour is how others will identify you at a glance. When you send a result to or receive a result from others, your name will be prepended and coloured.

Top

Die Roll Scripts

Die roll scripting is the ability to generate output consisting of text & scripted rolls to display.

DR (Die Roll) scripts are divided into 3 parts :

Dice Definitions

DD (dice definition) is in the form of either 'XdY±Z' or 'XdYdropZ'.

X is the number of dice.

Y is the dice type.

Z is a integer modifier.

drop is drop the lowest N dice rolls.

If the DD is non-sensical, it will be ignored.

In the script itself, '#' is used instead of the word 'drop'.

Format

<name> : <DD>

<name> must start with a _ . And can only contain alphanumeric characters & the _ character. The name is considered to be all characters before the colon. Duplicates are not allowed. Subsequent duplicates will be ignored. The colon is required. DD cannot reference other DDs.

DD Errors

If X or Y < 0

If X,Y or Z are not integers

X±Z

Any characters not in this set : 0123456789dD+-#

XdY±Z

If X or Y is 0, then roll result will be Z.

dY±Z

X is implied to be 1.

±Z

Result will be Z.

XdY#Z

If Z >= X, then roll result will be 0.

Roll Definitions

Rolls are simple mathematical equations where DDs & other RD (Roll Definitions) can be operands.

Example below bests illustrates usage.

#dicedef
_1_:4d6#1
_hp_:1d8

#rolls
Str_Roll=_1_
Dex_Roll=_1_
Con_Roll=_1_
Int_Roll=_1_
Wis_Roll=_1_
Cha_Roll=_1_
Stat_Total=Str_Roll+Dex_Roll+Con_Roll+Int_Roll+Wis_Roll+Cha_Roll
Con_Mod=(Con_Roll-10)/2
HP=_hp_^10+Con_Mod*10

DD _1_ is 4d6 drop 1. Commonly used in D&D for stat generation. Str_Roll is the result of DD _1_ being rolled. Same applies to Dex_Roll, Con_Roll, etc.
Stat_Total is the total of all ability score rolls (Str, Dex, ...). Con_Mod is the constitution score modifier.
HP is Con_Mod the total HPs (for a Cleric for example) of level 10.

Operators allowed are ( ) + - / * ^.
( & ) must be balanced. Otherwise the RD will be ignored.
/ : division. Fractions are always rounded down.
Division by zero will result in the RD calculation being aborted.
^ : this is not 'to the power of'. It is 'roll DD N times'. If the LH operand is not a DD, it is treated as multiplication instead.
e.g. _hp_^10 is equivalent to 10d8. But Con_Roll^10 is result of Con_Roll times 10.
(_hp_+Con_Mod)^10 is not the same as _hp_^10+Con_Mod*10.

User input

You can now use the sliders as input values. They are treated as special dice definitions. There names are '_sliderTL' (top-left), '_sliderTR' (top-right), '_sliderBL' (bottom-left) & '_sliderBR' (bottom-right).

Format

<name>=<equation>

<name> must not start with a _ . Only alphanumeric characters & the _ character is allowed.
Duplicates are not allowed. Subsequent duplicates will be ignored.
Name is considered to be all characters before the = sign.
= sign is required.

Script Definitions

Scripts are simply a string of words/sentences/paragraphs with RD tokens intermingled inside. Everything not a token is outputted verbatim. The only character not allowed for general use is the @ character. It is used as a RD delimiter.

Example

#script
Str: @Str_Roll@ Dex:@Dex_Roll@ Con:@Con_Roll@ Int:@Int_Roll@ Wis:@Wis_Roll@ Cha:@Cha_Roll@
Stat average = @Stat_Avg@
HP = @HP@

RD name are bracketed by @...@ characters.
The @ @ must be balanced. Otherwise the script will not be executed.
If the name is not defined, it is ignored.
An output of this could look like:
Str: 10 Dex:12 Con:12 Int:15 Wis:10 Cha:16 Stat average = 12 HP = 53

Script File

Maximum number of lines is 2000.
First line must be #drscript.

The parser will look for a line containing 'name='. This is the name the die roll application will show to users to ID the script. The script names are case sensitive. If no name is found, the parser will construct one based on the file name. This line must occur before any of the definitions markers below. It will be ignored otherwise.

Definition sections are marked by #dicedef, #rolls & #script. The case and spelling is important. And they must be on their own line. You can use them in any order but have these details in mind:

Top

Android

Version 1.0

Important. Android version has less features than the Apple versions. There is no network capability (may be implemented in a future version). There is no scripting support. And "Saving" the output is limited to Copy.

Android Tablet Screen Android Small Screen

Not so obvious
Blue Block - Clears the history.
Green Block - Copies the history to the clipboard.
The results pane can't be edited except on the tablet.

Top