5punk BeardyRoller

For games played by men (and women) with beards, such as tabletop RPGs.

Moderator: Forum Moderators

deject
Berk
Berk
Posts: 10353
Joined: December 7th, 2004, 17:02
Location: Oklahoma City, OK, USA
Contact:

5punk BeardyRoller

Post by deject »

Download the latest version here: http://www.apathymachine.com/beardz/
Java GitHub respository here: https://github.com/deject/BeardyRoller

NOW IN C#/Windows Forms FLAVOR! If you hate Java Swing like I do, check out this version!
BeardyRoller! Sharp Edition v0.9b
-Equivalent functionality as Java version, but with more efficient and better written code!
-Java Swing is terrible and I wish it died!

Version 0.93:
- Fixed the lack of NaN handling for Shadowrun
- Added batch rolling/text output support
- Reorganized the code a bit so that it's easier to work with

Version 0.92:
- Changed layout to a tabbed pane
- Added support for Eclipse Phase RPG
- Cleaned up some comments

Version 0.91:
- BEARDZ! is now fixed for great justice!

Version 0.9:
- Added BEARDZ!
- Changed unecessary usage of ArrayList to int[] arrays
- Fixed About message

Version 0.85:
- Added notification when snake eyes are rolled in SLA
- Added menu bar
- Added informational About dialog
- Fixed window size so the GUI doesn't go pearshaped

Version 0.80:
- Initial Release

TODO:

- Add Warhammer 40,000 Death Watch RPG

Original post:
Well, the alpha version is done! The dice rolling code is piss easy of course and took me all of like 5 minutes to write code for any number of d6, d10, and d20 dice rolls.

Constructing the GUI for a a GUI noob like me is the hard part. I still have issues with it, most notably the Shadowrun sidelt: label gets pushed off if the dice pool rolled is fairly big (>5). Still, the basic layout is there and the functionality is all there. I can provide the source code (just the files or as an Eclipse project archive) to anyone if they so desire and.or can help with GUIs.

Old W-I-P demo video is here (not very informative anymore):
http://www.screencast.com/users/deject/ ... daa637bb87
Last edited by deject on January 22nd, 2012, 6:56, edited 11 times in total.
Lee
Optimus Prime
Optimus Prime
Posts: 1138
Joined: February 12th, 2005, 16:31
Location: South Shields, UK

Post by Lee »

I'm not sure if there's a better way to do it but I usually just stick a load of spaces on the end of the smaller string to push the size of the text box to the length of the longer string. Try setting the initial value of the dice pool result box to alot of spaces.

Also, are you using grid layout for those two buttons? that's what I'd use, the overlapping after clicking thing is a bit strange.
HereComesPete
Throbbing Cupcake
Throbbing Cupcake
Posts: 10249
Joined: February 17th, 2007, 23:05
Location: The maleboge

Post by HereComesPete »

:likesitall:

You'll need edge modifiers on the shadowrun one. You could probably squash the whole thing up a bit and have more space for the stuff disappearing off the side too. I say probably, I don't know this because I'm no code monkey. Still, makes a lot more sense than that web based sr4 roller that is over at that dashifen place. I think he broke his, because it delivers terribly low results all the time now.
deject
Berk
Berk
Posts: 10353
Joined: December 7th, 2004, 17:02
Location: Oklahoma City, OK, USA
Contact:

Post by deject »

Lee wrote:I'm not sure if there's a better way to do it but I usually just stick a load of spaces on the end of the smaller string to push the size of the text box to the length of the longer string. Try setting the initial value of the dice pool result box to alot of spaces.

Also, are you using grid layout for those two buttons? that's what I'd use, the overlapping after clicking thing is a bit strange.
Well it's more complex than that. Both sides are their own JPanels for compartmentalization. The overall layout is using BorderLayout, and then the subsequent panels use GridLayout to align everything vertically.

I'm pretty sure what I need to do to solve the result problem is to change the layout for that bottom part because as it is now the text area and the result label are confined to being the same width, so I need to figure out how to stop that from happening. Once I do that it won't be a problem.


Oh and I forgot about Edge. I'll have to add that.
buzzmong
Weighted Storage Cube
Weighted Storage Cube
Posts: 7167
Joined: February 26th, 2007, 17:26
Location: Middle England, nearish Cov

Post by buzzmong »

You could, although it's not "recommended" java programming ethos, is simply set the layoutcontrol to null then position everything manually.

It means that obviously, they won't resize or move around if you play with the size of the window at runtime, but by fuckery it means you don't have to dick around with the quite frankly badly thought out java layout code methods.
deject
Berk
Berk
Posts: 10353
Joined: December 7th, 2004, 17:02
Location: Oklahoma City, OK, USA
Contact:

Post by deject »

buzzmong wrote:You could, although it's not "recommended" java programming ethos, is simply set the layoutcontrol to null then position everything manually.

