PDA

View Full Version : Where is the full documentation for the XML for modules and campaigns?



bluedreamer
March 3rd, 2015, 02:45
I cannot find any documentation on the XML schema's for modules/campaigns etc.

I know resources are low at FG but all the developer docs are old/out of date and mostly missing.

I do not want to use PAR5E - I want to write my own tool - I don't like using other peoples stuff.

Where did the people that wrote 5 get the schema info?

Thanks

Trenloe
March 3rd, 2015, 03:00
Where did the people that wrote 5 get the schema info?
They either looked at in-game examples, or worked it out from the code. There is a base schema that all CoreRPG based ruleset used, but a lot of the ruleset specific data is created for that ruleset - so the developers of that ruleset know the ruleset schema as they essentially wrote it.

A quick way to see what the schema is like is to:

Create a blank campaign in your chosen ruleset.
Add in some basic information in the areas you're interested in - Characters, NPCs, Items, whatever...
Close the campaign.
Go the the directory where the campaign data is stored - press the "Open App Folder" folder icon in the top right of the FG launch screen and in the explorer window that opens navigate to \campaigns\<name of your campaign created in step #1>.
Open the db.xml file in a file editor that formats XML (a lot of people use the free Notepad++) and review the XML data. If you're vaguely familiar with XML then the format will make sense and the XML data tags usually make sense - e.g. character sheets are stored in <charsheet>, encounters are stored in <encounter>, items are stored in <item> etc..


I know it's not the answer you were looking for, but spending 5 minutes looking at a campaign db.xml file and comparing it with some example info you entered (step #2 in the list above) will really give you most of the info you need.

Then, for modules, open up a module that someone else has made. For 5E you can create a base module for NPCs and Spells using Valeros's excellent basic rules parser: https://www.fantasygrounds.com/forums/showthread.php?21835-D-amp-D-Basic-Rules-PDF-Parser It's not PAR5E, no text files in sight and it gives you modules in a couple of minutes - give it a go.

Then see this blog for further info on modules, some of it is 3.5e specific, but a lot is very useful: https://www.fantasygrounds.com/forums/entry.php?21-Module-Code-Library

bluedreamer
March 3rd, 2015, 23:28
Thanks - I really want to create a library module for spells the most. The library section is empty in the db.xml

I don't know of anything to add that will effect that part of the XML

I will check out the links though

eg


</item>
<library>
</library>
<modifiers>

damned
March 4th, 2015, 00:00
You need to add a spell in for it to add the spell fields into the DB. It wont create the fields of anything that isnt being used.



