What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Request] Multiple d10 Dice Roller

[Request] Multiple d10 Dice Roller
Author: Message:
Dastion
New Member
*


Posts: 3
Joined: Feb 2008
O.P. [Request] Multiple d10 Dice Roller
Hello, I have been searching the forums for a compatible dice roller for an online table-top game I have been playing and was hoping someone could be of assistance. Currently we use the honor system, but since i dont have any dice I tend to just use some seperate online function to roll and then post my results.

While I did find a D&D dice roller that will do for now, I know you guys are always looking for a challenge so I thought I'd give you this one.

The game is World of Darkness, a d10 based RPG.  The rolling is pretty straight forward. You add various stats in order to get a dice pool and then roll that many d10.  If you get an 8,9, or 10 you get a "success". In most situations there is something called a "10 again" where you get to reroll any 10s for a chance at more successes, but certain situations can get 9again or even 8 again, and sometimes you dont even get the 10 again quality. And in some situations when you do not have a dice pool (due to negative modifiers and/or low skills), you get a single "chance" die where you only suceed on a 10, and only dramatically fail on 1.

Now that you know the specifics of the system, I was wondering if anyone knew if it would be possible for something like this.

The simplest integration would simply be something that automatically rolled d10s and required very simple input.  For example, the player simply has to type /roll # and it will emote out the results, preferably bolding 8,9,10 and then telling the number of successes for convenience sake.

For example, if i type /roll 4, it would say..

Dastion rolls 4 dice [7, 8, 9, 10] and gets 3 successes.

At that point I could simply see that I rolled a single 10 and type /roll 1 for a chance at another successes. Or in the case of 9 again, I could /roll 2 for the 9 & 10.

While I would love to see a program that automatically rerolled the 10s, i.e. [7, 8, 9, 10--6], that might be a bit too complicated for such a specific script, since it would require some sort of extra qualifiers to input whether the roll had the 8 or 9 again quality rather than the 10, and a further qualifier for if you were rolling roll with no chance to "explode" as we call it.

If anyone could help me out it would be most appreciative and, with your permission, I'd post a link on White Wolf's forums for others to enjoy.  This would really help our game to become more streamlined with everyone being able to roll dice quickly rather than roll, count, report the rolls into the chat, potentially lie, ect.  And with proper formatting and coloring in the program, it would become more difficult to fake just by typing in the info.

This post was edited on 02-01-2008 at 03:54 PM by Dastion.
02-01-2008 01:30 PM
Profile E-Mail PM Find Quote Report
phalanxii
Full Member
***


Posts: 146
Reputation: 5
32 / Male / Flag
Joined: Aug 2006
Status: Away
RE: [Request] Multiple d10 Dice Roller
This is the code for a generic dice roller:
code:
function OnEvent_ChatWndSendMessage(ChatWnd, Message) {
    if (/^\/roll ((\d+)?d(\d+)(\+(\d+))?)$/i.test(Message)) {
        var Number = RegExp.$2 ? RegExp.$2 : 1;
        var Side = RegExp.$3;
        var Modifier = RegExp.$5 ? RegExp.$5 : 0;
        var Result = new Array();
        for (var i = 0; i < Number; i++) Result[i] = Math.ceil(Math.random() * Side) + Modifier * 1;
        return RegExp.$1 + " = [" + Result + "]";
    }
}
If you wish to use this, the format is "/roll <number>d<side>[+<modifier>]" (ie. "/roll d6", "/roll 2d6" and "/roll 4d10+3").


Now for your specific dice roller. Here is the code:
code:
function OnEvent_ChatWndSendMessage(ChatWnd, Message) {
    if (/^\/roll (\d+)$/i.test(Message)) {
        var Number = RegExp.$1;
        var Result = new Array();
        for (var i = 0; i < Number; i++) Result[i] = Math.ceil(Math.random() * 10);
        Result = Result.join(", ");
        var Success = 0;
        try { Success = Result.match(/8|9|10/g).length; } catch (e) { }
        return "\/me rolls " + Number + " di" + (Number == 1 ? "" : "c") + "e [" + Result.replace(/8|9|10/g, "[b]$&[\/b]") + "] and gets [u]" + Success + "[\/u] success" + (Success == 1 ? "" : "es") + ".";
    }
}
I've attached the script at the bottom of this post, which is easier to distribute.

I haven't implemented the 10 again thing, because I don't quite understand how it works with the 9 again and 8 again. If you want to explain it in more detail, I'll be happy to try to put it in the script as well.

Also, this script will use the "/me" command to display the results. Hopefully this is what you wanted.

.plsc File Attachment: Multiple d10 Dice Roller.plsc (988 bytes)
This file has been downloaded 184 time(s).

This post was edited on 02-02-2008 at 12:36 AM by phalanxii.
02-02-2008 12:34 AM
Profile PM Find Quote Report
Dastion
New Member
*


Posts: 3
Joined: Feb 2008
O.P. RE: [Request] Multiple d10 Dice Roller
Thanks a ton, this works perfectly.  And honestly should do for what I need, however, if you would like to try and implement the 9 and 8 again qualities I'd be glad to have them.

The way the 10 again quality works is that anytime you roll a 10, you not only count that as a success, but you get to reroll that die for a chance at an additional success.  The 9 and 8 again qualities are the same, except for they simply expand the range of rerolls. 9 again gives you a reroll on 9 & 10 and 8 again gives you a reroll on 8, 9, and 10, which essentially says that every success you roll gives you the chance for further successes, and if those rerolls hit the correct number they in turn get rerolled, giving you the potential to just keep on rolling until the qualifying numbers no longer show up. Note that you ONLY reroll the single die that got that quality, not the entire pool.

The default would be to reroll any 10s, however if you impemented this it would work this way:

With 9 again quality I could type..

/roll 4 9, would roll 4 dice and reroll 9s and 10s. So i would see...

Dastion rolls 4 dice [7, 8,9,10--7,8] and gets 4 successes(9 again).

Now, lets say we have the 8 again quality,

I would type /roll 4 8 and get:

Dastion rolls 4 dice [7, 8,9,10--7,8,9--1,2] and gets 5 successes(8 again).

However, if you were to go this far with it there would be 2 more qualifiers that would likely be needed. the First is for the Chance roll.

A "chance" roll is when you roll without a dice pool, i.e. dice penalties reduce your pool to 0 or you simply don't have the required stats, so you are allowed to roll only a single die.  A chance roll is the only time you can dramatically fail, if you roll a 1 while doing a chance roll you dramatically fail and something bad happens, and you only succeed if you roll a 10, everything else is a normal simple failure. The pool does have the 10 again quality, so you can potentially get more than 1 success on a chance roll, it's just very unlikely. The likely command for this would be "/roll chance"

The other one would would be a roll without any qualities, a roll that works much like the current implementation of hte dice roller you put up and rerolls nothing for you..since there are a few situations where you don't even get the 10 again quality.  Something like /roll # none or /roll # 0 would work well, "none" would probably be best since on a normal d10 the "10" is a 0 on the die and could cause confusion with that to other players.

This post was edited on 02-02-2008 at 11:29 AM by Dastion.
02-02-2008 09:14 AM
Profile E-Mail PM Find Quote Report
phalanxii
Full Member
***


Posts: 146
Reputation: 5
32 / Male / Flag
Joined: Aug 2006
Status: Away
RE: [Request] Multiple d10 Dice Roller
I think this is right. Give it a few test tries and see if it does it correctly.

As of this version:

"/roll n" - rolls n 10-sided dice and shows the number of successes
"/roll n 0" - same as "/roll n"
"/roll n none" - same as "/roll n"
"/roll n m" - rolls n 10-sided dice and shows the number of successes, with m again (where m is 8, 9 or 10)
"/roll chance" - rolls one 10-sided die and: succeeds (10), dramatically fails (1) or fails (everything else)

