[ABD] Dice BBCode

Any abandoned MODs will be moved to this forum.

WARNING: MODs in this forum are not currently being supported or maintained by the original MOD author. Proceed at your own risk.
Forum rules
IMPORTANT: MOD Development Forum rules

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
surfer247
Registered User
Posts: 145
Joined: Sat Jul 19, 2008 3:41 am
Location: University of Florida
Name: Todd
Contact:

[ABD] Dice BBCode

Post by surfer247 »

MOD Title: Dice BBCode

MOD Description:
Users may roll dice using the usual code: [dice ]3d6[/dice] rolls three six-sided dice and adds the total. The dice are unable to be changed by normal users, but moderators and administrators can remove and allow users to remove the dice BBCode.

There is also a section added in the ACP to allow administrators the ability to change the text/HTML display of the dice rolls in posts.

Additional Info:
  • MOD Version: 2.0.0B
  • phpBB Version: 3.0.2
MOD Download: Click here to download!

Demo Board: Click here!

Demo (username/password):
  • Moderator/Admin:
    • Username: modadmin
    • Password: password
  • Regular User:
    • Username: user
    • Password: password
Supported Languages:
  • en [English]
Comments:
This mod was written in response to a request on the phpbb forums here.

Also, if anyone has suggestions for other features, feel free to suggest them and I will see what I can do about including them. The same goes with bugs in the modification. Feedback is always apreciated.

Future Additions:
  • Adding support for an addition to the roll (i.e. 3d6+8)
  • Remove the parsing from inside a code tag
  • Change the default to the standard dice syntax
  • Add functionality for 3d6k2 rolls three six sided dice and keeps the highest 2
  • Add an option to roll another die if a die is the max value
  • Add functionality for topic review and previewing
  • Add a field to the user table for their character name
  • Add an option to the ACP to force users to have a character name to roll dice
  • Add a parse code in the display text to use the character name if it exists other ise the use the username
Screenshots:
ImageUser's view of a dice roll

ImageModerator's view of a dice roll

ImagePosting of the previous two examples

ImageThe dice BBCode in a quote

ImageMore in depth quote example

ImageThe error thrown when a user tries to remove an unremovable dice roll.

ImageView of the administrator control panel for changing the settings of the mod.
Last edited by surfer247 on Sun Sep 28, 2008 1:53 am, edited 6 times in total.
Come visit me at Toddred.com!
User avatar
RiTz21
Registered User
Posts: 208
Joined: Tue May 31, 2005 5:20 pm

Re: [DEV] Dice BBCode

Post by RiTz21 »

Pretty nice!!!

Can we also add 'values' to the dice result?
I.E. 1d20+6

R
Image
User avatar
RiTz21
Registered User
Posts: 208
Joined: Tue May 31, 2005 5:20 pm

Re: [DEV] Dice BBCode

Post by RiTz21 »

Suggestion: Since people using dice use this syntax to represent them, I would suggest you use it here also:

So instead of
user rolled 1 20-sided die and got a total of 15

You should display something ike
user rolled 1d20=15

or
user rolled 3d20=44
Image
surfer247
Registered User
Posts: 145
Joined: Sat Jul 19, 2008 3:41 am
Location: University of Florida
Name: Todd
Contact:

Re: [DEV] Dice BBCode

Post by surfer247 »

I can add the addition in the next feature.

As for the display, that was just the display I chose. When you install the mod, you install a section in the ACP that lets you define your own display. So you can have it say whatever you want.
Come visit me at Toddred.com!
User avatar
RiTz21
Registered User
Posts: 208
Joined: Tue May 31, 2005 5:20 pm

Re: [DEV] Dice BBCode

Post by RiTz21 »

surfer247 wrote:I can add the addition in the next feature.
Great!!
surfer247 wrote:As for the display, that was just the display I chose. When you install the mod, you install a section in the ACP that lets you define your own display. So you can have it say whatever you want.
Yes I am aware it can be customized as desired (an excellent feature!)
I am just suggesting the Mod defaults to the standard notation used by those who play with dice...

Cheers!

RiTz21
Image
BillFranklin
Registered User
Posts: 7
Joined: Sat Sep 13, 2008 1:53 pm

Re: [DEV] Dice BBCode

Post by BillFranklin »

Edit: I guess I should actually read what other people said about the mod too :oops:

I would like to see the following support added in


[ dice ]1d20+7[ /dice]

would generate

BillFranklin rolled 1 20-sided die +7 and got a total of 23

Code: Select all

Oh, and could you make it NOT parse inside of code statements?
Thanks!

Love the mod, by the way!
surfer247
Registered User
Posts: 145
Joined: Sat Jul 19, 2008 3:41 am
Location: University of Florida
Name: Todd
Contact:

