View unanswered posts | View active topics It is currently Thu May 02, 2024 1:56 am



Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next
 Help writing star wars dieroller 
Author Message

Joined: Sun Mar 14, 2010 6:59 pm
Posts: 5
Post Help writing star wars dieroller
I would like to write a WEG Star Wars dieroller. All this means is that when I type:

[6d+1]

for example, this would be translated to:

[1d6.open(6)+5d6+1]

Where the first die is the "wild die". Everything else would be as normal for the std dieroller, so rolling [6d6] should work normally.

After looking through the python dieroller code, it's not clear how I can change the behavior appropriately. How can I do this?


Sun Mar 14, 2010 7:03 pm
Profile
User avatar

Joined: Wed Dec 09, 2009 9:39 pm
Posts: 712
Post Re: Help writing star wars dieroller
What version are you using? Traipse allows for non standard die rolls to exist. I highly recommend against using the d though.

If you want I can code it for you, Premium Support .. but honestly you don't need to go that route. You can take a look at the 7th Sea die roller and get an idea of how to code a non standard die roller.

_________________
I ate your Death Knell.
The Traipse Movement
Please show your support for Traipse OpenRPG http://www.facebook.com/MadMathLabs
Send me Traipse OpenRPG Ideas, Bugs, Complaints, Praises here: https://getsatisfaction.com/mml


Sun Mar 14, 2010 9:25 pm
Profile YIM WWW

Joined: Sun Mar 14, 2010 6:59 pm
Posts: 5
Post Re: Help writing star wars dieroller
I'm using OpenRPG 1.8.0

Why would you recommend against using the d? Currently typing [6d] does nothing. Using the d is also a standard for Star Wars d6, although it's often written using the capital letter, as [6D].


Sun Mar 14, 2010 9:44 pm
Profile
User avatar

Joined: Wed Dec 09, 2009 9:39 pm
Posts: 712
Post Re: Help writing star wars dieroller
because the roller script finds the d and splits the roll from there, that's why. And if you are using Standard you'll have to wait for the standard devs to respond .. I can't help you with that version.

_________________
I ate your Death Knell.
The Traipse Movement
Please show your support for Traipse OpenRPG http://www.facebook.com/MadMathLabs
Send me Traipse OpenRPG Ideas, Bugs, Complaints, Praises here: https://getsatisfaction.com/mml


Sun Mar 14, 2010 9:49 pm
Profile YIM WWW

Joined: Thu Dec 10, 2009 6:37 am
Posts: 335
Post Re: Help writing star wars dieroller
Isn't the die roller stuff -- I know I keep saying this on lots of topics -- exactly the same in standard and Traipse? Well there might be the odd bug fix we have and you do not possibly but that would make no difference to writing a die roller. Same die roller code, same examples working (or possibly not working in either).

Die rollers have not had much attention recently because as it happens none of the devs play systems that require anything beyond the std die roller. I am not sure how I feel about die rollers going forward. The workings of custom die rollers are often obscure even when written. Other virtual tabletop systems do not have this feature at all and instead have a "one system does all" die roller (if anything) like OpenRPGs std.

As you say you can already get the results you want with std. For the convenience of not having to write out 1d6.open(6) all the time you could eg macro it on to a function key, or write a plugin that searches all your text for a regex and repalces it (plugins fire off before the die roller does) like the spell checker plugin does.

One thing die rollers have been used for is to encode tables such as critical hit body locations, or automatic handling of some resultant die rolls. eg D&D 3.5 could do with something to handle critical hits better, or take 10 and take 20 better. In the end the philosophy of OpenRPG is to be as open as possible so the custom die rollers will remain, but it would be nice if there was a way to do the sort of stuff being requested here without a full blown die roller.

As I recall mostly the custom die rollers add extra functions rather than replacing existing formats and so to get [d6+1] to work might be a trick as prof.ebral said. The die roller pre-parser looks for stuff along the lines of NdN to recognise as a die roll and then creates an object which it calls functions on with a simple eval. So it wouldn't tend to see "6D" as a thing to construct a die object from. You'd need to use [6d6.x()] instead of [6D] The current code doesn't allow a custom die roller to have its own pre-parser. I think that should be changed but for now a plugin is a good way to catch and override dierolls (ie things inside square brakets) and then you can apply whatever sort of pre-parsing you want.

But as I say if you have to do that anyway it might be easier to just write a plugin to find and replace "6D" with "1d6.open(6)+5d6" when it occurs inside square brackets. You can grab the regex to recognise a dieroll from the ordianry code (it's in chatwnd.py) and then you'd need to have some regex and string manip knowledge.

Is that enough to get you started? if not I can be more helpful :)


Mon Mar 15, 2010 3:32 pm
Profile
User avatar

Joined: Wed Dec 09, 2009 9:39 pm
Posts: 712
Post Re: Help writing star wars dieroller
davidbyron wrote:
Isn't the die roller stuff -- I know I keep saying this on lots of topics -- exactly the same in standard and Traipse?

No.

