PDA

View Full Version : Problem with modules



JMessmer
December 18th, 2013, 10:48
I have created some modules for our custom ruleset. The modules are based on the structure of the 4E ref_powers.xml.
The publisher of the game system does not want us to publish all the stats for the spells and powers. We are allowed to show the name and the page reference to the rule-book only.

Since modules cannot be edited within FG, I was looking for ideas how to publish a skeleton for the players that holds only name and page reference but also includes the full structure of spells and powers. Players should then be able to fill in the additional data themselves.
I would prefer to have the option of using the "quill-mechanics" that stores edited information in the moduledb folder. That means that players will have to copy the moduledb folder from one campaign to the other. I know it is not the best solution but it is better than anything else that came into my mind.

So I wonder how to make the information editable for players. At the moment the data is either read-only or stored directly inside the npc-node of db.xml
Secondly, I wonder if anybody else has a better idea of how to solve this problem.

damned
December 18th, 2013, 11:39
write a parser script to take excel file and output to xml. dont reinvent wheel - find existing parsers and modify.
create your excel file including all the info you are allowed to include plus the correctly named additional fields which require data.
distribute base excel file and parser and players can copy data from their legitimately purchased sourcebook into excel and run the parser to create their own module?

JMessmer
December 18th, 2013, 11:53
write a parser script to take excel file and output to xml. dont reinvent wheel - find existing parsers and modify.
create your excel file including all the info you are allowed to include plus the correctly named additional fields which require data.
distribute base excel file and parser and players can copy data from their legitimately purchased sourcebook into excel and run the parser to create their own module?

Thanks for the idea, damned. That was actually my first idea, too. However, the rulebook is not in excel but in PDF and the content is unstructured text.
I wrote a parser based on XSLT and VB.NET that goes through the XHTML-export of the PDF. Unfortunately, the output is not well-structured so I cannot rely on a fully automated process. I had to manually edit the XHTML-export.
Consequently, players that would like to convert their PDFs would first have to buy Adobe Acrobat Pro (otherwise the export is not possible), and second, they would have to manually edit their exported HTMLs the same way I did.

I agree that the idea is very good and would be great if I could find a way to convert the PDF without additional cost. The problem with the output could probably also be automated in a way by writing regexp routines within VB for the specifically required corrections (hundreds of them, unfortunately).

Moon Wizard
December 18th, 2013, 19:02
The data structure displayed to the user is completely defined by the ruleset. If a field exists in the ruleset window, but not in the underlying data; an empty data field will be created. If a field exists in the underlying data, but not in the ruleset window; it will be ignored.

If you want people to be able to create and re-use powers/spells, try creating a new campaign record type with a corresponding desktop button, list and individual records. Then, you can add that record to the list of record types that the export module feature supports.

Regards,
JPG

Griogre
December 18th, 2013, 19:13
In a case like this it might be easier to just copy the raw text into a text file and delimit the parts with manual parser "tags" for the various parts, ie XXZ. Tenian did that in the 4E parser before it scraped directly from DDI. You'd type in the first one and then just Ctrl-v in the rest then run it through a parser. Its reasonably fast to annotate, but not at all automated, but at least you wouldn't have to write the regexp expressions and keep them all updated.

JMessmer
December 21st, 2013, 08:57
Thanks for all the ideas. I really appreciate your comments and suggestions.

@JPG: I also had this idea and wondered if it might be more comfortable for the user to load a campaign based on module data each time he wants to edit some spell data, or if he could simply edit it directly in the campaign he is actually playing. I considered the second option more comfortable. Obviously, it leaves the disadvantage of having to copy the moduledb folder. I decided against the approach with campaign-based modules because it would be the highest effort to get there.

@Griogre: Definitely easier for me, I agree. Unfortunately, not reasonable for the standard user. We are talking of about 6000 pages of rules, spells, powers, diseases, rites, creatures, weapons and armour. The text is always continuous text and not structured in any tables. I need the formatting elements of the text in order to know the starting element of a spell, power, creature... and the last element so that I can parse it properly. Letting the user do this for thousands of entries will leave them crying out loud.

After thinking about the comment of damned I wondered if my assumption was correct and the Adobe functions are really the only way to convert PDF into HTML. I found out that there are several APIs. Most of them cost money. However, I also found one tool called poppler, which is for free and has been implemented for linux. Luckily, there is also a windows-port of this tool. I integrated it into my .NET application.
Most of the outputs are a bit buggy so I had to integrate a txt- and a xml-output, which are both compared at run-time. The complete information of the txt-output is then compared to the sometimes fragmented xml-output. The application corrects the missing parts also with regex and runs it through a three-stepped xslt process.
In the end the application produces the module folder containing the definition.xml, common.xml or db.xml and a thumbnail.png.

damned
December 21st, 2013, 12:12
Most of the outputs are a bit buggy so I had to integrate a txt- and a xml-output, which are both compared at run-time. The complete information of the txt-output is then compared to the sometimes fragmented xml-output. The application corrects the missing parts also with regex and runs it through a three-stepped xslt process.
In the end the application produces the module folder containing the definition.xml, common.xml or db.xml and a thumbnail.png.

nice job! you sound like you are a little bit handy with your programming.
what is the game you are doing this for?

JMessmer
December 21st, 2013, 18:45
what is the game you are doing this for?

It is "The Dark Eye" (in German "Das Schwarze Auge"). I think it is still one of the most popular German-speaking RPGs. Although it was much more popular and wide-spread in the 1980s.

damned
December 21st, 2013, 23:13
Although it was much more popular and wide-spread in the 1980s.

i think they *all* were more popular in the 80's!