vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Dice Roller Hack [BBCode] (https://vborg.vbsupport.ru/showthread.php?t=113972)

Campbell 06-25-2006 02:05 AM

Alright, I think I have part of the problem then.

You say above that you did not use RPG dice, but the cclaerhout dice were packaged with RPG Dice in post 117. I believe this is part of my confusion.

What exactly did you install and in what order? If it's working for you it should for me; but the frenetic nature of this thread is confusing.

I have since removed those test threads. But would welcome your input or testing if you wished.

Best,
A

Eq4bits 06-25-2006 02:17 AM

This is the xml file I use (attached) BUT before installing you'll have to uninstall the other AND open the xml file and change the ***_post and ***_thread in the 'Alter Table' parts at the beginning to have the *'s reflect the prefix all your vb tables have.
  • This one is set for up to 9 dice and up to 100 faces,
    it DOES work when starting a thread.
    You do have to actually type the
    Code:

    [dice=#]**[/dice]
    substituting number of dice for '#' and number of faces for '**'.
    Be sure when you import the xml file (after substituting the *'s for table prefixes) that you check the 'allow overwrite' radio button/checkbox

Have been using this on my forum since 4/24 and none of my members have had any problems with just typing the code in... of course I have them trained to be happy with what I give them ;p~

Campbell 06-25-2006 02:24 AM

Understood.

Thank you for your assistance. Any solution that makes my users type code is not a solution for my users. I was attracted to the system because of the interface and display, not just the function alone.

I appreciate your time and effort Eq. You've been kind. I will move my request to the paid forum and work with my existing contractor as well. When I have the solution that's best, I'll share it as open source with the community as I'd suppose the majority of our community owners with games could use this and have it both be functional and pretty.

Best,
A

Eq4bits 06-25-2006 02:29 AM

no problem
perhaps one of the others can help here that use the RPG one.
the RPG one didn't fit with what 'we' needed to do.. as we use multiple faces and *usually* only 1 die at a time. I'd love a nifty little button to use, but it's beyond my capabilities ;) and pocket book as the site is a free one. My members and I were just thrilled to have *any* dice hack that actually worked for 3.5.4 :D

Campbell 06-25-2006 02:36 AM

Totally with you Eq.

We're free at this time as well (hell we're not open yet) but if I'm ever going to go fee based I need the tools and need to spend the cash. I'll do what I can to get this done and share it off.

soravok 06-25-2006 06:05 AM

Quote:

Originally Posted by Eq4bits
no problem
perhaps one of the others can help here that use the RPG one.
the RPG one didn't fit with what 'we' needed to do.. as we use multiple faces and *usually* only 1 die at a time. I'd love a nifty little button to use, but it's beyond my capabilities ;) and pocket book as the site is a free one. My members and I were just thrilled to have *any* dice hack that actually worked for 3.5.4 :D


Same here Eq, much love to you for saving me from being lynched by my members. :banana: :banana: :banana:

Did you see what I posted about marking posts that are edited "fixed" and having the dice rolls from preview to preview be different everytime?

tuxz0r 06-28-2006 11:19 PM

This hack is very similar to something I had done in phpMyChat and wanted to implement on my vBulletin boards to help the Play-by-Post gaming forums. However, I didn't really have a need for displaying cute dice images or limiting myself on the number of rolls or faces. Plus, the dice roller I'm using in my chat uses the standard AdX+B notation where

A = the number of dice to roll (1 if not present)
X = the number of faces on the dice
B = represents a modifier, usually a + or - but also a divides or multiply.

I also need it to do certain things like, only show the sum/result of the roll or show all the die results and the sum of the roll. I also wanted the ability to do open rolls, e.g. if you roll 6, six sided die, you keep rerolling any dice that come up a 6.

So, basically, I have concocted three different bbcodes in one product:

[roll][/roll]
- for rolling and showing only the results or sum
[rollv][/rollv] - for rolling and seeing the result of each dice as well as the sum
[rollo][/rollo] - for open rolls

Each of these takes and optional label for the roll, to be included in the tag after the '=' sign, e.g. [roll=to hit]4d6[/roll] and so forth. It is, however, optional as the actual notation for the roll is displayed before the results in the final posting.

So, for example, you can enter rolls like the following:

[roll]4d6[/roll] to get the sum of 4 six sided die.
[roll]d%[/roll] for a percentage roll (same as 1d100)
[roll]4d6b3[/roll] to roll 4 six sided dice and only sum the "best" three results


I took the current XML file on this hack, made some big changes, adapted my Perl dice roller class to PHP and I've put together a product to allow dice rolling in this fashion. See the attachment.

If you want to see a better description and see some results you can view my forum thread about this enhancement. I don't want to hijack this thread either, so if I need to provide this product via a new thread, someone just let me know. It seemed related enough that I figured I'd add it here first.

There is an INSTALL file in the zip attachment which gives an explanation of the included files and how to install them. If anyone has any questions, just shoot me a PM or I'll check this thread for thoughts.

This is installed and working on vBulletin 3.5.4 on my forums.

Eq4bits 08-03-2006 09:05 PM

okay anyone upgraded to the now available vB 3.6 gold that just became available? will this work with 3.6?

Eikinskjaldi 08-04-2006 07:46 PM

I dont see why it shouldnt, vB3.6 isnt to far off from vB3.5, if anything they'd be simple bugs.

ocitalia 09-12-2006 10:40 AM

how can i add a button in postbid for ONLY [dice=2]6[/dice] ?


All times are GMT. The time now is 09:35 AM.

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.01333 seconds
  • Memory Usage 1,747KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete