![]() |
Dice Roller Hack [BBCode]
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:
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:
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 |
Click Install
|
When I test:
Code:
Fatal error: Field dice is not defined in $validfields in class vb_datamanager_post in /includes/class_dm.php on line 485 |
Are all four plugins installed and turned on? You need to ensure that the valid fields for threads and posts is there and activated or the DM will go crazy.
|
Ah, I found the issue, I had in my rush placed two plugins in the wrong product. I have reuploaded the product with the correct plugins.
|
thanks, I'll remove the old and reimport the new product and test, thanks again for the hack
|
new problem, this time is database related
Code:
Database error in vBulletin 3.5.4: |
Same as above.
|
I just downloaded and imported via Product Manager. However a parse error flashes on the screen and then is replaced by the 'installed products' screen. error flashes so fast I can't write it down or remember the whole thing.
I checked the plug-ins, there were 4 installed on the product import/upload/install, and yes all 4 are checked as 'active'. When I test in a post (and it's a reply NOT a first post) I get the following: Code:
Database error in vBulletin 3.5.4: |
Sick! Thanks for the hack! :)
|
Now that I'm not so tired I thought of another question regarding my error message above. What MySQL d/b changes were made? Which table needs new fields and what would the names be to look for to be sure they are there?
EDIT 9:07 CDT Okay, I went into phpMyAdmin and checked my forum tables '******_thread' and '******_post' and neither table has a 'dice' field. so do I edit the xml file and change Code:
<codes> Code:
<codes> EDIT: 9:46am CDT That didn't work, BUT, once i went in to phpMyAdmin and added the fields to the two tables it works GREAT! :D so I guess there's something in the code in the xml file that didn't actually ALTER my tables.... or was there something else in the xml file that i didn't find where I should have typed in the name of the d/b? I assumed since it was imported/installed using the vB AdminCP that it would 'know' that was the d/b to alter the tables in...... |
I'm working on making some new images for the die, playing with colors
examples below |
I got this error
Quote:
|
Ziki-set,
I was having the same problem. For some reason the installer isn't altering your forum database tables (_thread & _post). You need to go into your database and physically add the 'dice' field (mediumtext not null) to those two tables. That fixed the problem for me. Also, before installing I corrected some wording in the xml file to correct 'dices' to 'die' because it 'bugged' me: FIND Code:
<td><smallfont><b>Dice roll with $dicesno dices of $dicesfaces faces: $dicepoints points</b></smallfont></td> Code:
<td><smallfont><b>Dice roll with $dicesno die of $dicesfaces faces: $dicepoints points</b></smallfont></td> FIND Code:
if ($faces[$i] >= 2 && $faces[$i] <= 30) Code:
if ($faces[$i] >= 2 && $faces[$i] <= 100) Hope this helps :D EDIT: 3:30pm CDT hmmmm, that works up to '99' faces but can't get it to work for '100'..... *wanders off to ponder a bit* EDIT: 3:47pm CDT got it to work FIND: Code:
preg_match_all("/\[dice=([1-5])\]([0-9]?[0-9])\[\/dice\]/",$post['message'],$diceresult); Code:
preg_match_all("/\[dice=([1-5])\]([0-9]?[0-9]?[0-9])\[\/dice\]/",$post['message'],$diceresult); |
Ya, the install code seems to be errored, I'll work on it and upload the right installer, Thanks rukbat for posting the little mods for others. I might have messed that part up as well.
EDIT: Upload XML fixed with the correct queries. Sorry about that. |
Now it doesn't show the dices.I imported it and it doesn't show the dices but only the [dice=2]5[/dice]
|
Did you FTP the dice images into a 'dice' folder in images at your site?
Also, go into your PlugIn Manager in your vB admincp, look to be sure all the plug-ins for 'Dice Roller' are checked as 'active'. Did you 'unistall' via product manager before installing again? |
oops also, you can't create a thread with a post that includes a dice roll
only replies can include the dice roll easy solution: create a new thread i.e. title: dice roller test text in post: this thread is to test the dice rollersubmit the new thread then post a reply/quick reply to it, including the dice roll bbcode |
Yes, I need to find the right place to inser the code for the first post, I looked in my quick porting of the hack but didn't find it. It's as simple a fix as inserting the code before the first post is output.
|
Don't know how high you would be able to go, but here's one vote for more than 5 dice.
|
Well we can go up to as many as you want, but it will mean changing the dbase field to hold more data because its currently med.
|
You are missing the .thread table :)
|
One of my members mentioned 20. Whether that's a good idea or not from a coding standpoint I don't know. Also, Rukbat, would you be willing to post your dice up to a higher number?
|
sure
what color? pentagonal or 'square'? and up to what number? |
this might be a better way to compare
|
Those pentagonal ones are pretty kick arse. If you decide to make a public release i'll add them to the package with credits to you, because if you ask me the ones it comes with are yuck...
|
I've made 2 sets (a white set & a blue set) of the pentagonal dice (in gif format) both sets up to 30; as well as a 'blank' white and a 'blank' blue in both gif and png formats so if anyone wants/needs higher face values they can make them (or they can pm me and I will when I have time). I used Tolkein font for the numbers in black.
Both sets are in the attached 'dice.zip' file (at least I hope I zipped it and attached it correctly... I don't do much zipping.. mainly unzipping...heh) |
i'll work on higher numbers for both those sets later today, and also make a few more colors. will zip and attach when done. guess I'll go up to 100?
maybe put a txt file with the original hack download that they only have to upload the dice set they want to use as well as only uploading the individual gifs for the number of 'faces' they will be using. a thought... to increase the max number of die rolled from 5 to say 9 would the 'mediumtext' attribute still be okay? would the below be coding to change? FROM Code:
preg_match_all("/\[dice=([1-5])\]([0-9]?[0-9]?[0-9])\[\/dice\]/",$post['message'],$diceresult); Code:
preg_match_all("/\[dice=([1-9])\]([0-9]?[0-9]?[0-9])\[\/dice\]/",$post['message'],$diceresult); *note above from my moded xml file so '100' will display |
Does this work for someone?Doesn't for me
|
You may need to ensure the database fields are all there and that all the plugins and bnoth templates where added. I have uninstalled and reinstalled it a few times on my test board with no issues. Rukbat made some good suggestions on the previous page.
I'll go add the extra zip into the other and make note of it, anything specific you want to go with your username in the readme file? If not i'll just use your vb.org username. As for making it accept more chars, yes, that should work, I havn't looked into it in detail, It shouldn't be very hard since the code is quite strait forward. |
Quote:
First thing to do is check your database and be sure the 'dice' field was added to both the 'thread' and 'post' tables. When you test it you can't start a thread with a post that includes a dice roll, unless Eikinskjaldi figured out how to fix that problem, the hack had that problem even when it was for 3.0.7 before it was ported here. EDIT: 10:32pm CDT Be sure the path to the dice image files is correct in the xml file before importing it. the default is /images/dice. Check and be sure you uploaded/ftp'd the gif files to dice folder in images folder. That's all I can think of for now. |
The pentagonal ones are a definite improvement. I think I'll use the blue ones.
|
I'm working on 31-100 right now in the blue ones.
|
okay, here it is blue pentagonal dice numbered 1-100
|
just a note changing the 1-5 to 1-9 doesn't work for increasing the number of die to roll...
|
I'll look into it later, its 5 AM here and my experience is that working this late, well early, isnt generally good for your coding prospects.
|
Thanks for the new dice.
The 1-9 change works for me to get it up to 9. |
dang it! what did you do to get it to roll 9 die at once?
I've gotten it to roll 10 separate times in a single post but only up to 5 die.... EDIT: n/m, i got it to work up to 9 die, now going to go for 10 |
So you have still prob with the Db table adding?
|
who me?
I just went into PHPmyAdmin and added the fields to the ***_threads and ***_posts tables myself. Not sure if the problem within the product was resolved or not, anybody install this since Eikinskjaldi updated the xml file? |
All times are GMT. The time now is 06:05 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|