PDA

View Full Version : How Do I Create Modules?



markjlyon
July 4th, 2012, 00:24
Can someone please point me to an example or instructions on how to make a module?

Please don't "help" by telling me to look at mods that come with FGII. They include no examples or instructions and are worthless for creating your own modules.

Yes, I have unzipped the mods and and used them as a model but no module I create works. They load into FGII, but they are unusable and always return the error:

"Could not open sheet with data from unloaded module..."

Yes, I have custom record names, correctly named tags, have them in the correct hierarchies. There must be something you have to edit outside the module itself to instruct FGII to run modules. Whatever you have to do to instruct FGII to accept a module is completely undocumented.

Please help by point out where I can find documentation and examples.

Griogre
July 4th, 2012, 00:41
What type of module are you trying to make? There are several types: library modules with game data and adventure modules that tend to hold just the data need for one adventure. Most adventure modules can be made just by starting a new campaign, then entering what you need for the adventure, and then typing /export in the chat line and filling out the popup form.

For library module there are three main types: 1) db.xml modules which are for the GM only. 2) client modules which can be used by either the GM or player. 3) common modules which are stored on the GM machine and transfer to the players when they connect to the server. These are used mostly for commercial modules.

Its also important to know which ruleset you are trying to build a module for because different rulesets arrange their data differently. This is why people tell others to look at an existing module because its usually easier to modify something that already works than to build it from scratch.

Trenloe
July 4th, 2012, 00:50
What modules are you trying to create? Library or adventure modules? By adventure modules , I mean modules that contain story, images/maps, NPCs, items, etc.. Library modules are reference modules in the library.

Adventure modules can be created by making a new campaign, creating your story, images/maps, NPCs, items, tokens and then using the /export command from chat.

Library modules have to be manually created - and I'm guessing this is what you are doing and having issues? To answer one of your questions - you don't need to specifically instruct FG to accept your module - just open it in module activation.

The error you are seeing "Could not open sheet with data from unloaded module..." suggests that you have a reference to another module within your own module - check for links that reference another module - they will usually be in a <recordname> tag (but may be in other tags) and will be referenced by "@<name of library module>". Also, it might be that your "@<name of library module>" name in the link is not the actual <name> entry in the XML definition (in client.xml, common.xml or db.xml) - check that any links do link to the correctly named module.

Also, load your module XML into something like Notepad++ with the XML plugin loaded and do a "Check XMl Syntax" (or similar) to make sure the module XML files have correct syntax.

Trenloe
July 4th, 2012, 00:51
What type of module are you trying to make? There are several types: library modules with game data and adventure modules that tend to hold just the data need for one adventure. Most adventure modules can be made just by starting a new campaign, then entering what you need for the adventure, and then typing /export in the chat line and filling out the popup form.

For library module there are three main types: 1) db.xml modules which are for the GM only. 2) client modules which can be used by either the GM or player. 3) common modules which are stored on the GM machine and transfer to the players when they connect to the server. These are used mostly for commercial modules.

Its also important to know which ruleset you are trying to build a module for because different rulesets arrange their data differently. This is why people tell others to look at an existing module because its usually easier to modify something that already works than to build it from scratch.
SNAP! You are a much faster typer than me! :)

markjlyon
July 4th, 2012, 02:28
I am attempting to create a rulebook (mod) like the 3.5E-basicrules.mod that just contains 4 classes, a few feats and some world background.

I as long as all of my content only goes in the <library><entries> tag as just an entry, like the <license> it sort of works. The moment you go to use <reference> and <lists> it refuses to work.

Trenloe
July 4th, 2012, 02:39
I am attempting to create a rulebook (mod) like the 3.5E-basicrules.mod that just contains 4 classes, a few feats and some world background.

I as long as all of my content only goes in the <library><entries> tag as just an entry, like the <license> it sort of works. The moment you go to use <reference> and <lists> it refuses to work.
Wanna post the module here so we can have a look?

markjlyon
July 4th, 2012, 03:12
Below is my code that does load into FGII Library, but only the Test entry works.