_________________
I ate your Death Knell.
The Traipse Movement
Please show your support for Traipse OpenRPG http://www.facebook.com/MadMathLabs
Send me Traipse OpenRPG Ideas, Bugs, Complaints, Praises here: https://getsatisfaction.com/mml


Mon Mar 15, 2010 3:37 pm
Profile YIM WWW

Joined: Sun Mar 14, 2010 6:59 pm
Posts: 5
Post Re: Help writing star wars dieroller
davidbyron wrote:
But as I say if you have to do that anyway it might be easier to just write a plugin to find and replace "6D" with "1d6.open(6)+5d6" when it occurs inside square brackets. You can grab the regex to recognise a dieroll from the ordianry code (it's in chatwnd.py) and then you'd need to have some regex and string manip knowledge.

Is that enough to get you started? if not I can be more helpful :)


Thanks for the information. I don't know how to write a plugin yet, but I can start to look into it. Is this straightforward (i.e. documented somewhere?) I have to be careful writing a macro or plugin that simply looks for "#d" or something and does a find/replace: I still want [6d6] to work normally, so the "6d" inside that shouldn't be captured by the find/replace function. I'm not sure if that will be possible or not.

Ideally, this could be solved by putting some of the dieroller parsing in an overridable function. I'm surprised this isn't already possible, I think it would add a lot of customizability.


Mon Mar 15, 2010 4:21 pm
Profile
User avatar

Joined: Wed Dec 09, 2009 9:39 pm
Posts: 712
Post Re: Help writing star wars dieroller
Madwand wrote:
Ideally, this could be solved by putting some of the dieroller parsing in an overridable function. I'm surprised this isn't already possible, I think it would add a lot of customizability.


It is, in Traipse. The major difference between the Traipse dieroller and the Standard dieroller is the utils.py script. You can copy the utils.py script from Traipse Ornery Orc to your current 'Standard', replacing the standard one, and then achieve that same functionality. I wrote the Warhammer Fantasy RPG dieroller that allows user to roll [3for], which stands for 3 Fortune dice. The user who commissioned the roller uses Standard.

_________________
I ate your Death Knell.
The Traipse Movement
Please show your support for Traipse OpenRPG http://www.facebook.com/MadMathLabs
Send me Traipse OpenRPG Ideas, Bugs, Complaints, Praises here: https://getsatisfaction.com/mml


Mon Mar 15, 2010 4:41 pm
Profile YIM WWW

Joined: Thu Dec 10, 2009 6:37 am
Posts: 335
Post Re: Help writing star wars dieroller
Personally I find plugins a lot easier to understand and write than die rollers but they are comparable. There is an example plugin called ... uh.... xxblank.py and the spell checker plugin is called xxspell.py (the file name has to begin with xx) xxspell.py does something quite similar but it has a customisable list of words and replacement words which are literals whereas you only want one thing checked for an replaced but you want a more sophisticated kind of search and replace.

=========================

So what's different in Traipse just the pre-parser? I guess I can look at it if I have time. Been pretty busy with the new campaign and testing the effects plugin.

Oh btw have apostrophes always been so screwy for OpenRPG? One of my new characters has an apostrophe in their name and it causes chaos. Can't send the mini to map, can't get it to save and load the map, other issues.... Did I screw something recently or has that always been there?


Mon Mar 15, 2010 8:35 pm
Profile
User avatar

Joined: Wed Dec 09, 2009 9:39 pm
Posts: 712
Post Re: Help writing star wars dieroller
davidbyron wrote:
Oh btw have apostrophes always been so screwy for OpenRPG? One of my new characters has an apostrophe in their name and it causes chaos. Can't send the mini to map, can't get it to save and load the map, other issues.... Did I screw something recently or has that always been there?


The problem with apostrophes revolves around the idea that we are sending XML data. How we send it doesn't matter, as far as I know, it's how the software reads it. So, if we input a string like this:
Code:
'<xmlData string="Tyler's String" data="Working" />'

then we have a problem. You may have missed it, but the problem is around the single quotes area. Because the string uses a single quote to define it as a string, when the string tag, Tyler's String, is called the apostrophe calls the end of the string at Tyler.

This creates a malformed token, and the problem with XML data. Try having your friend use a double quote and see if that fixes the problem, or try having your friend use an HTML equivalent perhaps? If that fails, you could just ask him to remove it. At least you know why the problems exists.

EDIT:

I guess a work around for the future maybe to enclose strings in Triple Double Quotes .. and a Booyah! hehe.

Just kidding on the Booyah, but using Triple Double Quotes
Code:
""" ... """
should free up the other quotes for use.

_________________
I ate your Death Knell.
The Traipse Movement
Please show your support for Traipse OpenRPG http://www.facebook.com/MadMathLabs
Send me Traipse OpenRPG Ideas, Bugs, Complaints, Praises here: https://getsatisfaction.com/mml


Mon Mar 15, 2010 9:01 pm
Profile YIM WWW
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next


Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by Vjacheslav Trushkin for Free Forums/DivisionCore.