https://www.fg-con.com/wp-content/uploads/2015/01/fg-con-6-150-4.jpg (https://www.fg-con.com/events/)
FG Con 6 – April 17-19th 2015 - register at www.fg-con.com (https://www.fg-con.com/) for all the latest info.

Trenloe
March 4th, 2015, 00:04
Thanks - I really want to create a library module for spells the most. The library section is empty in the db.xml

I don't know of anything to add that will effect that part of the XML

I will check out the links though
Check the basic rules parser I mentioned in my post above - this creates a 5E Spells.mod file that has good examples for you to follow.

bluedreamer
March 4th, 2015, 00:24
Reading that - but my frustration is FG state on their features page



Library Modules

RPGs often require players and GMs to look up a lot of info during the game. Fantasy Grounds simplifies this with free, built-in library modules for the PFRPG and 3.5E rulesets. These library modules provide details on new abilities, spells, monsters, weapons and armor and more. Extensive library modules are also included with the commercial rulesets available for purchase, such as Savage Worlds, Call of Cthulhu, Castles & Crusades and Rolemaster Classic.

In addition to this, you can build your own library modules by creating new items, NPCs, etc. and then exporting your custom library modules for use in any campaign you run.

And this is clearly a lie. There is no documentation except odd snippets/user form posts here and there and hearsay and documents last updated in 2008 if they exist at all.

It really should not be this hard to get a XML schema or XSD for the full *mod file or the db.xml files.

bluedreamer
March 4th, 2015, 00:25
Check the basic rules parser I mentioned in my post above - this creates a 5E Spells.mod file that has good examples for you to follow.

Thanks but that doesn't show me complete structure of the XML needed for a system wide mod file for use in our games.

darrenan
March 4th, 2015, 00:28
Um, not sure what you think is a lie about the part you highlighted. If you create a new campaign, add stories, items, NPCs and so forth, and then perform a /export command from the chat window, you will end up with a .mod with those items in it.

damned
March 4th, 2015, 00:44
Hi bluedreamer welcome aboard.

Members regularly create modules for their own use. Depending on the source material some are made and are able to be shared. Clearly this is possible.
There are three ways to create a module:
1. Create it directly in an XML editor - but you need to know the syntax
2. Create data in game - NPCs, Spells, Stories, Items etc and use the /export command to create a re-usable module. If it contains no copyright material you may also share this module.
3. Some rulesets have parse tools to help you create a module - Ikael has some for Savage Worlds and Valeros and Zeus have some for D&D for example


Follow me on this -

Use the Basic Parser (5mins) in the first instance to create some monsters and spells.
Additionally this creates some files that can be used as is in the Par5e tool and then you will have a very quick view of the XML structure
and/or
Drag one monster into NPCs
Create a Blank Character of each spell using class
Drag an appropriate spell into each.
Create a couple of equipment items and drag them into a character sheet.
then
You will be able to see structure in the db.xml file for that campaign (%appdata%\fantasy grounds\campaigns\<campaign>\db.xml)
and/or
You can use the /export command to see the structure it uses in the export file (the export file will have .mod extension - this is just a .zip file - you can open up and have a look/make changes etc)
and you can load a fresh campaign of the same ruleset and go into Library -> Modules -> and see and activate your export module.

I hope that helps.
Please do ask if you have questions.



https://www.fg-con.com/wp-content/uploads/2015/01/fg-con-6-150-4.jpg (https://www.fg-con.com/events/)
FG Con 6 – April 17-19th 2015 - register at www.fg-con.com (https://www.fg-con.com/) for all the latest info.

ddavison
March 4th, 2015, 00:56
The /export command is what we intend most users to use. We don't maintain a DTD or XSD definition for the xml schema. For most items, creating a sample item and reviewing the resulting campaign's xml file structure is a good way to see what is being built and used under the covers. That is how most of the programmers have written programs to parse websites and PDFs and write out the necessary XML outside of Fantasy Grounds. For the average user, we want to encourage them to simply add the NPCs, items and other campaign elements inside of FG and then export them without doing any XML or programming. There are a few items, however, such as spells where this is not presently possible since we don't have that as an available window for creating lists of those.

Trenloe
March 4th, 2015, 00:59
And this is clearly a lie.
Not in the slightest. The section you highlight (as darrenan mentions) is referring to exporting your campaign data into a module. See how to do that here: https://www.fantasygrounds.com/wiki/index.php/Library#Module_Export Click on the screenshot and you will see the entries you can export. "New items" = Items (Check). "NPCs" = Personalities (Check). "etc." = Story, Images & Maps, Encounters, Parcels and Tables. (Check). Nope, no lies there... :)

bluedreamer
March 4th, 2015, 01:02
Hi bluedreamer welcome aboard.
Members regularly create modules for their own use. Depending on the source material some are made and are able to be shared. Clearly this is possible.
There are three ways to create a module:
1. Create it directly in an XML editor - but you need to know the syntax
2. Create data in game - NPCs, Spells, Stories, Items etc and use the /export command to create a re-usable module. If it contains no copyright material you may also share this module.
3. Some rulesets have parse tools to help you create a module - Ikael has some for Savage Worlds and Valeros and Zeus have some for D&D for example


Hi - and thanks.

No.1 Is what I want the answer to and FG don't provide it for a ruleset they provide ie 5e
No.2 I am lazy which is why I have all the data in a database so I can write code to generate the XML - typed it once not doing it again :-)
No.3 I don't trust other peoples parsers - because they implemented in the same situation I did - without the real data.

I am used to lack of documentation because I work with opensource - but why you pay $150 for an application I expect a little more documentation.

The fact that the official docs just refer to a thread for a very difficult to use app (PAR5E) isn't really that cool.

The fact FG reads the XML and (I assume validates it) means the data is easily available. XSD, DTD, RelaxNG validator - even an BNF would be nice.

Trenloe
March 4th, 2015, 01:05
Thanks but that doesn't show me complete structure of the XML needed for a system wide mod file for use in our games.
Oh, sorry. I was specifically referring to your post "I really want to create a library module for spells the most."

If you want to get the structure of a system wide module for use in your games see how to go about this in my reply in post #2 above.

As has been mentioned, there are no definition files maintained for these fields. But, quite a few people have replied in this thread and given you feedback on how to get plenty of examples of what you're looking for. This ends up actually being more useful as you can just copy/paste these examples and create your own module following the example structure.

bluedreamer
March 4th, 2015, 01:10
The /export command is what we intend most users to use. We don't maintain a DTD or XSD definition for the xml schema. For most items, creating a sample item and reviewing the resulting campaign's xml file structure is a good way to see what is being built and used under the covers. That is how most of the programmers have written programs to parse websites and PDFs and write out the necessary XML outside of Fantasy Grounds. For the average user, we want to encourage them to simply add the NPCs, items and other campaign elements inside of FG and then export them without doing any XML or programming. There are a few items, however, such as spells where this is not presently possible since we don't have that as an available window for creating lists of those.

Thanks - this answers the question. Shame the spell list is there as this is by far the longest table in PHB running at 360 entries by my count.

Any chance they could be made available or are the to fluid to release at the moment. I understand a lot of your users won't need them - but if you want people to develop accurate tools for themselves or others they would be incredible helpful.

Our group is building a full database of everything - as everyone knows there is a lot of data - so we want to be able to generate a mod file on the fly from our database. That way extending the mod quickly as new data becomes available or reformatting it becomes a simple operation.

bluedreamer
March 4th, 2015, 01:12
Oh, sorry. I was specifically referring to your post "I really want to create a library module for spells the most."

If you want to get the structure of a system wide module for use in your games see how to go about this in my reply in post #2 above.

As has been mentioned, there are no definition files maintained for these fields. But, quite a few people have replied in this thread and given you feedback on how to get plenty of examples of what you're looking for. This ends up actually being more useful as you can just copy/paste these examples and create your own module following the example structure.

Thanks - that looks like what I shall have to do - going to be hit and miss though.

bluedreamer
March 4th, 2015, 01:22
Thanks everyone for all your replies.

Trenloe
March 4th, 2015, 01:26
As you can create a good 5E spells module, using the basic rules parser, with XML contained therein for a number of spells, could you use a DTD Generator to take the spells module db.xml file and create a DTD from that? I've just used this and it created the attached: https://saxon.sourceforge.net/dtdgen.html

Varsuuk
May 7th, 2016, 06:36
If I wanted to see the XML generated for backgrounds, if my only option a generated via PAR5E output db.xml or that BasicRules parser (haven't used) or is there some publicly viewable "all permutations/options" background data xml example/prototype.

I own all the 5E rulebooks but of course their data is encrypted. I know there are limitations in the public PAR5E plus bugs ;) so prefer to see more full output. Maybe you guys can take a 5e (in your copious free time at the office) xml example and just rename all the classes to dummy names, replace descriptions with "blah" or the like etc. That way you can release the "real" (copied subset of) encrypted xml but with no intellectual property / WOTC issues?

Zacchaeus
May 7th, 2016, 10:43
Because Backgrounds are reference text and you can't export reference material from FG then your only option would be a par5e file. The Basic rules parser would be a good place to look if you don't want to input the stuff yourself.

Varsuuk
May 9th, 2016, 00:15
Trenloe,

I am starting on re-implementing PAR5E for myself since I cannot get the latest public version's java code for a base.

You suggested that basic parser to create some of the XML to look at and learn what is expected/possible to put in the XML.
I was concerned however, that it is a good deal older than even the last public PAR5E - it's from 2014 it seems. Is the XML output changed in a way that might cause a problem?
Do the FG "release notes" ever list XML db changes? I haven't gone through them, and will when I get to that point but was wondering - if it did, then it's a no-brainer to correct the output from the 2014 parser to use as my "template."

After running the Basic Parser, it created the 2 modules (with the unpacked dir versions of each & db.xml etc) plus an "input" directory that looks like PAR5E input. That's cool, I'm late to the party so I didn't even know it worked in tandem ;) as a preparser of sorts. Although, anyone with History info, why does it directly create the Monster/Spells modules but didn't create one full one with backgrounds and rest? Seems it is capable of module creation via evidence of the Monsters/Spells.

Lastly, anyone have any idea if these would be "sufficient" to generate xml that shows all possible XML db output? Ie, for Bacgrounds, all current legal xml elements can be found in by at least taking a union of all the output bacgrounds. Same question for the rest like classes. Not sure I am being clear or not :( its easier to ask via voice than for me to type... it's my curse. (One of them...)

Basically, I want to know what I can look at to reverse engineer the xml from.

I'm pumped to actually have a REASON to become more proficient in Java - that's the reason I never code in it at home, I never think of a utility I need that it's not easier to use an existing one. If I can do it, I'd do in stage 2... SWIFT version ;) since that's a language I need more practice in.
In return, if anyone has C++ questions (especially in a Linux environment) feel free to hit me up for anything. ;)



