The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Dice Roll for vB3 Details »» | |||||||||||||||||||||||||
Tested in 3.0.7
Update: The hack has been updated with new instructions, to allow more than one roll per post. If you are updating Please undo the file edits from the previous version before applying the new one. If you are installing this for the first time you're ok. This hack is most useful to roleplaying communities, but you can also have fun with it in any forum. It implements a new code, [dice] with which you can do a dice roll. You can roll as much as 3 dices of 30 faces and as less as 1 dice of 2 faces. Once you roll the dice it is stored in the post so you cannot roll again even if you edit the post or whatever. Please keep in mind the [img] tag should be disabled in the forum where the dice tag is going to be used. It is not mandatory and the hack will work even with the [img] tag enabled but to prevent cheating I would recommend it. How to use it: [dice={dices}]{faces}[/dice] Example: [dice=2]25[/dice] This will roll two dices of 25 faces each one [dice=1]6[/dice] This will roll one dice of 6 faces I am attaching a zip with some sample images.. they are not the best ones but they are dices and show the numbers. If someone could make a new set of dices "prettier" than the ones I got I would be grateful 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 Some portions of the code are (c) Jelsoft Enterprises Ltd. Show Your Support
|
Comments |
#12
|
||||
|
||||
Has not this hack already been done by Madacc at https://vborg.vbsupport.ru/showthrea...highlight=dice for vb2.xx?
I am not saying this is a ripoff of that code. I am just saying that if this hack worked more like that hack, it would be very cool. Instead of images, have it just do it in text. Maybe if we could ember the roll dice command inside of an existing post, that would be awesome. |
#13
|
||||
|
||||
Quote:
I have no use for only text, I want the dice to be shown as an image, also I like my syntax to throw the dice so I will stick with it I don't know if it is the best one to use but it sounded logical when I designed it. |
#14
|
||||
|
||||
Quote:
look for Code:
$dice = eregi_replace(".*\[dice=([123])\]([0-9]?[0-9])\[\/dice\].*","\\1 \\2",$post['message']); Code:
$dice = eregi_replace(".*\[dice=([123456])\]([0-9]?[0-9])\[\/dice\].*","\\1 \\2",$post['message']); Code:
$post['message'] = preg_replace("/\[dice=[123]\][0-9]?[0-9]\[\/dice\]/i","[dice]",$post['message']); Code:
$post['message'] = preg_replace("/\[dice=[123456]\][0-9]?[0-9]\[\/dice\]/i","[dice]",$post['message']); |
#15
|
||||
|
||||
Quote:
Then no matters if the user edits the post they can no longer change the dice roll, in fact, they only see a [dice]. The results have been already been stored with the post in the database. The only think they could do is to "delete" the dice roll. |
#16
|
||||
|
||||
Quote:
Great would be a option where I can put in the posiible sidenumbers comma seperated. |
#17
|
||||
|
||||
Hey, there are some undocumentated features in the Code.
I modified my postbit_dice that it shows which dices were rolled. HTML Code:
<fieldset> <legend><strong>$dicesno W$dicesfaces</strong> mit $dicepoints Augen</legend> $dicedata </fieldset> |
#18
|
||||
|
||||
I'll take a look at this. I have a custom dice roller I wrote for phpbb. It handled Hero dice (STUN/BODY), Deadlands, Open Ending, and others. It worked great in phpbb, but I am new to vB so I just have to figure out where to move the functions and what not.
It doesn't store the rolls in the DB, but that hasn't been an issue on our board so I'm more looking for the functionality. If I get some time, I will try to convert it. On the DB storage: I don't think that will work unless you tie the message ID to the store, and even then someone could create a new message anyway. If you had the [roll] code generate a result and store it in the DB, referencing by some kind of record ID, the roller could just delete the record ID and reroll anyway. I think the bottom line is to either a) disallow editing at the forum level or b) make it known that any edited post with a roll will be considered a failed roll/minimum roll (forcing a reroll just means the people who roll crappy will edit their post so they will *have* to reroll). a) is the easiest solution. |
#19
|
||||
|
||||
It works perfectly how it stores the dice-rolls. Nothing can changed later. But you even can edit your Post.
The Roll ist stored in an extra Database-field of each Message. |
#20
|
||||
|
||||
Well, if I get a bad roll why not just delete the whole message and then roll again in a new message?
What about multiple rolls in a single message? |
#21
|
||||
|
||||
If you can delete your Post, you can do it. But I idsallow Postdeleting.
Only one Roll per Post is possible. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|