<?xml version="1.0" encoding="ISO-8859-1"?>
<root version="2.0">
<library static="true">
<d20basicrules>
<name type="string">3.5E Custom Rules</name>
<categoryname type="string">3.5E Custom Rules</categoryname>
<entries>
<test>
<librarylink type="windowreference">
<class>referencetext</class>
<recordname>..</recordname>
</librarylink>
<name type="string">Test</name>
<text type="formattedtext">
</text>
</test>
<customclasses>
<librarylink type="windowreference">
<class>referenceindex</class>
<recordname>[email protected] Basic Rules</recordname>
</librarylink>
<name type="string">Classes</name>
</customclasses>
</entries>
</d20basicrules>
</library>
<reference>
<customclasses>
<warlock>
<name type="string">Warlock (Collaborator)</name>
<text type="formattedtext">
<h>Warlock</h>
<p>
This is where the warlock text should go.
</p>
<name type="string">Warlock</name>
</text>
</warlock>
</customclasses>
</reference>
<lists>
<customclasses>
<name type="string">Classes</name>
<index>
<warlock>
<listlink type="windowreference">
<class>referencetextwide</class>
<recordname>[email protected] Basic Rules</recordname>
</listlink>
<name type="string">Warlock</name>
</warlock>
</index>
</customclasses>
</lists>
</root>

Trenloe
July 4th, 2012, 03:35
OK, it's like I mentioned in my earlier post, the @<name of library module> link in the <recordname> tag refers to a module that doesn't have the record in it:

<recordname>[email protected] Basic Rules</recordname>
This is looking in the "3.5E Basic Rules" module - which doesn't have a reference.customclasses.warlock entry.

The module you created is named "3.5E Custom Rules":

<root version="2.0">
<library static="true">
<d20basicrules>
<name type="string">3.5E Custom Rules</name>

So, your link should be to this module, not the 3.5E Basic Rules module. That is:


<recordname>[email protected] Custom Rules</recordname>

This links to the "3.5E Custom Rules" module, and the XML entry <reference> -> <customclasses> -> <warlock>

Hope this helps you get on the right track. :)

markjlyon
July 4th, 2012, 03:46
OK, it's like I mentioned in my earlier post, the @<name of library module> link in the <recordname> tag refers to a module that doesn't have the record in it:

This is looking in the "3.5E Basic Rules" module - which doesn't have a reference.customclasses.warlock entry.

The module you created is named "3.5E Custom Rules":


So, your link should be to this module, not the 3.5E Basic Rules module. That is:



This links to the "3.5E Custom Rules" module, and the XML entry <reference> -> <customclasses> -> <warlock>

Hope this helps you get on the right track. :)

See, I initially tried that and it generates an error:

"Could not open sheet with data from unloaded module '3.5E Custom Rules'"

This is after I made the change to just the name 3.5E Custom Rules.

So the module name is the problem, but not for why you thought and not for any reason I can figure out.

I just wish there was some kind of documentation somewhere about this.

markjlyon
July 4th, 2012, 03:50
I will post a basic module creation user guide once I figure this out.

Trenloe
July 4th, 2012, 03:55
Does the name "3.5E Custom Rules" match with the name in definition.xml?

Griogre
July 4th, 2012, 08:31
In the code above you path over to @3.5E Basic Rules twice you have to change it in both places (in red).


