Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons

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
  #92  
Old 05-30-2006, 07:52 PM
Eikinskjaldi's Avatar
Eikinskjaldi Eikinskjaldi is offline
 
Join Date: Feb 2006
Location: Hell, never looked better
Posts: 572
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

....and another variation that requires less work from you but a little more from the users:
Code:
<script type="text/javascript">
function dropDownDice(obj,obj2){
    var diceToRoll = document.getElementById(obj).value;
    var faces = document.getElementById(obj2).value;
    document.getElementById('{$editorid}_textarea').value += '[dice='+diceToRoll+']'+faces+'[/dice]';
}
</script>

<td><select id="{$editorid}_dicetoroll">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
</select></td>
<td><span style="color:black;"><b>D</b><span></td>
<td><select id="{$editorid}_dicefaces">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
</select></td>
<td><input type="button" onClick="dropDownDice('{$editorid}_dicetoroll','{$editorid}_dicefaces');" value="Add Dice" /></td>
same rules apply as above, Attaching a screenshot of this one since it is a little different.
Reply With Quote
  #93  
Old 05-30-2006, 09:26 PM
Eq4bits Eq4bits is offline
 
Join Date: May 2006
Posts: 468
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

so these only work with quick reply or the non advanced wysiwyg editor? or it won't even work on quick reply if the other is enabled?
Reply With Quote
  #94  
Old 05-30-2006, 09:44 PM
cclaerhout's Avatar
cclaerhout cclaerhout is offline
 
Join Date: Aug 2004
Location: Paris (France)
Posts: 448
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

RPG DICE IS READY !

That's good, i've finished my job Sorry for the delay, i had a busy day.

So what's new :
-sql problem is fixed
-dice in first thread are working
-new user interface integrated in Quickreply and in Editor tool bar


And the best for the end :

Everything is automatically installed with the xml product file


To see the result, have a look at the pictures.

P.S : I'd like to know if i can translate and distribute this hack to vbulletin-fr for french users.


EDIT : files removed for a new release.
Reply With Quote
  #95  
Old 05-30-2006, 10:00 PM
Emmy2 Emmy2 is offline
 
Join Date: Jan 2004
Posts: 83
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

wow, all of the menus look great! I'll be studying them and figuring out which one to add to my site. So glad we were able to figure something out for this...will really make it easier for the game players.

Quote:
Originally Posted by Eq4bits
so these only work with quick reply or the non advanced wysiwyg editor? or it won't even work on quick reply if the other is enabled?
I think he just means the wysiwyg editor will simply show the dice bbcode in the textarea, not actually "execute" it live like it does for other bbcode functions. Am I right on that?


Is this a good time to re-ask one last question I have? I mentioned it before in another post. But I would like to install this hack more than once, to use to play different games that have different images...numbered dice, playing cards, rolling alphabet letters. If I took the xml file and changed every instance of "dice" to "dice2" and then imported it would I get a second installation of the game that uses [dice2] as the bbcode? Would that work? Or can someone rewrite the code using "cards" and "alpha" instead? Thanks for any help.
Reply With Quote
  #96  
Old 05-30-2006, 10:38 PM
Eikinskjaldi's Avatar
Eikinskjaldi Eikinskjaldi is offline
 
Join Date: Feb 2006
Location: Hell, never looked better
Posts: 572
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, in theory if you changed all that it would make a new bbcode, but of identical function. you'd need to add new templates as well if you wanted to change output and modify the code for cards to some extent.

You can translate this into any langauge you'd like, but it isnt done yet. I like the drop down below but I prefer my own method as its smaller, to each his own.

When i attempted the use of it in a WYSIWIG it did not apear in the editor because you have to write special code from what i recall to handle the WYSIWIG. That is something a little more complex then this simple JS. It should in theory show up but unparsed. I may look into this later. In a few hours when i have this other work done i am going to tackle the code and rip it to pieces for my own uses which does sort of render the buttons as useless to some extent but I will see what I can do.
Reply With Quote
  #97  
Old 05-30-2006, 10:42 PM
cclaerhout's Avatar
cclaerhout cclaerhout is offline
 
Join Date: Aug 2004
Location: Paris (France)
Posts: 448
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just to say that i've also got the wysiwyg problem.
Reply With Quote
  #98  
Old 05-30-2006, 10:55 PM
Emmy2 Emmy2 is offline
 
Join Date: Jan 2004
Posts: 83
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

speaking of modifying the code for cards....I guess what I'd need is something that assures that the same card isn't drawn twice (suppose you draw 5 cards...two of them can't be the ace of hearts...unlike dice, where you CAN roll the same number twice). I don't suppose anyone here would know how to make that modification? :hopeful:

Oh, oh, oh....just had another idea. What would be ideal for cards is if the same card couldn't be drawn more than once in EACH THREAD. That way if you're playing a card game, taking turns drawing from the deck, you don't get cards repeating themselves, no matter who is doing the drawing. If each thread was a new game, then limiting it to one draw of each card PER THREAD would be the way to go. I would absolutely love this....any possibility?
Reply With Quote
  #99  
Old 05-30-2006, 11:33 PM
cclaerhout's Avatar
cclaerhout cclaerhout is offline
 
Join Date: Aug 2004
Location: Paris (France)
Posts: 448
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

To avoid the wysiwyg problem, just tell for the moment your members to click "A/A" in the top right corner of the editor to make dice buttons work.

To see RPG Dice in action go there : www.lesatirique.info/forum/showthread.php?t=2421
Reply With Quote
  #100  
Old 05-31-2006, 12:43 AM
Eq4bits Eq4bits is offline
 
Join Date: May 2006
Posts: 468
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the work around cclaerhout, or should I say Merci?
One more question, on your interface can you 'mix' the different dice in one roll? i.e. 1d5 1d10 1d20 (1 for # of dice,d for dice, 5/10/20 for # of faces) did that make sense?
Reply With Quote
  #101  
Old 05-31-2006, 01:23 AM
Eq4bits Eq4bits is offline
 
Join Date: May 2006
Posts: 468
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Eikinskjaldi
To add a new dice just add:
Code:
<option value="Number of dice to roll;Number of faces">Descriptor</option>
where in the template does one put that option value? which template?
Reply With Quote
Reply

Thread Tools

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 01: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.05781 seconds
  • Memory Usage 2,315KB
  • Queries Executed 27 (?)
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
  • (2)bbcode_code
  • (3)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
  • (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_postinfo_query
  • fetch_postinfo
  • 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