Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

New add-on: DiceRoller (for play-by-post forums)

edited October 2006 in Vanilla 1.0 Help
Hi!

I have uploaded a new extension I have been working on. It is called DiceRoller and it is thougth for play-by-post forums, where users need to publish random dice-rolls ensuring that they are fair.

This extension allows the users to use, as many times as needed, a dice-specification function mingled in the body of a comment. The extension casts random rolls for those dice and store them in the database, inserting the results in the comment body when they are displayed. The comment cannot be furtherly edited by the author to prevent her/him changing the text or the rolls.

I have added some Javascript functions that allow sorting the results or toggle a sum function in the display. I have tested the javascript with some browsers: Mozilla/Firefox/MS-Explorer/Opera.

I don't know if there is someone over there interested in this play-by-post tool, but if it is the case, I hope it helps.
The link DiceRoller v0.3

TODO:
- I'm not yet using the SqlBuilder class for the Sql queries.
- I should have a look at efficiency. Each time a comment is displayed I try to retrieve the dice roll information from the dicerolls table. I should, for example, add one extra column to the comments table to store a flag indicating if there are dice-rolls to avoid unnecessary queries.
- There are some extra bad-format checks during posting, and some details in the displaying generation which may be done better.

Comments

  • edited October 2006

    Hey Arturo,

    Thanks so much for this extension! :-)

    Without it, my gaming group would have been forced to settle on a different forum (and we love Vanilla!). Also, the JavaScript functions are seriously cool — I haven't seen anything else like them. Nice work!

    I have collated some feedback from the group, which you may find useful:

    1. Support for dice modifiers
      • It would be really, really, really cool if you could roll something like: #dice(4d6+3) And get four six-sided dice rolls, plus +3 (eg. 1d6 + 1d6 + 1d6 + 1d6 + 3). We would use this function with nearly every dice roll.
      • Importantly, the modifier would also support negative values, for example: #dice(2d8-2) For two eight-sided dice rolls, minus -2 (eg. 1d8 + 1d8 - 2).
    2. Toggle Sum with multiple d10's
      • The Toggle Sum function seems to incorrectly calculate multiples of d10. For example:
        " #dice( 4d10 ) 03 + 05 + 06 + 08 = 14 "
        I'm aware of the difference between the d10 and the d0, but this doesn't seem to add up. Any ideas?
      • This has only occurred with the d10, at this stage.
    3. XHTML (1.0 Strict) standards support
      • At the moment, the JavaScript functions include 'roll', 'sort', 'sum' and 'task' in the dice link. Like so: ..._diceToggle(this)" roll="5 4 5" sort="no" sum="no" task="show">#dice(... Is it possible to somehow do this differently? Perhaps with an external file? My JavaScript skills aren't so great, but I've read a little bit about unobtrusive behaviour — is that a possibility in this case?
      • Keeping the forum valid XHTML 1.0 Strict would be a big plus.

    That's it. We love it — let me know if we can help!
    Keep up the great work!

    Cheers, Adam.

This discussion has been closed.