<?xml version="1.0" encoding="ISO-8859-1"?>
<root version="2.0">
<library static="true">
<d20basicrules>
<name type="string">3.5E Custom Rules</name>
<categoryname type="string">3.5E Custom Rules</categoryname>
<entries>
<test>
<librarylink type="windowreference">
<class>referencetext</class>
<recordname>..</recordname>
</librarylink>
<name type="string">Test</name>
<text type="formattedtext">
</text>
</test>
<customclasses>
<librarylink type="windowreference">
<class>referenceindex</class>
<recordname>[email protected] Basic Rules</recordname>
</librarylink>
<name type="string">Classes</name>
</customclasses>
</entries>
</d20basicrules>
</library>
<reference>
<customclasses>
<warlock>
<name type="string">Warlock (Collaborator)</name>
<text type="formattedtext">
<h>Warlock</h>
<p>
This is where the warlock text should go.
</p>
<name type="string">Warlock</name>
</text>
</warlock>
</customclasses>
</reference>
<lists>
<customclasses>
<name type="string">Classes</name>
<index>
<warlock>
<listlink type="windowreference">
<class>referencetextwide</class>
<recordname>[email protected] Basic Rules</recordname>
</listlink>
<name type="string">Warlock</name>
</warlock>
</index>
</customclasses>
</lists>
</root>


Also since you are using root version 2.0 I would suggest you use more unique names for some of your XML elements to avoid any combining problems. I would put your list under the reference node and change the name of the node to from reference to something unique like ref35Custom

Callum
July 4th, 2012, 16:03
Can someone please point me to an example or instructions on how to make a module?
https://www.fantasygrounds.com/forums/showpost.php?p=124427&postcount=6

This is Griogre's description of how to create your own module where you want to merge the lists with an existing module. For one where list merging isn't required, it's even simpler - just miss out the steps that relate to that aspect.

There's also SoulOfTheReaver's guide, which is rather more involved:

www.fantasygrounds.com/forums/showthread.php?t=12948


Please don't "help" by telling me to look at mods that come with FGII. They include no examples or instructions and are worthless for creating your own modules.
Well, that's exactly how I did it (along with the instructions linked above). I think the best way is to start with an existing module, then strip everything out that you don't need, and put your own stuff in.


I have custom record names, correctly named tags, have them in the correct hierarchies. There must be something you have to edit outside the module itself to instruct FGII to run modules. Whatever you have to do to instruct FGII to accept a module is completely undocumented.
There isn't anything needed outside the module itself. If it won't work, there's probably something wrong in your custom tags or hierarchies.

markjlyon
July 4th, 2012, 23:53
I changed all the tags to be unique and now it doesn't load at all.

Can someone please point me to an example that actually works?

markjlyon
July 4th, 2012, 23:55
Thank you for posting the instructions but they must be for a different or older version of FGII as neither of them work.

Again, can someone please post a working example?

damned
July 5th, 2012, 00:42
try callums suggestion of stripping everything out of an existing module.
check it still loads.
then load in your data bit by bit and see what happens.

Trenloe
July 5th, 2012, 05:08
Thank you for posting the instructions but they must be for a different or older version of FGII as neither of them work.

Again, can someone please post a working example?
Or, how about posting your *full* module here (not just a snip from the code within the module) so that we can point you in the right direction?

Trenloe
July 5th, 2012, 05:25
Here is an example module: 2685

This only has the Barbarian class and was created by taking the 3.5E Basic Rules module and doing the following.


Renaming the name in definition.xml and client.xml from "3.5E Basic Rules" to "3.5E Example"
Removing all other entries in client.xml except those relating to Barbarian.
Doing a search for "@3.5E Basic Rules" and replacing with "@3.5E Example".

This is basically what Callum and damned suggested earlier in this thread.

This now results in a top level (<entries>) of only Classes and License. If you click the "Classes" link (<recordname>[email protected] Example</recordname>) this will open the lists.classes index entry in the module 3.5E Example (this module) - which has only 1 entry, "Barbarian" with a link attached - <recordname>[email protected] Example</recordname>. Which, when you select will open the references.classes.barabarian entry in the 3.5E Example module (this module).

Hope this helps.

Callum
July 5th, 2012, 12:57
Thank you for posting the instructions but they must be for a different or older version of FGII as neither of them work.
The "Merging new spells in with the d20 Spells module" instructions are for an earlier version of FG, where the default ruleset was called d20. This has been replaced by 3.5E in the more recent versions of FG. However, other than that name change, the instructions should work - I've used that process for making new 3.5E modules. Where exactly did it go wrong for you?