EDIT: I've had to fix the chance roll (I didn't include the 10 again quality before). Now it should be fixed, although I'm not sure how it should report a [10--1] roll (1 success or dramatically fail?)...

Make sure you get the "Multiple d10 Dice Roller (Update).plsc".

.plsc File Attachment: Multiple d10 Dice Roller (Update).plsc (1.26 KB)
This file has been downloaded 218 time(s).

This post was edited on 02-02-2008 at 12:36 PM by phalanxii.
02-02-2008 12:17 PM
Profile PM Find Quote Report
Dastion
New Member
*


Posts: 3
Joined: Feb 2008
O.P. RE: [Request] Multiple d10 Dice Roller
Sorry, i should have mentioned that. A roll of 1 after getting a 10 on a chance roll is not a dramatic failure, it is simply not another success.

Otherwise, amazing work!

There is one important thing I noticed and a few other things, but only the first is truly important:

1) The important bit is on the chance die roll, I found a bug (due to me forgetting to say so most likely).  When you have a chance die, successes are only counted if they are 10s, whether it is on the initial roll or an extra roll from getting a 10. Such that it is possible to get multiple successes with only 1 die, but only if you keep on rolling 10s.  After the initial 10 anything else simply counts as a failure to gain anymore successes and you go with what you have.

2) Could the 10 again quality be implemented into the default for "/roll N"? Otherwise there is little reason to have a /roll n none command.  Most every roll in the game has the 10 again quality, therefore it would make sense to have it... it is rare circumstances where you do not have it.  Unless of course it would be too annoying to recode since I'm sure all of your qualifiers work off of the initial /roll n command.  There is also little reason to report (10 again) at the end of it since it is generally the default.

3)A small thing I thought of, but entirely up to you if you want to throw it in.  The game has what they call an "exceptional success", sort of the opposite of a dramatic failure.  This happens whenever you roll at least 5 successes and often many abilities have different effects when this is achieved. Something at the end like, (Exceptional Success!) would be interesting to have.

I must say though, you have gone above and beyond and I really appreciate it.  As specialized as you have made this dice roller, perhaps it would be a good idea to name it after the game it is so customized to so that it would be easier to search for? The game is called World of Darkness, often shorted as WoD.  Though, again, thanks for all of your help.

Edit: After doing some more testing I noticed something that might help with fixing #1.  My roll was a chance roll with a 10, and then a reroll of an 8 and it reported 2 successes. However, unlike with all the other rolls I tested, the 8 was not bolded, further spamming of the command showed a 10--9, again reporting 2 successes, and even further spamming finally showed a 10--10--7 with both the first and second 10s bolded. So obviously you intended for it to only count 10s, yet for some reason it isn't.

This post was edited on 02-02-2008 at 01:26 PM by Dastion.
02-02-2008 01:17 PM
Profile E-Mail PM Find Quote Report
phalanxii
Full Member
***


Posts: 146
Reputation: 5
32 / Male / Flag
Joined: Aug 2006
Status: Away
RE: [Request] Multiple d10 Dice Roller
Alright, here we go:

"/roll n" - rolls n 10-sided dice with the 10 again quality
"/roll n m" - rolls n 10-sided dice with the m again quality (where m is 8, 9 or 10)
"/roll n 0" - rolls n 10-sided dice without the again quality
"/roll n none" - same as "/roll n 0"
"/roll chance" - rolls one 10-sided die with the 10 again quality; dramatically fails if 1 is rolled the first time

For all rolls, the result is reported in square brackets with successes bolded and the number of successes is reported at the end. For chance rolls, only 10s are counted as successes. For everything else, 8, 9 and 10 are counted as successes.

If the number of successes is at least 5, then "Exceptional success!" is appended to the end of the report.

The "/roll"command is also in the MsgPlus! command list. The script has now been renamed to "World of Darkness Dice Roller".

.plsc File Attachment: World of Darkness Dice Roller.plsc (1.42 KB)
This file has been downloaded 255 time(s).
02-03-2008 03:03 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On