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
  #72  
Old 05-27-2006, 11:24 AM
akanevsky akanevsky is offline
 
Join Date: Apr 2005
Posts: 3,972
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Although I see no practical use for me, this is a very nice hack technical-wise.
Reply With Quote
  #73  
Old 05-27-2006, 02:42 PM
Eq4bits Eq4bits is offline
 
Join Date: May 2006
Posts: 468
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by cclaerhout
Well, here is a preview of "RPG DiceRoller". I still have to work on the user interface.

You want to play a D4 ?
[dice=1]4[/dice]

You want to play a D6 ?
[dice=1]6[/dice]

You want to play a D8 ?
[dice=1]8[/dice]

You want to play a D10 ?
[dice=1]10[/dice]

You want to play a D12 ?
[dice=1]12[/dice]

You want to play a D20 ?
[dice=1]20[/dice]

Other dices won't work because pictures don't exist

N.B : Pictures are in png format. To avoid grey line arround them in Internet Explorer 6, you need a png transparency hack (available here). Otherwise i could do a gif release.
So you can only roll 1 dice at a time with this version? Any way to make it work to ALWAYS roll a die with 6 faces but make the # of dice variable? i.e.
[dice=1]6[/dice]
[dice=2]6[/dice]
[dice=3]6[/dice]
[dice=4]6[/dice]
[dice=5]6[/dice]

That's what Emmy2 is looking for.
My group uses anywhere from 1-9 dice and anywhere from 2-100 faces, I was TRYING to just make a new bbcode button in the admincp bbcode manager, i could get the button image to work, but when you'd click it and vB asks you to input the number for the {option} the result would look like:

[DICE="4"][/DICE]

you still had to put the 'face' variable/option/param in physically between the two sets of brackets, but the quotes vB automatically put around the #ofdice of course kept it from working, was having trouble with the 'html' part in the 'add bbcode' panel also..

*sigh*... I just have to face it somethings I *can* do and some I just don't have the knowledge for.. I'm just belligerant and keep at it though... till I'm cross-eyed... LOL

I didn't realize IE put grey borders around gifs, i've never noticed it before.... hmmmm
If anyone wants me to turn the 1-100 Blue Dice in pentagonal shape (that I did as Rukbat) into png's let me know and I'll do a batch conversion and re-zip & re-upload here.
Reply With Quote
  #74  
Old 05-27-2006, 02:45 PM
Eq4bits Eq4bits is offline
 
Join Date: May 2006
Posts: 468
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

cclaerhout,
One more question...
is the 'roll' still stored in the d/b?
Reply With Quote
  #75  
Old 05-27-2006, 03:27 PM
Emmy2 Emmy2 is offline
 
Join Date: Jan 2004
Posts: 83
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There now seems to be several of you working on variations for this, and that's great! So, not to sidetrack everyone but I have a few more ideas....

Suppose I wanted to install this hack more than once, what would I need to change in the original xml file? In other words I want one hack called "dice" and another hack called "cards" that does the same thing but uses separate database tables and images. So for example, I can have one game that throws dice and another game that draws playing cards. Or another game that rolls letters of the alphabet.

In other words, suppose I want 3 separate games. Dice, Cards, Alpha, if you want to name them. What parts of the original script could I change so that I can install this game a second and third time (in a different place, not overwriting the first game)?

