Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Dice Roller Hack [BBCode] Details »»
Dice Roller Hack [BBCode]
Version: 1.00, by Eikinskjaldi Eikinskjaldi is offline
Developer Last Online: Jul 2023 Show Printable Version Email this Page

Version: 3.5.4 Rating:
Released: 04-24-2006 Last Update: 05-29-2006 Installs: 51
DB Changes Uses Plugins Template Edits
Additional Files  
No support by the author.

Dice Roller Hack [BBCode]
RPG Dice is currently a updated version
Another updated version

Note: Updated package includes only the correct XML.

This hack is a port of: Dice Roll for vB3 and permissions was given to port by the following statement.

Quote:
Info for hackers:
You may modify, improve, upgrade, redistribute this hack, include it
in another hack or yours or translate it provided you do it free of
charge and you distribute it in www.vbulletin.org at least, there is no
need to pm me asking for permission.
This hack rolls a Graphic based dice roll in your post and features multiple dice rolls per post. The images are fully editable by those who know how and I must agree that I very much think they need an overhaul, so go for it.

The basic bbcode format is:
[dice=X]Y[/dice]

X - The number of dice to roll, This cannot be larger then 5 currently, this may change later with demand.
Y - The number of sides on the dice.

so [dice=1]6[/dice] Roll's 1, 6 sided dice.

The only limit that I have noticed so far is that dice will not apear correctly when rolled from the create thread editor. I am unsure as to why this is still and am working on this issue. However aside from this it is working as need be. This hack is mainly useful to Game websites that require dice rollers for gambling or roleplaying games. It can add an element of fun to a forum and is adapatable to most dice require situations.

If enough demand is displayed I will work on removing the 5 roll limit or making it larger. The current maximum sides one can roll is 30.

If you enjoy this hack or have it installed, then please click the install button so that you can remain informed when updates occur.

As the original author said, You do not need to ask permission to update or do anything to this hack and can redistribute it if you feel you have made a great contribution to it.

If someone does make new dice images and wishes to have them as part of the package then either post here or PM me and I will get them in there with full rights going to the sender for the images.

Updates:
  • 04/29/06
    • Added new dice images which where provided by Rukbat.

This hack was requested from: https://vborg.vbsupport.ru/showthread.php?t=97775

-Eikinskjaldi-

Original Screenshots:
https://vborg.vbsupport.ru/attachmen...3&d=1078098688
https://vborg.vbsupport.ru/attachmen...4&d=1078098702

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #122  
Old 06-01-2006, 01:20 AM
cclaerhout's Avatar
cclaerhout cclaerhout is offline
 
Join Date: Aug 2004
Location: Paris (France)
Posts: 448
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Eikinskjaldi
I said yes a page back....
You said i can translate it but not distribute it in french vB forum


Quote:
Originally Posted by Emmy2
Emmy 2 is a her.
Sorry
I will correct it in the archive.
Reply With Quote
  #123  
Old 06-01-2006, 01:32 AM
cclaerhout's Avatar
cclaerhout cclaerhout is offline
 
Join Date: Aug 2004
Location: Paris (France)
Posts: 448
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Corrected
Reply With Quote
  #124  
Old 06-01-2006, 11:54 AM
Emmy2 Emmy2 is offline
 
Join Date: Jan 2004
Posts: 83
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks cclaerhout!

Just an update on what I'm doing...

Remember I spoke of installing this mod more than once to play different games? Well, I took cclaerhout's 2.0 xml file version of the script (the one WITHOUT the user interface), here in this post:

https://vborg.vbsupport.ru/showpost....8&postcount=69

and replaced all instances of "dice" with "playcard". Then I installed it and it created a new game using [playcard] as the bbcode. (I also changed the maximum number of images from 30 to 52 in the xml file).

I found a nice set of public domain card images to use here:

http://www.greywyvern.com/webslavent?msg=183

I renamed them 1.png through 52.png. Then I had to change the playcard template to $points.png instead of $points.gif since the images are a different format. Then I used Eikin's drop down script to code a menu to choose how many cards to draw out of the deck.

I'm also going to do the same thing with "alphadice"...that is, install a version of the game that rolls alphabet letters instead of numbers.

The possibilities for games are endless. My forum is not an RPG. But users could do something like this....roll a dice (a number) and an alphabet dice (a letter)...then you have to make up that number of words beginning with that letter that pertain to the tv show (my forum is about a tv show). So, roll a 5 and a B...5 words that start with B about the tv show. We could play boggle with the alphabet or hold lotteries with numbers.

Just lots of variations for games to come up with.

