vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   vBulletin 4 Request - Bbcode dice roller with image and customizable (https://vborg.vbsupport.ru/showthread.php?t=325017)

Tri@de 05-02-2017 07:00 PM

vBulletin 4 Request - Bbcode dice roller with image and customizable
 
I'd like to have a dice roller that can show images of dice face
i search also a customizable one
i explain:
if i write [ roll=xx] 2d6 [/ roll]
i want the output will show 2 images of customized dices.
if i write [ roll=yy] 2d6 [/ roll]
i want the output will show 2 images of other customized dices.

someone can do it?

MarkFL 05-02-2017 09:30 PM

Yep...give me a couple of days, and I'll put something together for you. :)

MarkFL 05-03-2017 02:18 AM

1 Attachment(s)
Okay...here is a preliminary product for you to test.

Download the attached .ZIP file, and upload the contents of the "upload" folder to your forum's root...this contains a set of images for the standard six sided die.

Once you have the images uploaded, and the .XML file imported, your users can then use something like:

[roll=1]5d6[/roll]

in their posts. The above will display five 6-sided die images (from the default defined image set), randomly generated.

If you have any questions about the use of this product (such as how to add more sets of images), please feel free to ask. If you have any suggestions for improvement, please let me know. :)

Tri@de 05-03-2017 08:19 AM

Thank you SO MUCH! :D

--------------- Added [DATE]1493807827[/DATE] at [TIME]1493807827[/TIME] ---------------

Quote:

Originally Posted by MarkFL (Post 2586143)

If you have any questions about the use of this product (such as how to add more sets of images), please feel free to ask. If you have any suggestions for improvement, please let me know. :)


Thank you i will write here all i have in my mind:
1)i'd like to use different dices for different games.
if il play monopoly i use regular 1d6
if i play Star wars Imperial assoult i use this type of dice:
https://vborg.vbsupport.ru/external/2017/05/1.png

So i have to discrimiate them using [ dice=swia] for imperial assault

2) i'd like to have also the way to use different dices as 1d4 1d8 1d20 1d100 and how much i want 3d8, 2d4 10d100

3) a way to not let the user change the roll he has done.

4) can sum the rolls example: [sroll]3d6 and have in output 6-3-1 tot= 10

5) can change the output from images to numbers

6) is it possible also to customize/create dices via admincp?

MarkFL 05-03-2017 03:45 PM

Quote:

Originally Posted by Tri@de (Post 2586146)
1)i'd like to use different dices for different games.

2) i'd like to have also the way to use different dices as 1d4 1d8 1d20 1d100 and how much i want 3d8, 2d4 10d100

What you need to do if create/find or otherwise obtain sets of images that show each face of an individual die. For each set, the image file names need to begin with the same string of text and end with a number corresponding to the value of the face.

You may have noticed that the default set I include had the names:
  • dice-1.png
  • dice-2.png
  • dice-3.png
  • dice-4.png
  • dice-5.png
  • dice-6.png

In the product settings, I gave this set the identifier "1" by including the line:

1|dice-*.png

This means your users can use the following code:

[roll=1]5d6[/roll]

to get 5 six-sided dice randomly generated.

So, to use other sets, you need to upload the image set, with the files appropriately named, to the folder "images/dice" on your server, and then include the identifier string in your settings.

Quote:

Originally Posted by Tri@de (Post 2586146)
3) a way to not let the user change the roll he has done.

The only way I know to do that is to prevent your users from being able to edit their posts. I will add a setting that allows you to make this product active only in selected forums, and then for those forums, you will need to edit the forum permissions for each usergroup you don't want editing their posts.

Quote:

Originally Posted by Tri@de (Post 2586146)
4) can sum the rolls example: [sroll]3d6 and have in output 6-3-1 tot= 10

I can make that an option, and display the output in tabular format.

Quote:

Originally Posted by Tri@de (Post 2586146)
5) can change the output from images to numbers

Do you mean once the post has been made, you want the ability to change the post so that numbers are shown rather than the images?

I'll wait until we get all these issues sorted out before updating the product. :)

Tri@de 05-03-2017 04:32 PM

1) 2) Ok i understood!
3) ok. i use as it is. if i see modified post i'll ban! :D
4) yes as an option is the best way.
5) Not after but before

example:
if i type [noparse][niroll=1]3d6[/niroll][noparse] i will see 2/6/4 instead of thee images.

I renew my thanks to help me.
You made a great mod!

MarkFL 05-03-2017 04:42 PM

Quote:

Originally Posted by Tri@de (Post 2586163)
...3) ok. i use as it is. if i see modified post i'll ban! :D

Depending on your settings, your users may be able to quickly edit their post without it showing it has been edited. :)

Quote:

Originally Posted by Tri@de (Post 2586163)
4) yes as an option is the best way.

Okay, I will add that.

Quote:

Originally Posted by Tri@de (Post 2586163)
5) Not after but before

example:
if i type [niroll=1]3d6[/niroll] i will see 2/6/4 instead of thee images.

I renew my thanks to help me.

That sounds like it would be almost the same as the "sroll" option, except without the sum. I will add that as an option as well.

I will also go ahead and add the option to select forums in which the product is active. Look for the update within the next 24 hours. :)

Dave 05-03-2017 04:57 PM

You're way too nice Mark. :^)

MarkFL 05-04-2017 12:03 AM

1 Attachment(s)
I have attached the updated product .XML file...give that a go and let me know what you think. :)

MarkFL 05-04-2017 01:49 AM

1 Attachment(s)
Here is a version that is more "tamper-proof"...when a user posts a dice roll, the text "Legitimate Dice Roll" will appear above the roll (you can change this text by editing the phrase "markfl_diceroll_legittext").

If a user tries to cheat and construct their own dice roll by entering the appropriate image/table BBCodes with that text above it, the text will be removed. If the post is edited, that text will also be removed. :)


All times are GMT. The time now is 08:14 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01193 seconds
  • Memory Usage 1,748KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete