VDice - Dice Rolling for Proboards v5 Feb 5, 2013 5:50:49 GMT -8 Peter, Chris, and 14 more like this
Post by Virgil Sovereign on Feb 5, 2013 5:50:49 GMT -8
|VDice v1.1.6 |
Author: Virgil Sovereign
Plugin: VDice v1.1.6 Release - Visit Proboards Plugin Library to Download
Plugin: VDice (Standard Die Edition) v1.1.6 Release - Visit Proboards Plugin Library to Download
Keys Used: None
|VDice Compatibility v1.0.0 Release - Visit Proboards Plugin Library to Download|
VDice Advanced v1.1.5 Release - Visit Proboards Plugin Library to Download
|Adds the ability to roll dice on your board.|
The default configuration adds a button to the post editor (and if present, the augmented Quick Reply) that inserts a [roll] tag in BBCode mode and dice placeholder in Preview mode that converts to randomly-rolled dice when viewed outside the editor.
Rolled dice are quote-safe and edit-safe. Quoting posts that contain dice or modifying posts that contain them will not modify the value of the dice.
The plugin supports a broad range of configurable options in its configuration section, including:
|The 'bare bones' version of the plugin includes no graphic resources besides the default editor buttons, and is minimally preconfigured. If image resources are needed, they can be specified via URL, or imported into the plugin's 'Images' tab (under the plugin build interface) and then referenced via their resource names.|
VDice (standard die edition):
|The standard die edition of the plugin includes a set of royalty-free dice graphics representing a standard six-sided die (see screenshots). As of version 1.0.3, this will provide a working six-sided die with no configuration required.|
|As of version 1.1.0, VDice supports inserting 'previewable' rolls whose values can be previewed by the user in the 'Preview' mode of the editor. The plugin can be configured to allow only 'normal' rolls, only previewable rolls, or both. Previewable rolls can have their own editor button, or be specified as an option in the 'Insert Die' dialog, or require the user to manually type in a special BBCode tag. Previewable rolls may also use different graphics from normal rolls when viewed in the editor and in threads.|
Like normal rolls, previewable rolls are extremely difficult to 'cherry pick'. They do not change value when edited, they cannot be replaced, and they will generate the same values until the user actually posts dice. Administrators should be aware that users can still 'cherry pick' rolls by posting multiple times (creating multiple posts) and deleting all posts except the one with the most desirable outcome. Generally speaking, it is impossible for a plugin to prevent this kind of attack.
|Numerous syntaxes for roll tags and roll ranges are supported. A range is a short code that defines: i) the number of dice used in a roll, ii) the number of faces on each die and values showing on those faces, and iii) an offset to add to add to the sum of die/dice values. Advanced users can also use the range syntax to control which images or resources are used to represent the dice.|
When dynamic ranges aren't being used (that is, if you configure the plugin so that users aren't able to enter their own ranges), the [roll] tag appears as simply [roll] (or the alternative tag name specified in TWEAKS) in UBBC mode.
When dynamic ranges are used, as of version 1.0.3 both tag syntaxes are supported:
where range specifies the range of the roll.
In all cases the plugin ignores whitespace and quotes, hence [roll = "range" ] is the same as [roll range=range] is the same as [roll=range].
Supported syntaxes for the range are:
*This can be suppressed using the 'nosum' tweak.
**Note that the total can go negative if F > N.
|As of version 1.1.1, VDice supports two range syntaxes for weighted rolls (rolls where you can specify an exact set of outcomes and the relative likelihood of each outcome).|
The first (and simplest) syntax is a list of comma-separated natural numbers, such as 2,2,2,1,1,1. The numbers represent the weights of the outcomes 1, 2, 3, ... up to the number of weights in the list. Each weight represents the relative likelihood that an outcome will be randomly selected. An outcome with a weight of 2 will be selected twice as often as an outcome with a weight of 1, etc. In the example shown, the outcomes 1, 2 and 3 are twice as likely as the outcomes 4, 5, and 6.
Weights can also be zero. For example, the range 0,0,0,0,1,0,2 will turn up as 5 one third of the time, and as 7 two thirds of the time. No other outcomes are possible.
The second syntax is a comma-separated list of ranges and their associated weights. Each range is specified in the format low-highwweight. For example, the range 3-8w2 means that the outcomes 3 to 8 inclusive will all have a weight of 2.
The set of all possible outcomes (and their weights) is determined from the union of all ranges. For example, the range 1-3w2,4-6w1 gives the outcomes 1, 2, and 3 a weight of 2, and the outcomes 4, 5, and 6 a weight of 1, identical to 2,2,2,1,1,1. If two or more ranges overlap, the weights for any of the overlapping outcomes are summed. For example, the range 10-12w5,11-13w10 includes the outcomes 11 and 12 once with weight 5 and a second time with weight 10. Thus, these two outcomes will have a weight of 15. The outcome 10 will have a weight of 5, and the outcome 13 will have a weight of 10. No other outcome is possible.
Finally, it is worth noting that for singleton ranges such as 5-5w3 that include only one number, the syntax valuewweight is also supported. For example, the range 1-25w1,50w2,100w1 will roll a number between 1 and 25 roughly 90% of the time, but may roll a bonus (50) 7% of the time, and a super bonus (100) 3% of the time.
As of v1.15, weighted ranges with offsets are also supported. As with standard ranges, offsets are specified by appending a plus (+) or minus (-) sign to the end of the range, followed by the offset. For example the range
2,2,2,1,1,1+10adds 10 to the outcome of weighted roll 2,2,2,1,1,1, producing outcomes 11 (22%), 12 (22%), 13 (22%), 14 (11%), 15 (11%) and 16 (11%). The range
1w30,3w70-2subtracts 2 from the outcome of weighted roll 1w30,3w70, producing an outcome of -1 30% of the time, and an outcome of 1 70% of the time.
Offsets are mainly useful for showing users that a base value is being added to a random roll component.
|As of version 1.1.1, VDice supports roll aliases. Aliases are special codes you can define to represent bulky or complicated ranges. For example, you might associate the alias magic with the range 1d20+6. Users on your boards will then be able to use a tag such as [roll=magic] rather than the uglier-looking [roll=1d20+6].|
Aliases are especially useful for weighted rolls or multi-dice rolls, so that users don't have to remember complicated syntaxes. You might define a complicated weighted roll for an attack, such as 0,0,1,2,7,15,4,1,0,0,0,1, and then associate it to the alias attack. Users rolling a die to calculate an attack can then insert a roll with the range attack, or simply type [roll=attack] into the editor.
Aliases are currently configured in the VDice Advanced extension plugin (downloadable above). Documentation for aliases is viewable here.
|Exploits are behaviours that can be potentially used to "cheat" dice values. VDice prevents many of these behaviours, and optionally prevents others if certain tweaks are present in the plugin configuration. A complete discussion of exploits is found here.|
Fig. 1 - An editor button allows for simple insertion of a die in both editor modes. Visual mode is shown here, with the 'blank' resource included in the Standard Die Edition being used as the placeholder graphic.
Incidentally, don't be alarmed by the lack of a smiley button. We have a custom smiley system on my home board.
Fig. 2 - The editor is shown in BBCode mode, where dice appear as [roll] tags. Tag names are customizable.
Fig. 3 - The plugin can be configured to allow dynamic rolls. The user can customize roll range using [roll range="·"] tags, or by using a dialog with the standard look and feel.
Fig. 4 - If no special images are specified, dice are rendered as boxes according to the look and feel parameters in the plugin style sheet. This figure shows the default L&F, with the 'showrange' tweak enabled to show the dice range.
Fig. 5 - The same dice are shown rendered with images. In this case, the images are those included with the Standard Die Edition, with a width of 82 pixels. You can modify all plugin settings except the RANGE settings at any time without any adverse effects to existing dice rolls.
Fig. 6 - The GRAPHICS tab of the plugin configuration UI is shown. Despite Proboards' best attempts to prevent readable documentation (by allowing no formatting and ignoring ALL whitespace in their text widgets), the interface is documented with reasonable legibility.
Fig. 7 - Previewable rolls display their outcome in the editor. Previewable rolls are represented by separate tags and may be inserted using a separate editor button if desired. The graphics shown here are the defaults for VDice SDE.
Fig. 8 - When viewed in threads, previewable rolls can be specially formatted to show they were previewed. The default formatting for VDice SDE is shown here.
Bugs and Feedback:
|Please notify me of any problems you may have in this thread and I will do my best to resolve any issues promptly.|
I may also consider certain feature requests if they are reasonable and won't bulk up the code too much.
Aside from that, happy rolling!
Update to v1.0.1
|- Added support for S+F, NdS+F, and NdS-F range syntaxes.|
Update to v1.0.2
|- Fixed a silent error occurring on certain pages.|
- Fixed an error where dice may not function when inserted in 'Create Thread' forms.
Update to v1.0.3
|- Added support for 'short' [roll=range] syntax and 'shortsyntax' tweak.|
- Added ADVANCED GRAPHICS tab to configuration UI.
- Added default configuration to VDice Standard Die Edition.
- Added support for NdS and dS range syntaxes.
- Updated UI documentation.
Update to v1.0.4
|- Added support for sister plugin 'VDice Compatibility'.|
Update to v1.0.5
|- Exported advanced graphic settings to sister plugin 'VDice Advanced'.|
- New random number generator. Old one wasn't 'random enough' in certain circumstances.
- Numerous small bug fixes.
- Smarter template selection based on roll parameters.
Update to v1.0.6
|- Fixed issue where a blank range parameter wasn't being treated as a default 1-6 range.|
Update to v1.0.7
|- Fixed bug where dice weren't appearing in IE browsers.|
Update to v1.1.0
|- Added previewable dice.|
- Overhauled plugin configuration UI significantly.
- Numerous bug fixes.
Update to v1.1.1
|- Minor bug fixes.|
- Added support for weighted roll syntaxes.
Update to v1.1.2
|- Minor bug fixes.|
Update to v1.1.3
|- Added protection against various exploits.|
- Added support for dice in private conversations.
Update to v1.1.4
|- Significant improvements to random number generation.|
- Fixed bug where 1dN+O syntax was using the incorrect roll template for non-zero offset.
- Fixed bug preventing guest users from posting.
Update to v1.1.5
|- added support for weighted roll +/- offset range syntax|
- updated help link and internal documentation
Update to v1.1.6
|- fixed bug where dice values appeared inconsistent across different browsers|