They either looked at in-game examples, or worked it out from the code. There is a base schema that all CoreRPG based ruleset used, but a lot of the ruleset specific data is created for that ruleset - so the developers of that ruleset know the ruleset schema as they essentially wrote it.

A quick way to see what the schema is like is to:

Create a blank campaign in your chosen ruleset.
Add in some basic information in the areas you're interested in - Characters, NPCs, Items, whatever...
Close the campaign.
Go the the directory where the campaign data is stored - press the "Open App Folder" folder icon in the top right of the FG launch screen and in the explorer window that opens navigate to \campaigns\<name of your campaign created in step #1>.
Open the db.xml file in a file editor that formats XML (a lot of people use the free Notepad++) and review the XML data. If you're vaguely familiar with XML then the format will make sense and the XML data tags usually make sense - e.g. character sheets are stored in <charsheet>, encounters are stored in <encounter>, items are stored in <item> etc..


I know it's not the answer you were looking for, but spending 5 minutes looking at a campaign db.xml file and comparing it with some example info you entered (step #2 in the list above) will really give you most of the info you need.

Then, for modules, open up a module that someone else has made. For 5E you can create a base module for NPCs and Spells using Valeros's excellent basic rules parser: https://www.fantasygrounds.com/forums/showthread.php?21835-D-amp-D-Basic-Rules-PDF-Parser It's not PAR5E, no text files in sight and it gives you modules in a couple of minutes - give it a go.