It means that obviously, they won't resize or move around if you play with the size of the window at runtime, but by fuckery it means you don't have to dick around with the quite frankly badly thought out java layout code methods.
Yeah I am not going to position shit manually. That is just asking for pain.

I need to find more advanced tutorials online or something because I've got most of it set up. I expanded the box so it can handle 14 dice before fucking up. I know it's not the ideal way to handle this though.
deject
Berk
Berk
Posts: 10353
Joined: December 7th, 2004, 17:02
Location: Oklahoma City, OK, USA
Contact:

Post by deject »

Joose
Turret
Turret
Posts: 8090
Joined: October 13th, 2004, 14:13
Location: The house of Un-Earthly horrors

Post by Joose »

nicely!

Seems to have a bit of a bug regarding edge and glitches though: At one point a roll of 6, 6, 1 comes up glitch. Is it something to do with the fact it would have been a glitch, were it not for the extra edge dice?
deject
Berk
Berk
Posts: 10353
Joined: December 7th, 2004, 17:02
Location: Oklahoma City, OK, USA
Contact:

Post by deject »

Joose wrote:nicely!

Seems to have a bit of a bug regarding edge and glitches though: At one point a roll of 6, 6, 1 comes up glitch. Is it something to do with the fact it would have been a glitch, were it not for the extra edge dice?
It's definitely a bug. I think it's not taking into account the extra dice from the Edge. I have to fix that, should be easy enough. I added in the Edge dice without changing anything else so that's not unexpected.
deject
Berk
Berk
Posts: 10353
Joined: December 7th, 2004, 17:02
Location: Oklahoma City, OK, USA
Contact:

Post by deject »

Right, I've fixed the glitch detection bug, and I have a rough version available for people to try. It's an executable .jar file. I'm certain my PC is 100% virus, trojan, and spyware free, but as always you should check out all executable stuff you run on your PC.

download it here:
http://www.apathymachine.com/BeardyRoller.jar
Baliame
Tremors Worm
Tremors Worm
Posts: 3491
Joined: October 13th, 2007, 23:43
Location: Hungary

Post by Baliame »

Java is evil. I've put one together in something a little more friendly.

http://www.mediafire.com/?sharekey=97ab ... f6e8ebb871

(Yes, you can crash it if you don't use it properly. No, I won't fix it :P)
deject
Berk
Berk
Posts: 10353
Joined: December 7th, 2004, 17:02
Location: Oklahoma City, OK, USA
Contact:

Post by deject »

What did you code that in? VisualBasic? Working with Swing is like pulling teeth for me.
Baliame
Tremors Worm
Tremors Worm
Posts: 3491
Joined: October 13th, 2007, 23:43
Location: Hungary

Post by Baliame »

C#, probably the best around if you want to write a simple windows forms application.
deject
Berk
Berk
Posts: 10353
Joined: December 7th, 2004, 17:02
Location: Oklahoma City, OK, USA
Contact:

Post by deject »

Java isn't evil btw, it's just misunderstood. I think all of the problems people have with Java is due to botched VM installs. I can honestly say I have not had a Java program fail or fuck up on me in years.

Edit I bet I could adapt my code to C# pretty easily. I should install Visual Studio and try it out.
Baliame
Tremors Worm
Tremors Worm
Posts: 3491
Joined: October 13th, 2007, 23:43
Location: Hungary

Post by Baliame »

Java will probably work reliably but it's still evil. It's Cish though so you shouldn't have a problem moving over.
buzzmong
Weighted Storage Cube
Weighted Storage Cube
Posts: 7167
Joined: February 26th, 2007, 17:26
Location: Middle England, nearish Cov

Post by buzzmong »

C# is better, it takes all the good bits and expanded functionality of C / C++, and adds Java's ease of reading and object handling at code level to it.

I'm just much more fluent in Java and using it a lot currently.
deject
Berk
Berk
Posts: 10353
Joined: December 7th, 2004, 17:02
Location: Oklahoma City, OK, USA
Contact:

Post by deject »

Update: I've added the ability to right click in the results boxes and copy the results instead of having to select it manually and use CTRL-C
HereComesPete
Throbbing Cupcake
Throbbing Cupcake
Posts: 10249
Joined: February 17th, 2007, 23:05
Location: The maleboge

Post by HereComesPete »

Hurrah for progress!


Someone should sticky this or add it to the beard consolidation thread.
Grimmie
Master of Soviet Propaganda
Master of Soviet Propaganda
Posts: 7672
Joined: February 5th, 2005, 19:00
Location: Birming-humm, England
Contact:

Post by Grimmie »

Consolidated!
fabyak
Home-made Big Daddy
Home-made Big Daddy
Posts: 5681
Joined: October 14th, 2004, 14:02
Location: Oxford, England

Post by fabyak »

Just like an administrative Dalek
:dalek: wrote:CONSOLIDATE! CONSOLIDATE!
Post Reply