Re: [DEV] Dice BBCode

Post by surfer247 »

@RiTz21:
I chose those specific replacements just to show people using the mod different ways they can make it appear. However, I agree with you, most people using this mod would already know, or at least be able to figure out, how to work it, so I think I will change that in the next version. I'll add some more examples or something to show the different ways you can display the rolls.

@BillFranklin:
Haha yeah, I'm adding the feature in the next version. Also, thanks for pointing out the code issue to me. Since it does the first part before it removes the parsing for the code tag, it creates the dice roll, then just leaves it as [dice]hdsjmrhsji[/dice] in the code block instead of [dice]3d6[/dice]. I've got an idea about how to fix it, and that support will definately be in the next version.

Thanks to everyone for their advice and suggestions.

EDIT: Please note that when you log in with the modadmin account on the test board that you can see the ACP page for changing BBCodes and editting the settings for this mod. Feel free to try that out, but please don't do anything drastic (i.e. deleting the dice BBCode fromt he custome BBCode page).
Come visit me at Toddred.com!
moselekm
Registered User
Posts: 53
Joined: Mon Sep 15, 2008 9:34 am

Re: [DEV] Dice BBCode

Post by moselekm »

I've did everything in the install.xml and got no errors, but now when I attempt to use the code it always comes up with INVALID DICE ROLL!!!
surfer247
Registered User
Posts: 145
Joined: Sat Jul 19, 2008 3:41 am
Location: University of Florida
Name: Todd
Contact:

Re: [DEV] Dice BBCode

Post by surfer247 »

Can you post the [dice] tags you are using so I can help you fix it. Also, did you try the same [dice] tags on the demo forum?
Come visit me at Toddred.com!
moselekm
Registered User
Posts: 53
Joined: Mon Sep 15, 2008 9:34 am

Re: [DEV] Dice BBCode

Post by moselekm »

Yes I am used exactly what I used on the demo forum [dice]3d6[/dice]
User avatar
Sunka
Registered User
Posts: 566
Joined: Wed Mar 26, 2008 2:48 pm
Location: Croatia, Zvoneca

Re: [DEV] Dice BBCode

Post by Sunka »

Nice MOD
jolraelgeo
Registered User
Posts: 6
Joined: Mon Jun 25, 2007 11:31 am

Re: [DEV] Dice BBCode

Post by jolraelgeo »

Could you add the "Roll and Keep" mechanic from Legend of the Five Rings?

There you roll X 10 sided dice but only Y of them add their value to the total (Xd10kY)

6d10k3 would mean "roll 4 dice of 10 sides and keep the 3 greatest dice rolled"

There is also one exception: when you get a 10, you are able to add 10 to the total and then reroll that dice and add the new result to the total. If you got more than one 10 you do the same for each 10


For example: 6d10k3 could get the following result:

2 - 7 - 6 - 5 - 7 - 10

In this case the result would be 24, because we only add the 3 greatest results (k3) but then we reroll the 10 and get a 3. Then the final result would be 27 (24 plus the 3 obtained from the 10 rerolled)

I hope you understand what I mean.
surfer247
Registered User
Posts: 145
Joined: Sat Jul 19, 2008 3:41 am
Location: University of Florida
Name: Todd
Contact:

Re: [DEV] Dice BBCode

Post by surfer247 »

moselekm wrote:Yes I am used exactly what I used on the demo forum [dice]3d6[/dice]
After you entered the "[dice]3d6[/dice]", did it add anything the the dice table in the database. Also, did it chage the 3d6 to a length 10 string of random letters?

@jolraelgeo:
Also an excellent suggestion. I can add the keep idea to the next version. As far as the reroll goes, is it standard procedure to reroll on rolling the highest number? I know for some purposes you do, but I thought generally you didn't. If it is, I'd be happy to an option in the ACP to allow that. Or I could change the dice tag so that [dice=reroll] will correspond to that. Let me know what you think about that.
Come visit me at Toddred.com!
BillFranklin
Registered User
Posts: 7
Joined: Sat Sep 13, 2008 1:53 pm

Re: [DEV] Dice BBCode

Post by BillFranklin »

Also, when you are posting a reply, the Topic Review shows Invalid Dice Roll. Can you fix that?
surfer247
Registered User
Posts: 145
Joined: Sat Jul 19, 2008 3:41 am
Location: University of Florida
Name: Todd
Contact:

Re: [DEV] Dice BBCode

Post by surfer247 »

BillFranklin wrote:Also, when you are posting a reply, the Topic Review shows Invalid Dice Roll. Can you fix that?
I'm not sure what you mean by this. When quoting a dice roll?
Come visit me at Toddred.com!
Locked

Return to “[3.0.x] Abandoned MODs”