My toolbar menu is attached (it would only show in the Games forum, using cclaerhout's array code). First there's the "dice" game, then "alphadice", then "playcard". This is just a mock-up...I'll try and get better images.

Because each game (dice, alphadice and cards) has a set number of "faces" in my setup (my dice have 6 sides, there are 26 letters in the alphabet, and 52 cards in a deck) so my drop down menu only contains the number of rolls to make (or cards to draw).

So long story short, I now have several games and combinations of games to play on my forum. The only thing I need is an adjustment to the card script that would allow only ONE instance of each card per thread (there can't be two aces of hearts in a game).

So....[insert pleading voice here] can anyone help me to tweak the script for that game so only one instance of each card is drawn per thread? I am SO CLOSE to having a complete game feature for my members to use...just need that one final element. Anyone?
Reply With Quote
  #125  
Old 06-01-2006, 12:28 PM
Ziki's Avatar
Ziki Ziki is offline
 
Join Date: Nov 2005
Posts: 2,704
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So does this work now?(Not RPG dice)
Reply With Quote
  #126  
Old 06-03-2006, 03:44 PM
Emmy2 Emmy2 is offline
 
Join Date: Jan 2004
Posts: 83
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

As far as I know all the bugs are worked out.

Another question...

Any idea how I use text instead of images for the results of the dice roll? I think someone mentioned they were doing this. I get as far as creating 1.txt, 2.txt, 3.txt etc. files but then I don't know how to modify the templates so it uses the text in those files instead of an image url.

Any ideas?
Reply With Quote
  #127  
Old 06-08-2006, 11:35 AM
Emmy2 Emmy2 is offline
 
Join Date: Jan 2004
Posts: 83
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't know if anyone needs this, but I believe we concluded that the number of dice faces could only go up to 100 (if you altered the code from the original 30 to 100). However, I think I just made mine able to go higher. Here's how:

In dice_process_data change this:

Code:
preg_match_all("/\[dice=([1-5])\]([0-9]?[0-9])\[\/dice\]/",$post['message'],$diceresult);
to this:

Code:
preg_match_all("/\[dice=([1-5])\]([0-9]?[0-9]?[0-9])\[\/dice\]/",$post['message'],$diceresult);

and then change this line further down to however fany faces you want (where my 999 is):

Code:
if ($faces[$i] >= 2 && $faces[$i] <= 999)
Again, provided you have images up to whatever maximum number you choose.

It seems to work on my board. Does that seem like correct code?
Reply With Quote
  #128  
Old 06-08-2006, 11:58 AM
Eq4bits Eq4bits is offline
 
Join Date: May 2006
Posts: 468
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeah, that's it... I was only interested in taking it to 100 as that is the most my members needed and added the extra '?[0-9]' in another post for code change. and you *may* actually want to add another '?[0-9]' in there. If a person were to roll more than 1 die of 999 faces you'd probably need the extra integer placing... for the resulting points....
Reply With Quote
  #129  
Old 06-09-2006, 10:37 AM
soravok soravok is offline
 
Join Date: Dec 2005
Location: Vancouver, BC, Canada
Posts: 25
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is the first post in a thread issue fixed and is the mod file for download finished? As in I don't need to feed through the thread here in order to make it work.
Reply With Quote
  #130  
Old 06-10-2006, 08:27 PM
Eq4bits Eq4bits is offline
 
Join Date: May 2006
Posts: 468
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

it depends on if you want the basic one or the one with the fancy interface. For the basic use THIS ONE
you may still need to go in and change the 30 for the 'faces' to 100 or whatever it is you may need as well as adding the extra '?[0-9]' as described above in Emmy2's post;
for the fancy interface one cclaerhaut made look at post #117 on page 8 of this thread.
be sure to upload the dice images too
Reply With Quote
  #131  
Old 06-12-2006, 02:48 AM
soravok soravok is offline
 
Join Date: Dec 2005
Location: Vancouver, BC, Canada
Posts: 25
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Database error in vBulletin 3.5.4:

Invalid SQL:
ALTER TABLE `thread` ADD `dice` MEDIUMTEXT NOT NULL;

MySQL Error : Table 'mouldyskull.thread' doesn't exist
Error Number : 1146
Date : Sunday, June 11th 2006 @ 11:46:28 PM
Script : http://mouldyskull.com/admincp/plugin.php
Referrer : http://mouldyskull.com/admincp/plugin.php?do=productadd
IP Address :
Username : aaron
Classname : vb_database
I just tried to install the new version and that's what happened when I tried to import it via product manager, any suggestions?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:14 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05253 seconds
  • Memory Usage 2,322KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_code
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete