Page 1 of 1
BASH Dice Roller
Posted: Sun Apr 11, 2010 8:30 pm
by Unknown_Blitz
Hey all, I notice that there are quite a few tech-savy people who play BASH now (*cheers*). I wanted to ask what kind of time/effort it would take to add a dice roller for BASH to the website, kind of like the one that White Wolf used to have for their games.
I had been thinking about the future of pbp here and wasn't sure if someone had already found a good, easily accessiable dice roller that people on the forum could use.
-UB
Posted: Fri Apr 16, 2010 3:29 pm
by AslanC
If you can find one that works with PhPNuke or Ravenphp, send Coyote a message and he will set it up.
I have had no luck
Posted: Sun Apr 18, 2010 3:39 pm
by Jaysun
Not sure if this will help but will the following link help resolve this matter on getting a dice roller set up?
http://forums.codewalkers.com/php-codin ... 17314.html
If it doesn't help, sorry for the waste of time.
Posted: Sun Apr 18, 2010 9:03 pm
by Coyote
Thanks for that link, I'll see if I can implement it somehow
Not sure where, i'll test it out as a side block first, and se where it leads.
Posted: Mon Apr 19, 2010 6:23 am
by Jaysun
Alright cool.
Good luck Coyote.
Posted: Mon Apr 19, 2010 4:22 pm
by Jaysun
Testing dice roller (Instructions:
http://www.bashtalk.org/modules.php?nam ... opic&t=100)
[dice]2d6 = 23547847 [/dice]
[dice]2d6x4 = 1034381766 [/dice]
Sweet.
Congrats on getting it working Coyote!
May the PbP begin!
Posted: Mon Apr 19, 2010 4:59 pm
by Unknown_Blitz
Test
Big Guy Hits Supervillain the damage is:
For Damage Roll with 5 Brawn and 1 lvl of Growth
[dice]2d6*5 = 1299069458 = Fixed[/dice] [/dice]
Very awesome Coyote, I really appreciate you working on this!
The level of growth needs to be added manually it looks like , but thats just a matter of editing the post, and the important thing is that we have the initial roll recorded.
Now to create something to run here : )
Thanks again,
-UB
Posted: Mon Apr 19, 2010 7:35 pm
by Coyote
Originally the "fixed" is a warning that the dice roll may have been edited, but I also know that sometimes you might need to go back and continue your post once you know what your numbers are.
I can't take it out unfortunately, I may be decent with PHP but i'm not a god yet
Anyhow, everyone here is a good bunch and I can't see people abusing it
I can see there being an issue at times when you roll doubles, if I recall you roll again and add result. In that case one would need to go back, edit the post with the new dice roll, then add manually etc.
It's not a perfect system (though someday maybe it will be) but at least it's usable
Posted: Mon Apr 19, 2010 7:39 pm
by Lindharin
Coyote, I'm actually pretty good with PHP. And I just wrote a BASH-style dice roller for the MapTools framework. Would you like me to take a look at the code and see if I can get an actual BASH roller working?
If so, send me a PM with the code where the dice rolls get processed/inserted into the post.
Posted: Tue Apr 20, 2010 11:18 am
by Lindharin
Testing...
[dice]2d6 = 1822537926 [/dice]
[dice]2d6 = 1371160512 = Fixed[/dice]
[dice]2d6+2d8+2d10 = 364418571 [/dice]
Posted: Wed Apr 21, 2010 5:35 am
by Coyote
Improvement, it's now implemented in the quick reply.
[edit - err, the dice button shows but using it responds with "undefined function". looks like I need to play with it more.]
I've re-synchronized my local files and the server files, so i'll mess around with it a bit locally and see what happens. thanks for your help so far, Lindharin
I notice from your test that it doesn't seem to like adding multiple dice rolls, looks like it took the first number (2) instead of the whole dice roll (2d8) and broke at the D.
Good to know.
I thought of trying to write an if/then loop for doubles on a 2d6 roll but my head broke
Posted: Wed Apr 21, 2010 7:27 am
by Lindharin
Hi Coyote,
Try removing the old closing span tag at the end of the Img button input, right before the new Dice button input. There is a new closing tag at the end of the new line, which makes it an extra.
I don't think that's going to solve the undefined problem, but it can't hurt to remove the excess tag.
Oh, just saw the problem. The file you sent me had the changes for the javascript included, but if I do "view source" on this page it isn't there.
In viewtopic.php, in the javascript section for the quick reply, you need to define the d_help variable and add the dice tags to the end of the bbtags array. See the viewtopic.php in the zip file you sent me for the way it should look.
Posted: Wed Apr 21, 2010 8:10 am
by Coyote
Yeah, I suspected as much. that'll teach me to maintain code from multiple computers.. I thought I was keeping the changes synchronized across the local comps as well as the server, and it's possible I re-uploaded an unchanged file at some point.
Got some things need to be done today, hopefully I'll have this finalized sometime tonight
Apologies to everyone for not having it 100% right off the bat, but at least the code works when you type manually!