inherit
224984
0
Sept 13, 2015 22:35:20 GMT -8
simashi
3
September 2015
simashi
|
Post by simashi on Sept 10, 2015 20:11:56 GMT -8
Is there a way to get the dice roller to handle numerous different sized dices at the same time? Like 1d4+1d6-5 for instance? In your language that's: N1dS1+N2dS2+F1 I could roll 1d9+1-5 for the above role but then I can't see the faces of the individual dices which is an issue.
Furthermore would it be possible to used more advanced syntaxes such as: (1d6+2)*((1d100-20)/1d20+30)? In your language: (N1dS1+F1)*((N2dS2-F2)/N3dS3+F3)
Edit: What about simple but longer syntaxes such as: N1dS1+F1-F2...+Fn ?
|
|
inherit
221400
0
Jul 3, 2016 18:52:30 GMT -8
Mother Starlight
4
May 2015
thedeepsky
|
Post by Mother Starlight on Sept 11, 2015 8:51:07 GMT -8
1d9+1-5 (or 1d9-4) has a different statistical distribution of outcomes than 1d4+1d6-5, so it's not an exact substitute.
You could roll the components separately, like 1d4 and 1d6 as two different rolls, and add them up yourself. But that's not as convenient.
|
|
inherit
224984
0
Sept 13, 2015 22:35:20 GMT -8
simashi
3
September 2015
simashi
|
Post by simashi on Sept 11, 2015 19:38:08 GMT -8
I'm not sure why 1d9-4 is different from 1d4+1d6-5 but I would rather not start a math debate about it. (See edit) It's possible to add the sum yourself but that's extremely inconvenient and not what I want as you would have to check all the time that you calculate correctly and you are bound to make mistakes and it will rapidly get harder at anything larger than 2 dices with 6 sides.
Edit: I just realized the pdf (probability density function) is different as you pointed out. The chance of getting 10 eyes on the set of two dices would be: 1/4*1/6=1/24?4% Getting 3 on the set of two dices can be done in two ways namely 1+2 or 2+1. The chance would thus be: (1/4*1/6)*2=1/24=(1/24)*2=2/24?8%.
On a 9 sided dice getting any eye number is always 1/9 assuming a perfect random generator is used.
|
|
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 Sept 13, 2015 9:08:12 GMT -8
simashi: What you're looking at is highly advanced behaviour and would almost certainly require the "rendering functions" feature of VDice Advanced. If you want your advanced roll to be previewable, the feature is unfortunately too much of a time commitment for me to tackle right now. If you don't require previewable rolls and you don't mind the usual placeholder for an advanced roll in the editor, I can provide you with a custom rendering function that will give you an idea of how to get a roll that would render into something that looked like e.g., The hitch is that you'd have to modify the rendering function to produce the specific "equation(s)" you require, using the example as a reference. If the number of dice equations you require is small (say, five or less), I could provide you with the code necessary to render these specific equations. You would just have to give me the roll syntax you wanted for each and an example of how you'd want the rolls to look. Otherwise, getting VDice to lay out dice into arbitrary equations is too big a request for me to handle right now. You'd need to write those rendering function(s) on your own.
|
|
inherit
224984
0
Sept 13, 2015 22:35:20 GMT -8
simashi
3
September 2015
simashi
|
Post by simashi on Sept 13, 2015 20:18:32 GMT -8
Thanks for the quick reply Virgil Sovereign! I'm wanting to make a play by post site so it's paramount that the rolls are previewable so that people can finish their post in the first go and don't have to go back and edit their posts all the time and cause confusion by sending notifications to people about their posts being completed when they might have just started but they needed to do a roll of some kind. It would probably also get annoying after a while I could imagine. That said I can see a few cases where that wouldn't be a problem like calculating how you did on a test might be a complex roll or your starting money etc. As I haven't created the rules yet it's not really a problem, it's just good to know my limitations and design the rules around said limitations. The complex syntax: (N 1dS 1+F 1)*((N 2dS 2-F 2)/N 3dS 3+F 3), is unsurprisingly hard to do code wise but let's say I'm okay with not previewing it because I will only use it for special occasions. Will my users then still be able to change the values of the ranges and constants used in the complex equation? Furthermore, in regards to the simple but longer format. Would it be possible to make the format N 1dS 1+F 1+F 2 previewable as it's rather simple in comparison and looks a lot like the VDice format?
|
|
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 Sept 15, 2015 13:57:41 GMT -8
simashi: What I can do is add a "parser" extension to VDice Advanced that will allow you to capture roll syntaxes and convert them to numeric values as you so desire using Javascript extensions, similar to rendering functions. For example, for the syntax you suggest, you would append a function such as function( roller, range, pre_range ) { // we only want to handle rolls flagged with 'simashi:' if( !/^simashi:/.test( pre_range ) ) return null;
// check if the range has valid syntax if( !/^(?:[\(\)\+\-\*\/]|\b[1-9]\d*d[1-9]\d*\b|\b\d+\b)+$/i.test( range ) ) return null;
// compute and substitute values for dice rolls var eval_range = range.replace( /\b[1-9]\d*d[1-9]\d*\b/gi, roller.evaluate ); var roll; // compute the roll try { roll = ~~eval( eval_range ); } catch( _ ) { // invalid syntax return null; }
// return the result return { value: roll, tooltip: 'Value: ' + eval_range + ' = ' + roll }; } to the VDA Javascript component. The function would accept a post-alias, post-preprocessing range syntax ( range), a post-alias, pre-preprocessing range syntax ( pre_range), and a roller object with various methods for stable pseudorandom number generation. It would return null if the syntax is illegal/unrecognized, or an object with properties value (numeric outcome of the roll) and tooltip (optional text to show when hovering over previewable rolls) if the syntax is recognized. The function in the example above would handle ranges such as (N 1dS 1+F 1)*((N 2dS 2-F 2)/N 3dS 3+F 3) and N 1dS 1+F 1-F 2...+F n. In the former case, a roll range such as simashi:(3d10+5)*((2d20-2)/1d10+1) might evaluate to 171 and show the previewable tooltip "Value: (14+5)*((26-2)/3+1) = 171". In the latter case, a roll range such as simashi:5d5+20-10+6+3 might evaluate to 32 and show the previewable tooltip: "Value: 13+20-10+6+3 = 32". You could additionally use the alias feature of VDA to customize the range syntax as much as desired. For example, you could set up the alias rule hit\((\d+),(\d+),(\d+)\) -to- simashi:($1d10+5)*(($2d20-2)/1d10+$3*5)and then your members could specify hit(3,5,5) as the range for a roll rather than having to type in simashi:(3d10+5)*((5d20-2)/1d10+5*5). If you wanted to be able to handle more complicated syntax, you could do so though a combination of parser extensions and aliases in VDA. I'm leery about adding any such functionality to VDA since it will bloat the plugin.
|
|
inherit
226480
0
Nov 19, 2015 18:48:39 GMT -8
sithlyone
9
November 2015
sithlyone
|
Post by sithlyone on Nov 5, 2015 18:33:24 GMT -8
Hello, I am in need of some assistance in setting up this plugin. To begin I am a noobie and I searched the first couple pages of this thread and realized I am in WAY over my head in trying to understand most of what is being said, let alone trying to figure it out to the point of implementing it.
So I hope that someone can assist me. Please remember that I only know how to cut and paste bbc code and I have a basic understanding of what the codes do. So when explaining can you please be specific. I know this will be a pain but I will be most appreciative!
Like others, I am attempting to make a PBP game for me and my friends. The dice being used will mostly be phrases like "Advantage" or "Success" and not numbers. However we will need a few numbered dice D20, D6, D8 to name a few. Now there are 6 "unique, non numbered" dice. 2 has 12 sides; 2 has 8 sides and 2 has 6 sides. The individual dice all have there own specific name and that is how they are reffered to in the game, not D6 or D8. More like I'll roll 2 Advantage dice or defending dice.
I need to know how to create all 6 of these unique dice, label each side of each dice and how to make them available for use in the forum.
I'm sure I am just not seeing the easy solution but thank you for any help you can offer.
|
|
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 Nov 6, 2015 1:01:01 GMT -8
sithlyone: If you fill out six tables such as the following (one table per die), I can quickly configure the VDice Advanced plugin for you: Die 1 (12-sided)Die Name (e.g. advantage): Outcome 1 Text: Outcome 2 Text: Outcome 3 Text: Outcome 4 Text: Outcome 5 Text: Outcome 6 Text: Outcome 7 Text: Outcome 8 Text: Outcome 9 Text: Outcome 10 Text: Outcome 11 Text: Outcome 12 Text: Indicate if you want certain outcomes to have special formatting, colour, etc. You can also specify the relative likelihood of each outcome occurring if you wish, or have duplicate outcomes.
|
|
inherit
226480
0
Nov 19, 2015 18:48:39 GMT -8
sithlyone
9
November 2015
sithlyone
|
Post by sithlyone on Nov 6, 2015 6:55:52 GMT -8
Thank you Virgil sovereign, here it goes. One edit, I was told there was only 6 dice but after further checking there are 7 dice, I will list them below.
Die 1 (8-sided) - Green colored dice
Die Name (ABILITY): Outcome 1 Text: DOUBLE SUCCESS Outcome 2 Text: SUCCESS Outcome 3 Text: BLANK Outcome 4 Text: ADVANTAGE Outcome 5 Text: SUCCESS Outcome 6 Text: DOUBLE ADVANTAGE Outcome 7 Text: ADVANTAGE Outcome 8 Text: ADVANTAGE & SUCCESS
Die 2 (12-sided) - Yellow colored dice
Die Name (PROFICIENT): Outcome 1 Text: SUCCESS & ADVANTAGE Outcome 2 Text: BLANK Outcome 3 Text: DOUBLE ADVANTAGE Outcome 4 Text: DOUBLE SUCCESS Outcome 5 Text: SUCCESS Outcome 6 Text: SUCCESS & ADVANTAGE Outcome 7 Text: SUCCESS Outcome 8 Text: SUCCESS & ADVANTAGE Outcome 9 Text: DOUBLE SUCCESS Outcome 10 Text: DOUBLE ADVANTAGE Outcome 11 Text: TRIUMPH Outcome 12 Text: ADVANTAGE
Die 3 (6-sided) - Blue colored dice
Die Name (BOOST): Outcome 1 Text: ADVANTAGE Outcome 2 Text: BLANK Outcome 3 Text: ADVANTAGE & SUCCESS Outcome 4 Text: BLANK Outcome 5 Text: DOUBLE ADVANTAGE Outcome 6 Text: SUCCESS
Die 4 (8-sided) - Purple colored dice
Die Name (DIFFICULT): Outcome 1 Text: FAILURE Outcome 2 Text: THREAT Outcome 3 Text: BLANK Outcome 4 Text: THREAT Outcome 5 Text: DOUBLE FAILURE Outcome 6 Text: THREAT Outcome 7 Text: DOUBLE THREAT Outcome 8 Text: THREAT
Die 5 (6-sided) - Black colored dice
Die Name (SETBACK): Outcome 1 Text: THREAT Outcome 2 Text: BLANK Outcome 3 Text: FAILURE Outcome 4 Text: BLANK Outcome 5 Text: FAILURE Outcome 6 Text: THREAT
Die 6 (12-sided) - Red colored dice
Die Name (CHALLENGE): Outcome 1 Text: THREAT Outcome 2 Text: FAILURE & THREAT Outcome 3 Text: DOUBLE THREAT Outcome 4 Text: DOUBLE FAILURE Outcome 5 Text: DESPAIR Outcome 6 Text: FAILURE Outcome 7 Text: THREAT Outcome 8 Text: BLANK Outcome 9 Text: DOUBLE FAILURE Outcome 10 Text: DOUBLE THREAT Outcome 11 Text: FAILURE & THREAT Outcome 12 Text: FAILURE
Die 7 (12-sided) - White colored dice
Die Name (FORCE): Outcome 1 Text: DARK SIDE Outcome 2 Text: LIGHT SIDE Outcome 3 Text: DARK SIDE Outcome 4 Text: LIGHT SIDE Outcome 5 Text: DARK SIDE Outcome 6 Text: DOUBLE LIGHT SIDE Outcome 7 Text: DARK SIDE Outcome 8 Text: DOUBLE LIGHT SIDE Outcome 9 Text: DARK SIDE Outcome 10 Text: DOUBLE LIGHT SIDE Outcome 11 Text: DARK SIDE Outcome 12 Text: DOUBLE DARK SIDE
I can also use: D100 D20 D8 D6 D3
Thank you so much for the assist, it means a lot!
|
|
inherit
226480
0
Nov 19, 2015 18:48:39 GMT -8
sithlyone
9
November 2015
sithlyone
|
Post by sithlyone on Nov 7, 2015 14:46:36 GMT -8
sithlyone: If you fill out six tables such as the following (one table per die), I can quickly configure the VDice Advanced plugin for you: Die 1 (12-sided)Die Name (e.g. advantage): Outcome 1 Text: Outcome 2 Text: Outcome 3 Text: Outcome 4 Text: Outcome 5 Text: Outcome 6 Text: Outcome 7 Text: Outcome 8 Text: Outcome 9 Text: Outcome 10 Text: Outcome 11 Text: Outcome 12 Text: Indicate if you want certain outcomes to have special formatting, colour, etc. You can also specify the relative likelihood of each outcome occurring if you wish, or have duplicate outcomes. Did I do it the way you need?
|
|
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 Nov 8, 2015 9:38:55 GMT -8
sithlyone: Yes, these are all the details I need. Give me a few details and I'll put together the plugin for you.
|
|
inherit
226480
0
Nov 19, 2015 18:48:39 GMT -8
sithlyone
9
November 2015
sithlyone
|
Post by sithlyone on Nov 16, 2015 19:43:17 GMT -8
sithlyone : Yes, these are all the details I need. Give me a few details and I'll put together the plugin for you. What other details do you need?
|
|
inherit
131886
0
May 17, 2020 17:10:22 GMT -8
cybersavant
3
October 2008
cybersavant
|
Post by cybersavant on Nov 20, 2015 22:38:24 GMT -8
I too am confused about vDice coding and i've tried searching for examples, etc. [though it's been a while since i did so]
currently when i click on dice in my boards it opens the dice, which defaults to [1-6], how do i code it for: a) to allow + or - after the die type? b) change the default to d20? c) allow for open ended rolling for RoleMaster, d100 where if you roll 96-00, you roll again and add the results ; or if you roll 1-5 then roll again and add in the negative direction [but the range isn't always 5%, depends on class and advantages/ disadvantages, etc]
for now we've been modifying the roll to 1-20 and then manually adding the results
for my M&M 3ed game we roll 3 d20 and take the middle result, or the result that ties on 2 or 3 dice i.e. drop the lowest and highest rolls, taking the middle
i've installed both vDice and vDice advanced
thanks for any pointers or coding i can cut & paste
|
|
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 Nov 21, 2015 2:20:40 GMT -8
sithlyone : Yes, these are all the details I need. Give me a few details and I'll put together the plugin for you. What other details do you need? Sorry. I meant "Give me a few days and I'll put together the plugin for you." I'll get it done tomorrow.
|
|
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 Nov 22, 2015 11:18:15 GMT -8
sithlyone : As promised, I've put together a special version of VDice Advanced implementing the specification in your post from Nov 6, 2015. Installation steps:- download the plugin here: VDA - Star Wars Die Pack.pbp (13.16 KB)
- if you don't already have VDice or VDice Standard Die Edition installed, install them. Make sure that "Dynamic Range" is enabled, under the "Range" tab.
- remove any existing versions of VDice Advanced installed on your board
- install the downloaded plugin on your board
The plugin shouldn't require any additional configuration. It defines six new rolls: ability, proficient, boost, difficult, setback, challenge, force. To roll one of these dice, enter its name into the "range" box when inserting a die, or else simply type the tag into the editor manually, e.g., [roll=ability] or [roll range="ability"]. The dice are rendered using CSS. The plugin is editable, hence feel free to customize the styles by editing the style sheet in the plugin "Build" interface. A preview of what they should look like is: Let me know if you have any problems. Otherwise, may the force be with you.
|
|