PDA

View Full Version : Mystery of mysteries... Library Activation?



Jingo
April 27th, 2007, 05:40
Ok... I wanted to create my own rulest for d20 Wheel of Time. Started messing made a copy of the d20 ruleset and have slowly been tweaking it. Managed to modify the character sheet somewhat, adding in custom skills etc. But I'd like to insert custom content into the Library. However when I click on the Modules icon, not even the basic reference d20 books are there... How do I relink the basic books? How do I create my own books and link them?

lucyanor
April 27th, 2007, 10:02
Hi there,
under
c:\documents and settings\youruseraccount\application data\fantasy grounds 2\modules\
there should be either 2 or 4 .mod files (lite or full version).
You create a copy of one of these files, rename it to what you are going to call your ruleset and extract its contents using winrar or something similar.
Make sure that all the references in the new xml files refer to your new naming (e.g. i edited d20spells.mod to make phb2.mod - i did a find/replace of d20spells for phb2 in both files) Then you will start you coding changes.
I have found out (with fantastic help by Goblin-King -Kudoz~!!!) that this code is extremely case sensitive, meaning that if you type <something> to open a tab, you cannot close it as </Something> cause its a different reference.
Therefore juse make sure you pair your tabs fully and with the right case (make a note of how many tabs you have open somewhere, and cross them off as you are closing them (e.g 1,2,3,4,5,6,5,6,7,6,5,4,5,6,5,4,3,2,1) is one way to making sure that its gonna work in the end.
After the changes, you update your .mod file by throwing in your new .xml files.
Your original .mods if they have stopped appearing, I would suggest moving them to another folder and updating FG. It will redownload them.
Hope this was help.

Jingo
April 29th, 2007, 06:11
Thanks for the info.

I think I can figure out how to change the content once I get it linked to the ruleset. Not sure how to do that.

Getting the original mods (and any of my custom mods) to show up for this one ruleset is the problem I'm having...

The mods work fine in the normal d20 ruleset. But somehow they're missing from my own ruleset (copied from the existing d20 one).

What is the code I need to put in and into what xml file to get the mods to appear...? Any help?

Thanks in advance!

DrDeth
April 30th, 2007, 10:50
You need to modify the definition.xml file in the module, and put your rulesets name in the <ruleset></ruleset> tag. Then, the modules should show up in your ruleset.

HTH

Jingo
May 1st, 2007, 16:50
Hmmm. This doesn't work for me. I extracted d20basicrules, renamed it it d20basicrules_wot and started modifying it. Then I did what you suggested and changed the ruleset definition inside definition.xml to point to my ruleset:

<root>
<name>d20 Wheel of Time Basic Rules</name>
<author>Me</author>
<ruleset>d20_WOT</ruleset>
</root>

I then zipped everything back up and changed the extension to .mod.

When I click on the Modules icon the window is still blank. Nothing to show.

Irian
May 1st, 2007, 17:18
Your directory for the ruleset is REALLY called d20_WOT? Lowercase or Uppercase DOES matter.

Jingo
May 2nd, 2007, 04:13
Your directory for the ruleset is REALLY called d20_WOT? Lowercase or Uppercase DOES matter.

Yes, it's exactly as shown and I have the case as it should be in the definition.xml file... Any other suggestions? Anyone?

Goblin-King
May 2nd, 2007, 12:44
Can you try using the /export command to do just a small test module? Restart FG and see if you can load it up properly. If it works, you can compare that to what you have now.

DrDeth
May 2nd, 2007, 13:22
Goblin_King: Can you give us a step-by-step to using the /export command?

This is what I did:
1. Copied the d20 ruleset to d20_WOT in the rulesets directory.
2. Used our RuleForge editor to copy the d20basicrules module, which essentailly does this:
- Extracts the module to a temp folder.
- Modifies the definition file with the name, author and ruleset.

<root>
<name>d20 Wheel of Time Basic Rules</name>
<author>Me</author>
<ruleset>d20_WOT</ruleset>
</root>
- Updates the library name field...

<name type="string">d20 Wheel of Time Basic Rules</name>
- Updates the recordname fields and attributes:

<recordname>reference.skills.appraise@d20 Wheel of Time Basic Rules</recordname>
- Re-packages the file.
3. Open FGII, create a new campaign using the d20_WOT ruleset.
4. Open the Modules window.
- The module appears here fine.
5. Open the module by dragging the book icon open.
6. Open the library...

... but the library is blank.

What else needs to change in the client.xml ?

Goblin-King
May 2nd, 2007, 13:50
There is a simple step by step I posted in another thread:
https://www.fantasygrounds.com/forums/showpost.php?p=40254&postcount=7

If the module activation process goes OK, the problem is most likely in the xml itself. Make sure it is valid, i.e. all tags are closed properly and no invalid characters are used.

The most crucial bit in making an index appear in the library is the <library> tag.



<library>
<d20basicrules static="true">
<name type="string">d20 Basic Rules</name>
<categoryname type="string">d20 Essentials</categoryname>
<entries>
...
</entries>
</d20basicrules static="true">
</library>

Does the book appear on the left hand side when you activate the module?

DrDeth
May 2nd, 2007, 15:02
There is a simple step by step I posted in another thread:
https://www.fantasygrounds.com/forums/showpost.php?p=40254&postcount=7


Thanks - thats great!




<library>
<d20basicrules static="true">
<name type="string">d20 Basic Rules</name>
<categoryname type="string">d20 Essentials</categoryname>
<entries>
...
</entries>
</d20basicrules static="true">
</library>


Does the d20basicrules tag need to match up to the name somehow?
Also, how does the categoryname affect things?


Does the book appear on the left hand side when you activate the module?

The module appears in the modules list, but once activated it does not appear in the library on the left.

If I do the exact same changes as before, but leave the ruleset tag pointing to the d20 ruleset, then it works 100%. I can only think of two possabilities which you would be able to eliminate for me.

1. The category has something to do with it.
2. I missed a recordname reference which is still pointing back to the old module name - it could be possible that this could break it but still work in the d20 ruleset because the original module exists in the d20 ruleset. :hurt:

Goblin-King
May 2nd, 2007, 15:12
Does the d20basicrules tag need to match up to the name somehow?
It should not matter as such, as long as the module is not named the same. If you do edit it, it's easy to forget to edit the closing tag way down at the bottom of the file though.


Also, how does the categoryname affect things?
The category field defines the group in which the book appears on the left. It should be present and a valid string, but otherwise its value should not make a difference in whether you see it or not.


2. I missed a recordname reference which is still pointing back to the old module name - it could be possible that this could break it but still work in the d20 ruleset because the original module exists in the d20 ruleset. :hurt:
Any invalid recordname references in links should only break the link, not the entire module. The only exception to this is if you have some unescaped special characters that are not allowed in that position by the XML specification.

Jingo
May 2nd, 2007, 15:58
Alright... I think I figured out why I wasn't able to get these modules to show up. This was a relatively simple problem to fix once I figured out it was a problem.

When I initially extracted the contents of the .mod files to modify, they were put into a directory. I was then zipping up the directory and then renaming the .zip to .mod. Zipping up the entire directory is where I went wrong.

The fix (in my case) was this: Create a straight .zip file and then add the needed files into it (without any folder or subdirectory information inside the zip). Rename it to .mod and whuuuala... it shows up!

Wonder of wonders... :o

Man, this whole process could be greatly simplified if some code nut out there came up with a ruleset / charsheet editor...

DrDeth
May 2nd, 2007, 16:42
Do you know much of a pain in the ... behind... formatted text fields have been for me?! :D

You'll be happy to know I've fixed it! While parsing the file I make a lot of assumptions - like that its nicely formatted. I strip off leading tabs, then judge what to do with each line - anything that doesnt start with a < is assumed to be some kind of value (ie. the value of a formatted text) and the rest of the lines are just dumped into a buffer until the end tag is found. (You know what they say about assumptions...)

Anyway, in the d20basicrules.mod > client.xml ... around the <appraise> skill reference, the formatting of the file goes a bit funny - ie. the tags have leading spaces, instead of leading tabs, and the formattedtext contains newlines etc. This was causing my parsing to go haywire.

The module now loads into the ruleset perfectly.

To get back to the original topic - these are the steps I took to get this right:
1. Copy the d20 ruleset from the examples folder to the rulesets folder, and rename it to d20_WOT.
2. Extract the module you want to modify to a temp folder.
3. Modify the extract definition.xml file, changing the name, author and ruleset.


<root>
<name>d20 Wheel of Time Basic Rules</name>
<author>Me</author>
<ruleset>d20_WOT</ruleset>
</root>

Make sure the ruleset value you enter here is the same as the ruleset name in step 1. (d20_WOT)

4. Modify the db.xml or client.xml file.
- Update the library name field...

<name type="string">d20 Wheel of Time Basic Rules</name>

- Updates the recordname fields. Eg.
[CODE]<recordname>reference.skills.appraise@d20 Wheel of Time Basic Rules</recordname>

5. Re-package (zip) the definition.xml, db.xml/client.xml and thumbnail.png files.
6. Open FGII, create a new campaign using the d20_WOT ruleset.
7. Open the Modules window.
8. Activate the module by dragging the book icon open.
9. Open the library...

DrDeth
May 2nd, 2007, 16:45
Man, this whole process could be greatly simplified if some code nut out there came up with a ruleset / charsheet editor...

Its called RuleForge, and its on it's way. ;)

See this thread for more info:
https://www.fantasygrounds.com/forums/showthread.php?t=5764