10-16-2013, 05:34 PM | #1 | |
synk-ism
|
[Feature Addition] Dice Rolling in Posts
Do you run a forum-based RP that would benefit from having easy access to dice while posting? Do you want to be "that guy" and make dice-related jokes and rolls in your posts? Do you like scripts that do random stuff?!
NPF now is making use of a dice rolling mod put together by "tuxz0r" on the vBulletin forums back in 2006. There are three bbcode additions that will roll dice in a post. All roll commands use the following format: XdY+N X is the number of dice to use. Y is the total sides of the die type being rolled. N is used for modifiers (I guess, like, if you have a +1 to hit rolls, for example) roll -- shows just the sum of what's rolled rollv -- should show the result of each die as well as the total rollo -- open rolls; author has example of "4d6b3" giving the best 3 rolls out of the four When using these bbcodes, you can add a label to any roll with an = in the tag, such as Code:
[roll=to hit]3d6[/roll] After rolling, the output in the post will look something like this: Quote:
Things to Note The opening/initial post of a thread WILL NOT correctly parse roll commands. This is why you don't see any examples in this post. If you double-post and it gets auto-merged, rolls made in the auto-merged post WILL NOT work. The original author likely did not expect the auto-merge modification. If you are EDITING A POST, you cannot add new rolls. The rolls are made server-side when the initial post/reply is created and stored in the database. This is by design, and prevents cheating. As a result of the roll security above, when editing or quoting a post with rolls made in it, you will only see a placeholder for the roll in the format of [roll#]. The actual roll data is stored server-side in a separate column from the post content. I hope you folks who run RPs and the like will be able to make use of this. Test it out. If you have any problems, feel free to post about them here or message me!
__________________
Find love.
Last edited by synkr0nized; 10-16-2013 at 06:00 PM. |
|
10-16-2013, 05:47 PM | #2 |
Sent to the cornfield
|
This is just a test post by me. I'll be using the different roll codes for demonstration purposes:
Result only: (2d6)[2] For seeing the result of each die, plus the result: (2d6)[1][2](3) Open rolls: (2d6)[3][5](8) Edit: Not much difference between the second and third, I'll admit. Not sure what it means by 'open rolls'. Secondary Note/Edit: When you edit after you've already rolled, the code will change to [roll#]. Last edited by Red Mage Black; 10-16-2013 at 05:51 PM. |
10-16-2013, 05:51 PM | #3 |
synk-ism
|
Without adding options, it's the same as rollv.
Another for "open rolls", using the mod author's example of 4d6b3:
(4d6b3)[5][11][5][4](20) I am not really clear what he intended, either, yet.
__________________
Find love.
|
10-16-2013, 05:55 PM | #4 |
Sent to the cornfield
|
I'll give it a shot using a different code and see if I can figure it out:
(6d10b4)[1][11][8][6][4][1](30) Edit: I'm wondering where that 11 comes from, since it showed up in both of our rolls. |
10-16-2013, 05:59 PM | #5 |
synk-ism
|
"Open" again, with a label
I had a 14 in one when I tested before using d10.
what is this - (4d10b2)[8][3][5][4](20)
__________________
Find love.
|
10-16-2013, 06:12 PM | #6 |
Sent to the cornfield
|
Labeling is good, but the open roll function looks bugged. It has the odd habit of adding in a number not associated to the dice being rolled, then includes it with the highest rolls. Might be better off ignoring the open roll tags and just settling with the first and second functions.
The link in the authors post where it explains the roller better is broken and has probably been broken for a while. Note: I found a site that claims to have fixed the 'first post' issue, if you want to take a look at it, Synk. Edit: Hm, maybe not? Looks like just downloading the forum mod requires registration. Last edited by Red Mage Black; 10-16-2013 at 06:15 PM. |
10-16-2013, 06:53 PM | #7 | |
synk-ism
|
Yeah, that's not "keep the best three" by any means.
Quote:
Yeah, I've already come across that one over at vBulletin's forums. It's for vBulletin 4x, and we're still using 3.8.5. Slight differences in the vBulletin backend (specifically how it calls and references templates to render threads and posts) prevents me from both just applying that version or copying the relevant code over, as it's not compatible with vBulletin 3, AFAIK currently. It doesn't look like that author made any changes to tux0rz's "open roll" idea, anyway. In both cases, all that happens is that for any die that rolls the maximum value it can (i.e. a 6 for a d6, 10 for a d10, etc.) it gets rolled again and adds that value to the max. If it were to equal the max again, it would roll again and add that as well. So on a d10 that hit 10, it rolls again. If it was, say, 2, the sum for that die becomes 12; if it was 10 again, it would temporarily be 20 and roll a third time. This is not what is described as the behavior, at least as far as I interpret what the original coder claims should happen. I don't know enough about tabletop mechanics to know if something like this is supposed to happen. So perhaps it is best to ignore that command?
__________________
Find love.
|
|
10-16-2013, 07:31 PM | #8 | |
Dark-type?
Join Date: Nov 2006
Location: Somewhere.
Posts: 431
|
Quote:
[roll0] [roll1] Edit: Huh. Previewing kills the rolls. Whoops.
__________________
The dogs of war are nothing compared to the cats. |
|
10-16-2013, 07:32 PM | #9 |
Lakitu
Join Date: Feb 2010
Posts: 4,648
|
Yeah, our forum isn't entirely optimized for dice rolling with the post-merge feature. But this does tempt me to run an actual D&D game on the forum.
|
10-16-2013, 07:40 PM | #10 |
Dark-type?
Join Date: Nov 2006
Location: Somewhere.
Posts: 431
|
There's actually one already going, though it's done on the forum's chat and not the forum itself. http://edupad.ch/ShiftingSeasDnD3point5 is used for coordinating for it and the like, if interested.
__________________
The dogs of war are nothing compared to the cats. |
|
|