Then see this blog for further info on modules, some of it is 3.5e specific, but a lot is very useful: https://www.fantasygrounds.com/forums/entry.php?21-Module-Code-Library

Zacchaeus
May 9th, 2016, 10:43
I think you probably need a combination of things in order to see the xml. As was suggested above you can get a good idea by creating a campaign in Fantasy Grounds, add in a couple of story entries and NPC or two an image a parcel, encounter etc. When you export that and look at the db.xml file that will give you the current file structure. As you have discovered from other posts you can't get the reference structure from an FG export so you would have to use par5e for that. Through a combination of those you should be able to see everything that there is.

However this might not be infallible becasue some things just can't be done in the public version of par5e so you won't necessarily see everything that is possible.

Varsuuk
May 9th, 2016, 12:58
Yes, that all makes sense except for that last sentence ;)

That's why I wish there was an example entry for each category that just used all the possible XML tags (with description if not self-descriptive) taken from some internal product in use but with the DATA changed so it is not a copyright issue. For example, if some Story entry from Strahd Chapter 666 had "all the features" (presumably, we'd need more than one entry to cover all since some are probably exclusive) the Devs could rename everything and replace the stuff inside the xml tags with "junk" or documentation ;)

But, given they have little extra time - perhaps they could just write a fast script/xslt etc to take sample db files and replace the text inside elements with XXXX then give it a manual looksie for any in-element copyright issues with anything in there that might not be distributable.


But of course, this is really aimed at Davidson, et al :)


I think you probably need a combination of things in order to see the xml. As was suggested above you can get a good idea by creating a campaign in Fantasy Grounds, add in a couple of story entries and NPC or two an image a parcel, encounter etc. When you export that and look at the db.xml file that will give you the current file structure. As you have discovered from other posts you can't get the reference structure from an FG export so you would have to use par5e for that. Through a combination of those you should be able to see everything that there is.

However this might not be infallible becasue some things just can't be done in the public version of par5e so you won't necessarily see everything that is possible.

Righ

