PDA

View Full Version : Welcome new members, and a brief word about XML



Ged
July 9th, 2008, 11:58
Quite a few new people have taken up Fantasy Grounds II recently and joined this community, so I wanted to welcome you on the boards. Warmly welcome!

Some of you might have picked up Fantasy Grounds II because it can be customized to suit different games—the rest of this post is for you—and when you come here, you end up facing XML, Lua, Scripting, windowclasses, data bases, templates, merge rules, and what have you. These are not as dangerous as they first seem, especially XML is nothing to be feared of: if you have done HTML, XML is a piece of a cake, if you haven't, you are even better off since you don't have any HTML dead weight.

Many things can be customized just by editing XML, and possibly some bitmap images. That is why I want to spend a few moments to talk about, or demystify, XML required for customizing Fantasy Grounds II. This very brief introduction is here in the Tavern, because it takes a leap to go inside the Workshop (https://www.fantasygrounds.com/forums/forumdisplay.php?f=42), which is the forum for actually discussing modifications in practise. Hopefully this post lowers the bar to enter the Workshop.

Now to the subject-matter:

XML is nothing† more than an easy and organized way to store information. Here is an example


<height>181</height>
Here is another example

<height>
<measure>181</measure>
<unit>cm</unit>
</height>
So, what makes up a piece of ordered information in XML is the opening tag <height>, value, and closing tag </height>. The nice thing is that you can just make up those things. The tags should normally be understandable labels for the information enclosed between them, such as height; you might be tempted to call it just <h> for brevity, that is up to you, but not a good practice. One important detail: the tags must be properly nested: <i><b>This is not valid xml.</i></b> <i><b>This is valid xml.</b></i>

Ok, now we have the height information, but as long as nothing more is told about it, it is pretty useless. The first obvious guess is that it is the height of a character, but that is just our human intuition. However, as far as "knowing XML" goes, that's it. XML is and does little more; it is really that simple and if you want to go ahead and make a customized game table with Fantasy Grounds II, you now know XML‡ and can concentrate on more challenging bits, such as knowing what information Fantasy Grounds II knows how to use, and what it can be taught to use.

A place to start learning customization is the Ruleset Modification Guide (https://www.fantasygrounds.com/modguide/), but: The place to start, in my opinion, is charsheet_main.xml, which you can obtain by running d20unpak.exe, located in the Application Data Folder (if you chose to install the data files); link to the Application Data Folder resides the Start-menu Fantasy Grounds II folder. Running d20unpak.exe creates a new folder called examples (or pexamples :p). Notice however, that chagnes to the example files will make no difference, to really start customizing, read the instructions on this Introduction (https://www.fantasygrounds.com/modguide/introduction.xcp), especially the instructions under the heading Using the d20 ruleset as a basis. After taking a brief look at, e.g. the file I mentioned, the Ruleset Modification Guide will make a lot more sense.

†XML is actually a little more than this, if you are interested, take a look at the Extensible Markup Language (XML) 1.0 (Fourth Edition) (https://www.w3.org/TR/xml/) document.

‡What you don't already know about XML in Fantasy Grounds II, you will quickly learn by looking at some of the files with a text editor.