inherit
168679
0
Nov 18, 2012 17:03:07 GMT -8
Virgil Sovereign
Latet anguis in herba.
686
July 2011
syonidv
|
Post by Virgil Sovereign on Feb 5, 2013 5:50:49 GMT -8
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 Permissions: Editable Keys Used: None Extensions: | VDice Compatibility v1.0.0 Release - Visit Proboards Plugin Library to Download
| If you require support for [dice] tags inserted using the Dice Rolls in Posts v1.1 Proboards v4.5+ hack by ⓦ৹₪deⓡ , install this plugin. Its location in the plugin list is unimportant. Requires VDice (or VDice SDE) v1.0.4+.
|
VDice Advanced v1.1.5 Release - Visit Proboards Plugin Library to Download
| This plugin comes with its own UI and adds support for custom roll syntax, aliases (simpler rolls), sophisticated graphics look-ups, HTML templates, and more. A must-have for advanced users who want total control over their dice. Its location in the plugin list is unimportant. Requires VDice (or VDice SDE) v1.1.1+. Documentation for this plugin is viewable here.
|
|
Description: | 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:
- customizable range, with the option of allowing the user to customize the range
- numerous range syntaxes representing rolls of multiple dice, rolls with added offsets, etc.
- customizable images for any or all roll outcomes
- customizable tag name
- customizable editor button, tooltip, and an option to remove the editor button entirely
- customizable placeholder graphics for the post editor, and the ability to use tags in both editor modes
- customizable limits on the maximum number of (non-quoted) dice allowed per post
- options to show range and render as box graphics
- special tweaks to override image dimensions
- fully customizable style sheet for fine tuning of dice appearance and behaviour
- extensively documented options in the configuration UI
- as of version 1.0.4, support for [dice] tags inserted using the Dice Rolls in Posts v1.1 Proboards v4.5+ hack by ⓦ৹₪deⓡ when extended using VDice Compatibility
- as of version 1.0.5, full control over graphic resources, HTML templates, and custom roll syntax when extended using VDice Advanced
- as of version 1.1.0, the option for previewable dice
- as of version 1.1.1, support for aliases (which can simplify tags considerably)
- as of version 1.1.3, optional support for dice in private conversations
|
VDice: | 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.
See screenshots. |
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.
See screenshots. |
Previewable Rolls: | 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.
See screenshots. |
Range Syntax: | 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:
- [roll range="range"]
- [roll=range]
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:
Syntax | Description | Added in... | Example(s) | low-high
| rolls a single die with face values between low and high inclusive | 1.0.0 | 10-20 1-6
| dS
| rolls a single die with S faces valued from 1 to S; the roll is followed* by = total, where total is the face value of the die
| 1.0.3
| d6 d100
| NdS
| rolls N dice, where each die has S faces valued from 1 to S; the roll is followed* by = total, where total is the sum of all face values of the dice
| 1.0.3
| 3d6 5d2
| S+F
| rolls a single die with S faces valued from 1 to S; the roll is followed* by + F = total, where F is a positive offset, and where total is the sum of the face value of the die and F; if F is zero (0), this syntax is identical to dS
| 1.0.1
| 5+5 60+25
| NdS+F
| rolls N dice, where each die has S faces valued from 1 to S; the roll is followed* by + F = total, where F is a positive offset, and where total is the sum of all face values of the dice and F; if F is zero (0), this syntax is identical to NdS
| 1.0.1
| 4d6+2 5d20+20
| NdS-F
| rolls N dice, where each die has S faces valued from 1 to S; the roll is followed* by - F = total, where F is a positive offset, and where total is the sum of all face values of the dice minus F**; if F is zero (0), this syntax is identical to NdS
| 1.0.1
| 4d6-2 5d21-5
|
*This can be suppressed using the 'nosum' tweak. **Note that the total can go negative if F > N.
|
Weighted Rolls: | 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 range2,2,2,1,1,1+10 adds 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-2 subtracts 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.
|
Roll Aliases: | 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: | 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.
|
Screenshots: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.2Update 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
|
|
|
arek
New Member
Posts: 72
inherit
183874
0
Feb 15, 2014 20:16:38 GMT -8
arek
72
October 2012
arek
|
Post by arek on Feb 5, 2013 13:42:26 GMT -8
I like this, but I'd like to see die rollsets generated from a single [roll] tag, and such a tag to also generate a total if multiple dice and/or a modifier are specified. Here's how I think such a tag would look in use:
[roll range=(dice)d(sides)(+/-)(modifier)] eg. [roll range=2d6+4]
This would produce the die output of (dice) [roll range=1-(sides)] tags side-by-side, then add up the resulting dice and the modifier and print out " (sign) (modifier) = (total)" after the dice.
You could also support this by adding dice= and modifier= paramaters, but you'd still have to parse the modifier to get the output to look right with a negative modifier (2d6-4 should look like [roll][roll] - 4 = (total) not [roll][roll] + -4 = (total), for example. This method, however, would be more cumbersome to use than supporting the standard die notation most modern PnP/PbP RPGs now use. Note that there is no need to support multiplication and division since the only use I've ever seen for those is to make things easier when rolling real dice at a real table (10d8 or 1d3 anyone?).
|
|
inherit
168679
0
Nov 18, 2012 17:03:07 GMT -8
Virgil Sovereign
Latet anguis in herba.
686
July 2011
syonidv
|
Post by Virgil Sovereign on Feb 5, 2013 18:38:01 GMT -8
arek, I've updated the plugin to v1.0.1 with support for your suggested syntax. See OP.
|
|
inherit
185886
0
Aug 18, 2016 9:55:33 GMT -8
Silver
94
November 2012
flamingjada
|
Post by Silver on Feb 6, 2013 10:20:03 GMT -8
I dowloanded the plug in and it's not working
|
|
inherit
168679
0
Nov 18, 2012 17:03:07 GMT -8
Virgil Sovereign
Latet anguis in herba.
686
July 2011
syonidv
|
Post by Virgil Sovereign on Feb 6, 2013 10:55:25 GMT -8
You'll have to give me a link to your site, Silver.
|
|
inherit
185886
0
Aug 18, 2016 9:55:33 GMT -8
Silver
94
November 2012
flamingjada
|
Post by Silver on Feb 6, 2013 12:34:34 GMT -8
|
|
inherit
168679
0
Nov 18, 2012 17:03:07 GMT -8
Virgil Sovereign
Latet anguis in herba.
686
July 2011
syonidv
|
Post by Virgil Sovereign on Feb 6, 2013 20:23:11 GMT -8
Silver: I created an account to test VDice on your board. There was a silent (non-fatal) error occurring on some pages, which I've fixed in v1.0.2, now linked-to above. The main problem with the plugin on your site, however, seems to be that the image resources it's referring to (e.g. 'dice2', 'dice5') aren't included with the plugin. This might be because you downloaded the 'bare' version of the plugin, or because you deleted the images out of the list. In either case, remove the existing plugin, download VDice 1.0.2 Standard Die Edition, re-enter your settings and the problem should be resolved.
|
|
arek
New Member
Posts: 72
inherit
183874
0
Feb 15, 2014 20:16:38 GMT -8
arek
72
October 2012
arek
|
Post by arek on Feb 7, 2013 23:27:54 GMT -8
Hey, great job getting NdB+O working, that's a great improvement :-) I did notice one thing, tho: NdB (without the +O part) doesn't work in 1.0.2, So I made a slight modification to VDice ( VDice Standard Die Edition-arek.pbp (118.81 KB)) to add support for that. This is something I'd like to see integrated into the main plugin. :-) Now, I have a couple of other requests, one minor and one a bit more complicated: First, I'd like to have the roller not add " + 0" to the output when O = 0 (either by using something like 1d6+0 or just 1d6 for range). IMO that just looks awkward. :-) I did try to do this myself, but only succeeded in breaking the output completely. Second, I'd like it if the plugin supported image sets instead of the current result-based image support. This could be done by using 4 variables: - A "Maximum result", which This determines the maximum allowable result for a particular image set. If the result (or better still, if possible, the maximum possible result) of a particular die is higher than this, this set won't be used, even if its use is manually specified in the tag (using imageset=name in the tag, if you decide to support that). This is to prevent broken images (for example, if I use an imageset that supports 1-100, and someone does [roll range="101-150"]). If this field is left blank (or set to 0), the plugin should assume that this set can be used for any result (which is actually possible if you have an online image generator hosted somewhere to do it with)
- A "Set Name", which is the name of the dice set for VDice to use internally. It could also be used to support an imageset parameter in the tag (i.e. [roll range="1d6" imageset="default"]) if you wanted to do that.
- An "image template", which is the template for the actual links to use. Ideally this should simply use a placeholder for the result (%R, for example) in a standard url or image resource, basically meaning that for any result X, dice%R.png would expand to diceX.png
- A "use this imageset by default" variable. If this is specified on one or more imagesets, the imageset with the lowest non-zero/non-blank "maximum result" that's no less than the maximum result of any single die in the roll should be used (for example, if I roll 3d6, and have imagesets with maximum values of 4, 6, 10, and a "blank" set, the "6" set should be used). If this isn't possible, then the plugin should simply use the first imageset in the list that has this checked.
I know this second request is a rather large one, but I also think it makes sense given that, at least currently, there may not be any way to support images for percintile dice (result=1-100) in VDice, depending on how many entries proboards allows in a single autoform. I do understand, however, if image sets would make the plugin more complicated than it needs to be.
--Arek
|
|
inherit
185886
0
Aug 18, 2016 9:55:33 GMT -8
Silver
94
November 2012
flamingjada
|
Post by Silver on Feb 8, 2013 11:12:50 GMT -8
ok ty
|
|
inherit
168679
0
Nov 18, 2012 17:03:07 GMT -8
Virgil Sovereign
Latet anguis in herba.
686
July 2011
syonidv
|
Post by Virgil Sovereign on Feb 8, 2013 13:34:39 GMT -8
Hey, great job getting NdB+O working, that's a great improvement :-) I did notice one thing, tho: NdB (without the +O part) doesn't work in 1.0.2, So I made a slight modification to VDice () to add support for that. This is something I'd like to see integrated into the main plugin. :-) Now, I have a couple of other requests, one minor and one a bit more complicated: First, I'd like to have the roller not add " + 0" to the output when O = 0 (either by using something like 1d6+0 or just 1d6 for range). IMO that just looks awkward. :-) I did try to do this myself, but only succeeded in breaking the output completely. Second, I'd like it if the plugin supported image sets instead of the current result-based image support. This could be done by using 4 variables: - A "Maximum result", which This determines the maximum allowable result for a particular image set. If the result (or better still, if possible, the maximum possible result) of a particular die is higher than this, this set won't be used, even if its use is manually specified in the tag (using imageset=name in the tag, if you decide to support that). This is to prevent broken images (for example, if I use an imageset that supports 1-100, and someone does [roll range="101-150"]). If this field is left blank (or set to 0), the plugin should assume that this set can be used for any result (which is actually possible if you have an online image generator hosted somewhere to do it with)
- A "Set Name", which is the name of the dice set for VDice to use internally. It could also be used to support an imageset parameter in the tag (i.e. [roll range="1d6" imageset="default"]) if you wanted to do that.
- An "image template", which is the template for the actual links to use. Ideally this should simply use a placeholder for the result (%R, for example) in a standard url or image resource, basically meaning that for any result X, dice%R.png would expand to diceX.png
- A "use this imageset by default" variable. If this is specified on one or more imagesets, the imageset with the lowest non-zero/non-blank "maximum result" that's no less than the maximum result of any single die in the roll should be used (for example, if I roll 3d6, and have imagesets with maximum values of 4, 6, 10, and a "blank" set, the "6" set should be used). If this isn't possible, then the plugin should simply use the first imageset in the list that has this checked.
I know this second request is a rather large one, but I also think it makes sense given that, at least currently, there may not be any way to support images for percintile dice (result=1-100) in VDice, depending on how many entries proboards allows in a single autoform. I do understand, however, if image sets would make the plugin more complicated than it needs to be.
--Arek
*lol* What you're talking about sounds almost like style sheets for dice. Firstly, I can add the dB and NdB syntaxes. I'll do so this coming Sunday.
As for image sets, how about the following? I can add a tab to the configuration called ADVANCED GRAPHICS, and it would immediately warn users not to touch it unless they wanted some ridiculously sophisticated dice. The input would be a form-type input with three fields per record as follows: Pattern
| Condition
| Resource
| ... | ...
| ...
|
Pattern would be a regular expression (hopefully you're familiar with these) for the range parameter(s) you're looking to target, condition would be a set of conditions to check on the tokens captured by pattern, if any, and resource would be a graphic resource to use if both the pattern and condition matched. The plugin would scan down the list, checking each record until it found one where both the pattern and condition matched, and would apply the resource associated with the first match. In addition to the variables $1, $2, ... representing the regex tokens, pattern and condition would also have access to the token $R, which would evaluate to the dice roll outcome. So for example, you might set out a list of rules as follows: Pattern
| Condition
| Resource
| (?:\d+)?d2
|
| coinflip$R
| (?:\d+)?d(\d+) | $1 <= 6
| my$1sided$R
| (?:\d+)?d(\d+)
| $1 <= 20
| my20sided$R
| (\d+)\-(\d+)
| $1 >= 100 && $2 <= 200 && $R < 150
| someurl/bigdice_blue_$R.png
| (\d+)\-(\d+)
| $1 >= 100 && $2 <= 200
| someurl/bigdice_red_$R.png
| .+
|
| defaultdice$R
|
Given this, in order, the plugin will: - check for a range of the form Nd2 or simply d2, and if it finds either, will use the graphic resource coinflip1 (for a 1 outcome) and coinflip2 (for a 2 outcome)
- if no match is yet found, check for a range of the form NdB or dB, where B, the first (and only) captured token is less than or equal to 6, and if these conditions are met, use the resources myBsided1, myBsided2, ..., etc. For example, my5sided1, my5sided2, ..., etc. if B (the maximum roll) is 5, or resources my6sided1, my6sided2, ..., etc. if B is 6, etc.
- if no match is yet found, check for a range of the form NdB or dB, where B, the first (and only) captured token is less than or equal to 20 (and is implicitly known to be > 6), and if these conditions are met, use the resources my20sided1, my20sided2, ..., etc.
- if no match is yet found, check for a range of the form A-B, where A and B are between 100 and 200, and the roll outcome is less than 150; if these conditions are met, use the URL resources someurl/bigdice_blue_100.png, someurl/bigdice_blue_101.png, ..., etc.
- if no match is yet found, check for a range of the form A-B, where A and B are between 100 and 200 (and the roll outcome is implicitly known to be >= 150); if these conditions are met, use the URL resources someurl/bigdice_red_150.png, someurl/bigdice_red_151.png, ..., etc.
- if no match is yet found, check for anything, and default to using defaultdice1, defaultdice2, ..., etc.
In this way, the plugin should be able to handle any arbitrarily complex set of resource rules, requiring only a bit of familiarity with regular expression syntax. (An invaluable tool for that is found here.)
If the above makes sense to you, it is not a terribly difficult matter to build it in. And if worst comes to worst, admins could post specs in this thread and any friendly developer that does understand the above could provide them with the necessary form data. If you need something even more advanced than this, my recommendation is to just edit the plugin source code. Finally:I don't like the idea of adding extra attributes to the [roll] tag. What I can tell you is this, however: any characters besides - digits
- a lowercase 'd' either preceded by a digit, followed by a digit, or both
- the + and - characters
are wiped out of the range before it is interpreted. Hence, 3WALLAWALLAd6:BING+10BANG is interpreted as 3d6+10 by the plugin. This means that you can reasonably invent your roll own syntax to be captured by the regular expressions in ADVANCED GRAPHICS.
For example, suppose we add in an extra first rule
Pattern
| Condition
| Resource
| red:.+ |
| bigreddice$R
|
This pattern matches any roll range of the form red:XYZ, where XYZ is anything. Since 'red:' is wiped out by the range interpreter, you're left with XYZ, but at the same time, you'll have matched pattern, and will be using an 'overridden' resource. Thus, a tag of the form: [roll range="red:d6"] would use bigreddice1, bigreddice2, ..., etc. as resources. In this way, you can create your own syntax for forcing specific image sets if and when you want to allow that. You can even mix and match to allow specific ranges of specific image sets. Best of all, if you don't like the syntax imageset:range, you can change it to whatever you do like.
|
|
arek
New Member
Posts: 72
inherit
183874
0
Feb 15, 2014 20:16:38 GMT -8
arek
72
October 2012
arek
|
Post by arek on Feb 9, 2013 3:54:05 GMT -8
Implementing it with regular expressions like that is a great idea, especially given that a regex to parse the imageset from imageset:range is very simple, and using regexes to parse ranges for default imagesets isn't much harder. I like that. :-)
Yes, my request seems kinda like "style sheets for dice" as you say, but on PbP RPG boards, you often need the ability to roll the following dice: d4, d6, d8, d10, d12, d20, and d100, with a few rare calls for coinflips and/or d3 rolls. If you want your virtual dice to look authentic, each of those die types really needs its own image set. Of course, you could use a generic imageset, but you still need to support at least 100 results (for d100, often called d% or "percentile dice"), which is not trivial with the current plugin setup.
Thanks for considering this. :-)
--Arek
|
|
inherit
10867
0
Jun 12, 2014 9:15:04 GMT -8
Dan
109
July 2003
dan4848
|
Post by Dan on Feb 9, 2013 12:26:22 GMT -8
Hi, first of all thanks for the code, it seems to be working pretty well and I appreciate the amount of flexibility you've allowed for. I have a few questions/requests/possible bugs, however: (if you'd like to see for yourself what I'm talking about, our forum is here: ntwriters.freemessageboards.com ) 1. It seems that in the visual/BBCode editor, the dice button gets covered up by the button that was added by the Spoiler Tags plugin that Todge posted. If I move my mouse slowly, I can see that there is a small area where the dice button shows up, so it appears that it's just an issue of two plugins placing their button in the same spot. Can this be fixed so they are side by side? 2. Some members would appreciate being able to see the roll result before posting, as their roll determines the character they roleplay with in that same post. Is there a way to allow for this, while still protecting against the obvious possibility of cheating/rerolling for other dice uses? 3. This is a big one, that I'm not sure is even remotely possible. XD Basically, in v4.5 we've been using a dice code ( support.proboards.com/thread/70421) extensively, and have many posts that are now broken in v5, with a huge string of randomized number code in a lot of old posts (see this thread for some examples: ntwriters.freemessageboards.com/thread/35830/roll-yer-dice?page=1). This is not supported in this plugin, but is there any possible way to get those dice rolls to work again, with the same results? I'm sorry if this is a really stupid question--coding is by no means my strong suit. XD; But many of our members were hoping this would be doable, though we can live without it if it's just not a possibility. 4. Is it necessary for the tag to be [roll range="1-6"]? That seems kind of a hassle to type in every time. The old code I mentioned above simply used [dice=6] for a six sided die (though the low range always started at one, so I do understand why you allowed for more flexibility in the range in this plugin). Is it possible that the tag could be shortened in any way? Thanks again for the plugin and I hope these questions can be answered (and that I'm not totally off-base with my requests XD).
|
|
inherit
168679
0
Nov 18, 2012 17:03:07 GMT -8
Virgil Sovereign
Latet anguis in herba.
686
July 2011
syonidv
|
Post by Virgil Sovereign on Feb 10, 2013 5:32:33 GMT -8
Dan: 1. Since the 'Spoiler Tags' plugin isn't editable , I've put together an alternative spoiler plugin here. It will address the compatibility issue. 2. There are 'ways' of doing what you suggest, but I'd need a specific proposal. For example, does the admin check a box in the configuration settings that causes dice in the WYSIWYG editor to appear with actual roll values all the time versus never? Do we define separate tags, such as [roll] for 'hidden' dice, and [rollnow] for visible dice? How do we prevent a user from inserting five roll tags, then deleting all but the best one? And if a single roll tag represents five dice, what do we do if the user clicks in between dice #2 and #3 in the WYSIWYG editor and types something in? The only reasonable option I can think of would be to optionally allow a second tag, [rollnow] being the default, identical to [roll] but with the property that if a user moused over the WYSIWYG placeholder, the roll outcome would pop up in a tooltip (e.g. "Dice will Roll 15"). And perhaps the style sheet would include some editable factor that would cause [rollnow]s to appear slightly different from [roll]s in threads so that (if desired) users and admins would know which rolls had their outcomes pre-known. If this is good enough for you, I can put it in. Otherwise I'd need a more concrete proposal about how to make it happen. 3. I'll look into it today, or whenever I get finished with the upgrades from my Feb 8, 2013 at 4:34pm post. 4. You have a point, and it's a trivial matter to support both syntaxes. I'll put in support for the [roll=range] syntax. The shortest you'll get though is [roll=d6], or (equivalently) [roll=1-6].
|
|
Entris
Junior Member
Posts: 281
inherit
158702
0
Dec 31, 2014 9:05:29 GMT -8
Entris
281
September 2010
entris
|
Post by Entris on Feb 10, 2013 8:17:52 GMT -8
Sweet, had this one on the old board but that code didn't work so removed it but now i can restore it again A question though, the old version it was possible to cheat by the preview window and editing the post (can't really remember exactly how it was done because after we found it out we stopped using it in a serious matter and just had some fun with it) is there a way to prevent this in this version?
|
|
inherit
10867
0
Jun 12, 2014 9:15:04 GMT -8
Dan
109
July 2003
dan4848
|
Post by Dan on Feb 10, 2013 9:59:03 GMT -8
Virgil Sovereign, I took a look at your Spoiler alternative, and it looks quite good. However, when I tried to upload it for some reason it was giving me an older version of Todge's plugin? Perhaps I'm missing something. XD (Also, since I'm already writing a response here, is there a functionality for creating our own spoiler titles? That was a big reason for our use of Todge's, and I didn't see any mention of it in the thread.) Secondly, I think your proposal would work well, but I will have to ask some of my members if there's a particular way they were hoping it'd work. In the v4.5 code they simply used the Preview button, but since that's no longer an option it does make things a little more difficult for this feature. I'll get back to you soon hopefully. Thanks very much for taking a look at making the old code compatible and changing the syntax. That syntax will work very well, I think. I appreciate your patience and cooperation!
|
|