damned
May 9th, 2016, 13:16
Just throwing it out there.... the fact that you arent getting the answer you want may mean there is no great desire to provide this info...
No one will stop you making a new par5e tool but it is neither in the Wizards or SmiteWorks best interests to see a tool that can make production quality output and share it without FGs inbuilt copy protections...
So quite possibly no one is going to hand you this info...
Just my thoughts...

Varsuuk
May 9th, 2016, 13:25
That's fine. I can get that reasoning. However, no one ever mentioned such a reason before. In fact, with all the talk about being able to add your own data and the ruleset wiki, the opposite was my (mis)impression.

As for sharing without inbuilt copy protections, we are talking about making our own modules and data. Correct me if I am wrong, but right now, some things cannot be added via the FG program itself for our own campaigns right? I mean I am still barely experienced with it (day job and family) but, for example - is it possible to add a Background for yourself in the FG product? It may be obvious to you and others how to do that and I don't mind that pointed out to me :) But if PAR5E is the only way for me to add custom Backgrounds, then I would want to know what fields are available for use so I can make these myself when PAR5E has bugs.

It would be different if PAR5E (public) were updated with these things and fixed bugs like not being able to have "list" in background name without fubarring the output etc. But that is not the case.

So how do we create new custom things in correct manner. IF you say only the manufacturer can, then that is a caveat that should be included with the "advertising of 'features'"

damned
May 9th, 2016, 13:38
Im not a part of SW, Im just another user like you. I dont have much extra info or knowledge on this topic - just my thoughts.
I have only ever used Par5e to create CoreRPG and other non 5e ruleset data. I dont know anything about the complexities, intricacies and troubles of making backgrounds and other ruleset specific output.
From what I understand you can create backgrounds with the publicly available par5e.
You probably cant add everything in but you can do a fair bit with it. Yes it has bugs. Galore. The internal version still has bugs too. And some new ones.
You can enter a Background directly into the char sheet but it wont have any linked data.
Does this matter? I dont believe it does. After char creation has finished I dont believe that the background offers any further automation (I could very well be wrong) so there is nothing to stop you adding your own values in here and making the neccesary adjustments to the char sheet if you dont want to generate it via Par5e.

Varsuuk
May 9th, 2016, 14:08
Correct, I thought about that and it works. But the automation in question is a simple case of letting players poke through a large list of backgrounds or races etc and read about them and select one which then adds N (where N can be rather large) features, items, skills, etc to the sheet based on whatever FG does with the processing of the created background data in the db.xml


There is zero "wrong" with no allowing players to add content in a reusable form, there are models where this makes a lot of sense. PAR5E is NOT a Smiteworks-included-with-FG app however, it is not kept "up to date". If it were, then the point of me making my own version goes away (sad for me, since I love to code - better for me and others who just want to play D&D with custom campaigns)

The misunderstanding that Smiteworks wanted to support this level of first-class support (not a judgement phrase, I mean in the engineering sense of treating the client data same as built in/dlc) for custom data was engendered because OF the Parse tool.

Perhaps that tool was never envisioned and at that time they found they were "too" open with contents of xml and a smart coder made a product that they didn't expect. Or, because they didn't have s license, they [b]needed[b] someone to make this task less onerous so that they could sell FG without themselves risking alienating wotc.

Whatever the reason, the deprecation of Parse indicates that at some point making new entries of things that cannot be exported via FG will not be supported in the long term since eventually they will add or remove tags and parse will no longer work with the future FG format.