Then, to play, users would type (or I'd create buttons for):

[dice=5]6[/dice]
to roll a 6 sided dice five times

[cards=5]52[/card]
to draw 5 cards from a 52-card deck

[alpha=9]26[/alpha]
to roll 9 letters out of the 26 letter alphabet

I'm dreaming big here folks! :P

Another idea....suppose for the card game users are drawing 5 cards and I don't want them to draw the same card twice (this could also apply to dice). Is there a way to limit it so the same card/dice isn't drawn/rolled more than once in a roll of multiple die or cards?

Yeah, this is all pretty much off-base for the current project, but I thought I'd just throw these ideas out there.
Reply With Quote
  #76  
Old 05-27-2006, 04:31 PM
cclaerhout's Avatar
cclaerhout cclaerhout is offline
 
Join Date: Aug 2004
Location: Paris (France)
Posts: 448
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Eq4bits
So you can only roll 1 dice at a time with this version?
No, as many as you want.

The dice are still in database.
Reply With Quote
  #77  
Old 05-27-2006, 05:00 PM
Eikinskjaldi's Avatar
Eikinskjaldi Eikinskjaldi is offline
 
Join Date: Feb 2006
Location: Hell, never looked better
Posts: 572
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well a standard deck has 52 cards so you bbcode would probaly look more like [cards]5[/cards]. With private text you could be on your way to having poker in threads. as far as limiting it, ya, it could be limited, it'd be as simple as stoirng the values in a array and testing to make shure none equal eachother.

However back on dice, Another idea is a prompt box which you can enter the number to roll after having selected the sides from a drop down.I'll look into that avenue. I am going to making a steep departure from the old system of rolling dice as it doesn't work for me, so this drop down idea won't work for me, in any case, all that well. Seeing as I help run one of the largest gaming sites for PbP it isnt easy to keep everything simple. A sample new style roll would be:
[dice=Dice Title]1d20 1d20 1d6[/dice]

Which would provide a much cleaner more cingular less bulky output. I also don't want images, so I will probaly provide to XML's, one with them and one without. If you visit my forum and check out some of the dice rolls you can see the output I will probaly be aiming for as I want to try and keep my dice standard.

The cards thing shouldn't be to hard and i'll look into it if I have time.
Reply With Quote
  #78  
Old 05-27-2006, 10:32 PM
cclaerhout's Avatar
cclaerhout cclaerhout is offline
 
Join Date: Aug 2004
Location: Paris (France)
Posts: 448
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here is the kind of interface i'd like. It would be a popup. I'm going to ask Michelle if she can help us.
Reply With Quote
  #79  
Old 05-28-2006, 07:38 AM
cclaerhout's Avatar
cclaerhout cclaerhout is offline
 
Join Date: Aug 2004
Location: Paris (France)
Posts: 448
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Michelle is sorry but she doesn't have time to work on this. If an advanced coder can have a look, it would be nice.
Reply With Quote
  #80  
Old 05-28-2006, 11:49 PM
Emmy2 Emmy2 is offline
 
Join Date: Jan 2004
Posts: 83
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Could the "onclick" command be used in conjuction with an image button to insert the roll into the textarea?

I've been looking at the smilie code and that's what it does. Click a smilie and it inserts something like :smilie: into the text box. Instead of :smilie: I need it to insert the code for a dice roll.

So something like this to create a button (this is just me expressing my idea, it is NOT real code):
Code:
<img src="http://www.mysite.com/dicebutton.gif" onclick="return value('[dice=5]6[/dice]')">
Then I think you'd have to create a little javascript to put in the page head for the onclick command, right? Can anyone help with this? I'm really keen to get it working.
Reply With Quote
  #81  
Old 05-29-2006, 05:48 PM
Emmy2 Emmy2 is offline
 
Join Date: Jan 2004
Posts: 83
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by cclaerhout
Michelle is sorry but she doesn't have time to work on this. If an advanced coder can have a look, it would be nice.
I'm not a coder but I think I did it! I've created code that will add an image button or a regular button to the quick reply and regular editors that when clicked by user automatically inserts the text for one pre-defined dice roll. It doesn't have a drop-down menu for multiple options, but hey it's a start! And maybe with the base code in place someone can look at it and see how to add a menu. All I did was research on google and played with some code I found and kept testing and this one finally worked.

I will post the code late tonight when I get home from work...I have been working on this all day.

:banana:
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 11:23 PM.


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.04910 seconds
  • Memory Usage 2,320KB
  • 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
  • (1)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