Library Token: Dice Box
Moderators: dorpond, trevor, Azhrei, giliath, Gamerdude, jay, Mr.Ice
Re: Library Token: Dice Box
A user discovered a significant (as in, "sonovabitch!") bug: when you selected the "each die" option, d6's were being evaluated as d4's.
I've fixed it, and the new version is available here:
Requires MapTool 1.3.b66
http://www.houseofgenius.com/files/mtfw ... _v31.rptok
For those who are not on 1.3.b66 yet, here's a b63-compatible version
http://www.houseofgenius.com/files/mtfw ... _b63.rptok
I've fixed it, and the new version is available here:
Requires MapTool 1.3.b66
http://www.houseofgenius.com/files/mtfw ... _v31.rptok
For those who are not on 1.3.b66 yet, here's a b63-compatible version
http://www.houseofgenius.com/files/mtfw ... _b63.rptok
Last edited by Rumble on Wed Jul 21, 2010 5:32 pm, edited 1 time in total.
-
- Kobold
- Posts: 6
- Joined: Fri Jun 25, 2010 11:26 am
Re: Library Token: Dice Box
Hi and first of all can I say how great both RPtools and Dice Box are.
I've been playing around with Dice Box, and I was wondering how to make it simpler for use as a straight d6 dice pool roller. By simpler, I mean the following...
Reduce the menu to just d6s
Remove the Modifier, Target, Explode, Show Results To (so there are no secret rolls) and Tooltip Info options
Only output the results as 'x' number of 'successes' (each d6 roll greater than or equal to 4) and to show each dice roll (ideally without having place the mouse over the output AND to have any 6s rolled be highlighted in another colour
Too much on the first visit?
John
I've been playing around with Dice Box, and I was wondering how to make it simpler for use as a straight d6 dice pool roller. By simpler, I mean the following...
Reduce the menu to just d6s
Remove the Modifier, Target, Explode, Show Results To (so there are no secret rolls) and Tooltip Info options
Only output the results as 'x' number of 'successes' (each d6 roll greater than or equal to 4) and to show each dice roll (ideally without having place the mouse over the output AND to have any 6s rolled be highlighted in another colour
Too much on the first visit?
John
Re: Library Token: Dice Box
Stripping the dice box down would be taking the hardest possible route to what you want, IMO. Something like the macro below is a much more direct route:john anderson wrote:Hi and first of all can I say how great both RPtools and Dice Box are.
I've been playing around with Dice Box, and I was wondering how to make it simpler for use as a straight d6 dice pool roller. By simpler, I mean the following...
Reduce the menu to just d6s
Remove the Modifier, Target, Explode, Show Results To (so there are no secret rolls) and Tooltip Info options
Only output the results as 'x' number of 'successes' (each d6 roll greater than or equal to 4) and to show each dice roll (ideally without having place the mouse over the output AND to have any 6s rolled be highlighted in another colour
Too much on the first visit?
John
Code: Select all
[h:status = input("numDice|0|Dice Pool Size")]
[h:abort(status)]
[h:numSux = 0]
[h:individualDice = ""]
[h,count(numDice),CODE:
{
[thisroll = 1d6]
[individualDice = listAppend(individualDice, thisroll)]
[if(thisroll >= 4): numSux = numSux + 1]
}]
[h:outputDisplay=""]
[h,foreach(die, individualDice),CODE:
{
[if(die == 6): outputDisplay = strformat("%{outputDisplay} <font color=red><b>%{die}</b></font>"); outputDisplay = strformat("%{outputDisplay} <font color=black>%{die}</font>")]
}]
[h:finalOutputDisplay = strformat("[%{outputDisplay}]")]
<b>[r:numSux] Success[r:if(numSux>1,"es","")]</b>: [r:finalOutputDisplay]
-
- Kobold
- Posts: 6
- Joined: Fri Jun 25, 2010 11:26 am
Re: Library Token: Dice Box
Hey that's cool. Thanks for that, although I do miss the pretty graphics
John
John
Re: Library Token: Dice Box
ah, shame I missed this. I could hae posted the macro code I have for my Warhammer (basic) Framework.
That makes me wonder - could it work in a frame??.... Hmm I should go back and look at it now I have better knowledge of MT.
Mal
EDIT:
Screw it, I went and found the old thread.
Here
And the code (which allows for 2 different rolls in one and setting any target number):
That makes me wonder - could it work in a frame??.... Hmm I should go back and look at it now I have better knowledge of MT.
Mal
EDIT:
Screw it, I went and found the old thread.
Here
And the code (which allows for 2 different rolls in one and setting any target number):
Here
[h: Input(
"UnitRoll|1|Number of unit dice to roll",
"UnitTN|2, 3, 4, 5, 6|Unit's Target Number|LIST|select=2 Value=string",
"SgtRoll|1|Number of sergeant dice to roll",
"SgtTN|2, 3, 4, 5, 6|Sergeant's Target Number|LIST|select=2 Value=string"
)]
[h: UnitWins = 0]
[h: UnitFailures = 0]
[h: UnitSixs = 0]
[h: UnitOnes = 0]
[h: SgtWins = 0]
[h: SgtFailures = 0]
[h: SgtSixs = 0]
[h: SgtOnes = 0]
<b>Unit's Target Number:</b> [r: eval("UnitTN")]<br>
<b>Unit's results:</b><br>
[h, count(UnitRoll), CODE:
{
[h: Rawroll = 1d6]
[h: UnitSix = IF(Rawroll == 6, 1, 0)]
[h: UnitWin = IF(Rawroll >= UnitTN, 1, 0)]
[h: UnitFail = IF(Rawroll < UnitTN, 1, 0)]
[h: UnitOne = IF(Rawroll == 1, 1, 0)]
[h: UnitSixs = UnitSixs + UnitSix]
[h: UnitOnes = UnitOnes + UnitOne]
[h: UnitWins = UnitWins + UnitWin]
[h: UnitFailures = UnitFailures + UnitFail]
}]
<span color="green">[r: UnitWins] Successes (of which [r: UnitSixs] are 6s)</span> and <span color="red">[r: UnitFailures] Failures (of which [r: UnitOnes] are 1s)</span><br>
<b>Sergeant's Target Number:</b> [r: eval("SgtTN")]<br>
<b>Sergeant's results:</b><br>
[h, count(SgtRoll), CODE:
{
[h: Rawroll = 1d6]
[h: SgtSix = IF(Rawroll == 6, 1, 0)]
[h: SgtWin = IF(Rawroll >= UnitTN, 1, 0)]
[h: SgtFail = IF(Rawroll < UnitTN, 1, 0)]
[h: SgtOne = IF(Rawroll == 1, 1, 0)]
[h: SgtSixs = SgtSixs + SgtSix]
[h: SgtOnes = SgtOnes + SgtOne]
[h: SgtWins = SgtWins + SgtWin]
[h: SgtFailures = SgtFailures + SgtFail]
}]
<span color="green">[r: SgtWins] Successes (of which [r: SgtSixs] are 6s)</span> and <span color="red">[r: SgtFailures] Failures (of which [r: SgtOnes] are 1s)</span>
"UnitRoll|1|Number of unit dice to roll",
"UnitTN|2, 3, 4, 5, 6|Unit's Target Number|LIST|select=2 Value=string",
"SgtRoll|1|Number of sergeant dice to roll",
"SgtTN|2, 3, 4, 5, 6|Sergeant's Target Number|LIST|select=2 Value=string"
)]
[h: UnitWins = 0]
[h: UnitFailures = 0]
[h: UnitSixs = 0]
[h: UnitOnes = 0]
[h: SgtWins = 0]
[h: SgtFailures = 0]
[h: SgtSixs = 0]
[h: SgtOnes = 0]
<b>Unit's Target Number:</b> [r: eval("UnitTN")]<br>
<b>Unit's results:</b><br>
[h, count(UnitRoll), CODE:
{
[h: Rawroll = 1d6]
[h: UnitSix = IF(Rawroll == 6, 1, 0)]
[h: UnitWin = IF(Rawroll >= UnitTN, 1, 0)]
[h: UnitFail = IF(Rawroll < UnitTN, 1, 0)]
[h: UnitOne = IF(Rawroll == 1, 1, 0)]
[h: UnitSixs = UnitSixs + UnitSix]
[h: UnitOnes = UnitOnes + UnitOne]
[h: UnitWins = UnitWins + UnitWin]
[h: UnitFailures = UnitFailures + UnitFail]
}]
<span color="green">[r: UnitWins] Successes (of which [r: UnitSixs] are 6s)</span> and <span color="red">[r: UnitFailures] Failures (of which [r: UnitOnes] are 1s)</span><br>
<b>Sergeant's Target Number:</b> [r: eval("SgtTN")]<br>
<b>Sergeant's results:</b><br>
[h, count(SgtRoll), CODE:
{
[h: Rawroll = 1d6]
[h: SgtSix = IF(Rawroll == 6, 1, 0)]
[h: SgtWin = IF(Rawroll >= UnitTN, 1, 0)]
[h: SgtFail = IF(Rawroll < UnitTN, 1, 0)]
[h: SgtOne = IF(Rawroll == 1, 1, 0)]
[h: SgtSixs = SgtSixs + SgtSix]
[h: SgtOnes = SgtOnes + SgtOne]
[h: SgtWins = SgtWins + SgtWin]
[h: SgtFailures = SgtFailures + SgtFail]
}]
<span color="green">[r: SgtWins] Successes (of which [r: SgtSixs] are 6s)</span> and <span color="red">[r: SgtFailures] Failures (of which [r: SgtOnes] are 1s)</span>
Mal
- CyrusStonecypher
- Giant
- Posts: 158
- Joined: Thu Nov 26, 2009 1:22 am
- Location: Columbus, IN, U.S.A.
Re: Library Token: Dice Box
In the first post the link to the b63 version is broken.
Stuff created by more capable MT users than myself :[Light vision Illumination Generator Tool] [External table editor] [Lindsay's Generic Tools] [Import and Export Maps for b63] [Group Movement]
Re: Library Token: Dice Box
Thanks, fixed it.
- CyrusStonecypher
- Giant
- Posts: 158
- Joined: Thu Nov 26, 2009 1:22 am
- Location: Columbus, IN, U.S.A.
Re: Library Token: Dice Box
It seems that Azhrei's patch to allow map exports for b63 kills the dice box.
A campaign filed loaded with MapToolLauncher.exe has a properly functional dice box. The same campaign loaded with the altered .bat for Azhrei's patch throws an error when dice are rolled with the dice box. The error message is attached.
I don't really expect this issue to be fixed (old build with a tweaked .jar) but thought I'd post it in case anyone else is still using Azhrei's patch for b63.
A campaign filed loaded with MapToolLauncher.exe has a properly functional dice box. The same campaign loaded with the altered .bat for Azhrei's patch throws an error when dice are rolled with the dice box. The error message is attached.
I don't really expect this issue to be fixed (old build with a tweaked .jar) but thought I'd post it in case anyone else is still using Azhrei's patch for b63.
Stuff created by more capable MT users than myself :[Light vision Illumination Generator Tool] [External table editor] [Lindsay's Generic Tools] [Import and Export Maps for b63] [Group Movement]
Re: Library Token: Dice Box
What is the "Explode?:" do? I have played around and can't figure out what it does. I searched the post for "explode" but couldn't make heads or tails. Thanks.
--DOC
- JonathanTheBlack
- Dragon
- Posts: 544
- Joined: Mon Jun 28, 2010 12:12 pm
- Location: I'm the worm...
Re: Library Token: Dice Box
Explode means you roll it again if it rolls the highest value on the die. Exploding dice work in two ways. Either it counts as a success and you roll it again or your roll it again and add the second roll to the first roll. Some rule systems let you keep rolling each time you "explode" while others allow it to only happen once.Doc_Waldo wrote:What is the "Explode?:" do? I have played around and can't figure out what it does. I searched the post for "explode" but couldn't make heads or tails. Thanks.
Re: Library Token: Dice Box
Hi...
I've finally decided to get up off my lazy butt and start working with MapTools...after downloading it all this time and never doing more than giving it a quick once over.
I love the dice box (have 3.1) but I'm having a problem... I think what I'm expecting the difference on 'Tooltip Info' between "totals" and "Each Die". I'm expecting "totals" to give me a simple total of everything, where as "each die" should list the result of each die separately like in a comma separated list. (8,4,10,7,9 vs 38).
I also notice that if I want to just change the number of dice, like how many d10's for WoD, I have to clear all the settings and then reset my target, explore tooltip info, and number of dice... and for large pools of dice it's a 'click fest'.
For the WoD game I play in it would be nice to just set Target:8, Each Die, GM Only, Explode... and then easily change the number (would be a bit faster too)
Thank you
Al B.
I've finally decided to get up off my lazy butt and start working with MapTools...after downloading it all this time and never doing more than giving it a quick once over.
I love the dice box (have 3.1) but I'm having a problem... I think what I'm expecting the difference on 'Tooltip Info' between "totals" and "Each Die". I'm expecting "totals" to give me a simple total of everything, where as "each die" should list the result of each die separately like in a comma separated list. (8,4,10,7,9 vs 38).
I also notice that if I want to just change the number of dice, like how many d10's for WoD, I have to clear all the settings and then reset my target, explore tooltip info, and number of dice... and for large pools of dice it's a 'click fest'.
For the WoD game I play in it would be nice to just set Target:8, Each Die, GM Only, Explode... and then easily change the number (would be a bit faster too)
Thank you
Al B.
Al B. USAF RET.
*Chief Organizer and Bottle Washer - 'User Creations' Forum*
MT Framework Directory **LISTING** (UPDT 2012-02-10)
*Chief Organizer and Bottle Washer - 'User Creations' Forum*
MT Framework Directory **LISTING** (UPDT 2012-02-10)
Re: Library Token: Dice Box
I was wondering if anyone could add a <image src='[r: tableImage("NewDice",1)]'></image> or something like it to show the pictures of the dice rolled,instead of the bland "Rolling 1d6+0: 6".I tried to figure it out myself,but have been unable to find the right spot in the drop-in to get the image.
- lmarkus001
- Great Wyrm
- Posts: 1867
- Joined: Sat Mar 29, 2008 12:30 am
- Location: Layfayette Hill, PA
Re: Library Token: Dice Box
You want to modify the macro "RollDice". Here is a sample that references the default dice images. Note that this requires a non-standard D100 table (the images are in the Default library, you just need to build the table fromt hem).kyuss11 wrote:I was wondering if anyone could add a <image src='[r: tableImage("NewDice",1)]'></image> or something like it to show the pictures of the dice rolled,instead of the bland "Rolling 1d6+0: 6".I tried to figure it out myself,but have been unable to find the right spot in the drop-in to get the image.
EDIT: Updated to include D100 rolls and this will only show the die images if the tables are loaded, Tooltip Info: Each Die is checked, and "Exploded" is not checked, otherwise it shows numbers.
RollDice with Images
Code: Select all
[h:numD4=json.get(macro.args, "d4s")]
[h:numD6=json.get(macro.args, "d6s")]
[h:numD8=json.get(macro.args, "d8s")]
[h:numD10=json.get(macro.args, "d10s")]
[h:numD12=json.get(macro.args, "d12s")]
[h:numD20=json.get(macro.args, "d20s")]
[h:numD100=json.get(macro.args, "d100s")]
[h:mod=json.get(macro.args, "mod")]
[h:breakout=json.get(macro.args, "breakdown")]
[h:target = json.get(macro.args, "tn")]
[h:showTo = json.get(macro.args, "showTo")]
[h,if(json.contains(macro.args, "explodeDice")): exp = "e"; exp=""]
[H: jTables = json.get(getInfo("campaign"),"tables") ]
[h:d4array=""][h:d4roll=0]
[h:d6array=""][h:d6roll=0]
[h:d8array=""][h:d8roll=0]
[h:d10array=""][h:d10roll=0]
[h:d12array=""][h:d12roll=0]
[h:d20array=""][h:d20roll=0]
[h:d100array=""][h:d100roll=0]
[h,if(breakout=="eachRoll"),CODE:
{
[H: imgStr = "<image src=%s />" ]
[h,count(numD4),CODE:
{
[thisD4 = eval("1d4"+exp)]
[d4roll = d4roll + thisD4]
[IF(json.contains(jTables,"D4") && exp == ""): d4array=listAppend(d4array, strformat( imgStr, tableImage('D4',thisD4))); d4array=listAppend(d4array, thisD4)]
}]
[h,count(numD6),CODE:
{
[thisD6 = eval("1d6"+exp)]
[d6roll = d6roll + thisD6]
[IF(json.contains(jTables,"D6") && exp == ""): d6array=listAppend(d6array, strformat( imgStr, tableImage('D6',thisD6))); d6array=listAppend(d6array, thisD6)]
}]
[h,count(numD8),CODE:
{
[thisD8 = eval("1d8"+exp)]
[d8roll = d8roll + thisD8]
[IF(json.contains(jTables,"D8") && exp == ""): d8array=listAppend(d8array, strformat( imgStr, tableImage('D8',thisD8))); d8array=listAppend(d8array, thisD8)]
}]
[h,count(numD10),CODE:
{
[thisD10 = eval("1d10"+exp)]
[d10roll = d10roll + thisD10]
[IF(json.contains(jTables,"D10") && exp == ""): d10array=listAppend(d10array, strformat( imgStr, tableImage('D10',thisD10))); d10array=listAppend(d10array, thisD10)]
}]
[h,count(numD12),CODE:
{
[thisD12 = eval("1d12"+exp)]
[d12roll = d12roll + thisD12]
[IF(json.contains(jTables,"D12") && exp == ""): d12array=listAppend(d12array, strformat( imgStr, tableImage('D12',thisD12))); d12array=listAppend(d12array, thisD12)]
}]
[h,count(numD20),CODE:
{
[thisD20 = eval("1d20"+exp)]
[d20roll = d20roll + thisD20]
[IF(json.contains(jTables,"D20") && exp == ""): d20array=listAppend(d20array, strformat( imgStr, tableImage('D20',thisD20))); d20array=listAppend(d20array, thisD20)]
}]
[h,count(numD100),CODE:
{
[thisD100 = eval("1d100"+exp)]
[d100roll = d100roll + thisD100]
[IF(json.contains(jTables,"D100") && json.contains(jTables,"D10") && exp == ""): d100array=listAppend(d100array, strformat( imgStr, tableImage('D100',if(thisD100>=10 && thisD100 != 100, floor(thisD100/10), "10" )))+strformat( imgStr, tableImage('D10',substring(thisD100, length(thisD100)-1)))); d100array=listAppend(d100array, thisD100)]
}]
[h:rolledDice=
if(d4roll !=0, numD4+"d4"+"+", "")
+if(d6roll !=0, numD6+"d6"+"+", "")
+if(d8roll != 0, numD8+"d8"+"+", "")
+if(d10roll !=0, numD10+"d10"+"+", "")
+if(d12roll !=0, numD12+"d12"+"+", "")
+if(d20roll != 0, numD20+"d20"+"+", "")
+if(d100roll != 0, numD100+"d100"+"+","")
+mod]
[h:Values =
if(d4roll == 0, "", d4roll+"("+d4array+")"+"+")
+ if(d6roll == 0, "", d6roll+"("+d6array+")"+"+")
+ if(d8roll == 0, "", d8roll+"("+d8array+")"+"+")
+ if(d10roll==0, "", d10roll+"("+d10array+")"+"+")
+ if(d12roll==0,"",d12roll+"("+d12array+")"+"+")
+ if(d20roll==0,"",d20roll+"("+d20array+")"+"+")
+ if(d100roll==0, "", d100roll+"("+d100array+")"+"+")
+ mod]
};
{
[h:d4roll = if(numD4=="0",0,eval(numD4+"d4"+exp))]
[h:d6roll = if(numD6=="0",0,eval(numD6+"d6"+exp))]
[h:d8roll = if(numD8=="0",0,eval(numD8+"d8"+exp))]
[h:d10roll=if(numD10=="0",0,eval(numD10+"d10"+exp))]
[h:d12roll=if(numD12=="0",0,eval(numD12+"d12"+exp))]
[h:d20roll=if(numD20=="0",0,eval(numD20+"d20"+exp))]
[h:d100roll=if(numD100=="0",0,eval(numD100+"d100"+exp))]
[h:mod=number(mod)]
[h:rolledDice=
if(d4roll !=0, numD4+"d4"+"+", "")
+if(d6roll !=0, numD6+"d6"+"+", "")
+if(d8roll != 0, numD8+"d8"+"+", "")
+if(d10roll !=0, numD10+"d10"+"+", "")
+if(d12roll !=0, numD12+"d12"+"+", "")
+if(d20roll != 0, numD20+"d20"+"+", "")
+if(d100roll != 0, numD100+"d100"+"+","")
+mod]
[h:Values =
if(d4roll == 0, "", d4roll+"+")
+ if(d6roll == 0, "", d6roll+"+")
+ if(d8roll == 0, "", d8roll+"+")
+ if(d10roll==0, "", d10roll+"+")
+ if(d12roll==0,"",d12roll+"+")
+ if(d20roll==0,"",d20roll+"+")
+ if(d100roll==0, "", d100roll+"+")
+ mod]
}]
[h:roll = d4roll+d6roll+d8roll+d10roll+d12roll+d20roll+d100roll+mod]
[h,if(target>0 && roll >target): success = "Success!"; success="Failed!"]
[r,if(showTo == "all"),CODE:
{
[r:dbxOutputTo("all", "<span><i>Rolling "+rolledDice+"</i>:<b> <span title='<html>"+Values+"</html>'>"+roll+"</b></span> "+if(target > 0, success, "")+"</span>")]
};
{
[r:dbxOutputTo("gm", "<span><i>Rolling "+rolledDice+"</i>:<b> <span title='<html>"+Values+"</html>'>"+roll+"</b></span> "+if(target > 0, success, "")+"</span>")]
}]
Last edited by lmarkus001 on Wed Oct 05, 2011 4:32 pm, edited 4 times in total.
Re: Library Token: Dice Box
I just replaced the RollDice macro with your code but there appears to be no difference in the chat,I do see the
[d4array=listAppend(d4array, strformat( imgStr, tableImage('D4',thisD4)))] as a modification.The chat however still shows
Rolling 1d4+0: 2
[d4array=listAppend(d4array, strformat( imgStr, tableImage('D4',thisD4)))] as a modification.The chat however still shows
Rolling 1d4+0: 2
- lmarkus001
- Great Wyrm
- Posts: 1867
- Joined: Sat Mar 29, 2008 12:30 am
- Location: Layfayette Hill, PA
Re: Library Token: Dice Box
Ah yes, I only show the dice image in for the Tooltip when the option "Each Die" is selected. That is the only location individual die rolls are shown (well I guess if you chose to roll only a single d4 then technically that would be a single value too...).