FG allows you to enter (nearly? Thought recall reading that wasn't the case but not sure) everything a tool like parse does but it does not allow you to export your own user content to make "first class" backgrounds, races, classes etc.

If we are expected to rely on parse by Smite, then a public parse should be maintained. If it isn't officially part of FG, then a way to manually enter and create backgrounds etc should be allowed.

If Smite feels this impacts the ability to sell dlc, then a fair compromise is to allow you to make these parse-only things but instead of going into your campaign they go into the content locker under a "user section" and that data is encrypted just like the rest. So if I created a cavalier with background of banker and race of Changeling, it is in my DM module that users can see if I share and they can pick the data for their chars (more than onc without worrying if they hit all the options as needed right). That data is only visible on my acct and not copyable but it is accessible to ppl connects to me in a form that lets them see the meta-info (Cavalier, Banker, Changeling) when selecting options but does not copy the meta info to their acts just ads the features, skills, etc to their character sheets.

In this way, Smite controls the secret xml but allows ppl to creat new easy to use in their campaigns custom data.

Or Smite can manage expectations better by not making it seem as if there is a way to use a 3rd party tool to "complete" their app's ease of modification since it may not be able to do so in future and no one is working on that apps bugs for their users.

Varsuuk
May 9th, 2016, 14:16
PS. My interest is not in maligning FG - but in pointing out how that set of limitations pans out as time and th FG moving target evolves away from Parse.

I think I (overly) pointed out my thoughts, so I won't ask anymore about XML documentation that they do not wish to provide. I'll confine my questions to that which is already visible only in the future.

It is Smitework's product, they understand their product model and pro/cons of disclosure better than I and it is obviously their call to make and I respect it.

I wrote about why I misunderstood what was a feature and what wasn't as a thing to think on mainly because it was not Doug responding ;) so felt freer to argue vs just accepting it ;)

But ya, I won't be starting things about this again about this going forward.

Trenloe
May 9th, 2016, 14:25
Trenloe,
I'll attempt to answer some of your questions. Proviso - I don't work for Smiteworks and I don't do any in-depth work with 5E so don't know about any subtle changes over versions.


You suggested that basic parser to create some of the XML to look at and learn what is expected/possible to put in the XML.
I was concerned however, that it is a good deal older than even the last public PAR5E - it's from 2014 it seems. Is the XML output changed in a way that might cause a problem? [/QUOTE]
I don't know what, if anything, has changed - I would imagine there has been some underlying changes. It still seems to work, so give it a go as your starting point.


Do the FG "release notes" ever list XML db changes? I haven't gone through them, and will when I get to that point but was wondering - if it did, then it's a no-brainer to correct the output from the 2014 parser to use as my "template."
The release notes are more functional than at a DB level.


Although, anyone with History info, why does it directly create the Monster/Spells modules but didn't create one full one with backgrounds and rest? Seems it is capable of module creation via evidence of the Monsters/Spells.
It was the developer's decision. I imagine he'd got it to the point he wanted (spells and monsters) and didn't want to do any more in depth coding, but kindly did some coding to provide the base files for PAR5E so others could use it.


Lastly, anyone have any idea if these would be "sufficient" to generate xml that shows all possible XML db output? Ie, for Bacgrounds, all current legal xml elements can be found in by at least taking a union of all the output bacgrounds. Same question for the rest like classes. Not sure I am being clear or not :( its easier to ask via voice than for me to type... it's my curse. (One of them...)
I'd imagine it won't generate all possible db XML.

For classes within a ruleset, I'm afraid it's a case of going through the ruleset code/xml to work out what's possible.

Moon Wizard
May 10th, 2016, 02:33
I think that the answer is that it's more about not having time to document capabilities that are not heavily used and primarily used by internal content creators, which is generally a lower priority for us. Just check out the wish list, let alone our nice to Unity and more recent updates. :)

All of the information can be figured out by looking at the CharManager script within the 5E ruleset. In fact, this is exactly what I would need to do to make sure that only relevant fields are included even in an example.

I'm away from my machine, but each record type has 1-2 functions in the Lua script you can review and ask questions. I think the function called by the PC sheet is called addInfoDB, and then farmed out to the specialized function(s) for that record type.

Regards,
JPG

Varsuuk
May 10th, 2016, 17:54
Thanks Moon, I don't know squat about Lua either and since I was not into extensions/rule sets yet I didn't look there.

In hindsight now it seems obvious the scripts would need access to the XML elements. Since I didn't look in those directories, it didn't occur to me. Thanks much,

Dan

Varsuuk
May 10th, 2016, 18:33
Omg, that is soooo helpful JPG!

Just looking at that file I see where some elements are accessed and of course that would help me figure out most questions.

I saw the add language code and formatted the background language text to match to see if would grab the entries out so could enter them separately (question posted previously) and when didn't work looked closer and see the else if section was referring to parsing racial traits. I'm at work too and my lunch is ending. Hope to have time to read through this more this week. I'm excited.

Of course I don't know Lua but that so far hasn't been an issue, I guess other langs give me read knowledge if not write knowledge ;). My biggest weakness is my lame reg expression non-skills. If used only very simple ones in my work and if I ever get to ones with subgroups, it's time to man page it ;)

Thanks again.