Re: Help writing star wars dieroller
By an odd coincidence digitalxero has been simplifying the die roller recently with the last three checkins:
http://trac-hg.assembla.com/openrpg_dev/timelineBy e-mail he's been explaining it a bit (reposted below):
the way I designed the new roller system, people can easily write
their own parser for the text between the brackets. I wrote the parser
so that it works with all current rollers, but there is no lock in to
that particular parser.
Each roller has 3 default override options. The format_string, which
determines the layout of the roll output. A fudge_roll methods that
gets called for #dF rolls so custom rollers can change the value of F.
and a build_extra method that is called so the roller can add extra
info to the output, like the d20 .attack method does.
To write the custom WEG Star Wars roller it would take a little more
as the data coming in would not be in standard format, but you could
override the __call__ method that receives the roll_string. For this
particular roller I wold make it a sub class of the Standard roller,
try to parse the roll_string with the default parser and catch the
parse exception then use a custom parser to transform it back into
standard format instead of shortcut format then continue with parsing
as normal.
Also if Custom dice roller writers are feeling very Ambitious they can
write their own BNF (
http://en.wikipedia.org/wiki/Backus-Naur_form)
that fits their micro language. The new roller system includes
pyParsing which is what I used to write the BNF for the current
parser.
-------------------------------------------------
So you could look into that. His email is digitalxero and then at gmail.com
This would be on the "1.8.0.+ developer" version which has a bunch of other features I've been adding over the last six months. It's probably time for a new release really. Anyway if you have mercurial installed (I think it comes with openrpg 1.8) then you can download it by typing the following into a CMD prompt:
Code:
hg clone http://hg.assembla.com/openrpg_dev
That will create a directory called openrpg_dev with all the usual openrpg file directories and should work right away without interfering with other installations.