PDA

View Full Version : Pregen Character Module (5E)



Beldak
September 15th, 2017, 20:46
I'm having a heckuva time trying to make a pregenerated character module.

This module has some custom backgrounds etc, and I'll likely add a Reference Manual link as well.

However, the old public PAR5E doesn't seem to handle pregens and the manual method listed here isn't very detailed: https://www.fantasygrounds.com/wiki/index.php/Pregens

What I've tried to do:
-Create a new campaign, where I'm inputting a new background and created a PC character.
-Exited FG and edited the db.xml file to add the following code:


<library>
<id-00001>
<librarylink type="windowreference">
<class>pregencharselect</class>
<recordname>pregencharsheet@PregenTest5E</recordname>
</librarylink>
<name type="string">Pregenerated Characters</name>
</id-00001>
</library>

-Then added this code to the root:


<pregencharsheet>
<Character1>
...
</Character1_>
<Character2_>
...
</Character2_>
...
</pregencharsheet>

-Save and when I load the campaign back up and click on Library, I get a script error popup: Script Error: [string "library_booklistentry"]:1: bad argument #-1 to 'getModuleInfo' (string expected, got nil)
-Theoretically I can export the PC to xml and paste this xml manually into db.xml in place of the Character1 tags.

Any insight to those who have gone before is appreciated! I downloaded rob's FG 5E Pregens from DMs guild to try and learn more, however this is just the xml files of the characters and not a "mod" to load them.

Moon Wizard
September 15th, 2017, 20:57
It looks like the expected format for the XML is wrong. Try exporting a module with some other types of records to see how the library structures should be built.

It should look something like this:


<root ...>
<library>
<moduletag>
<name type="string">Name</categoryname>
<categoryname type="string">Category</categoryname>
<entries>
<link1>
<librarylink type="windowreference">
<class>pregencharselect</class>
<recordname>pregencharsheet</recordname>
</librarylink>
<name type="string">Pregenerated Characters</name>
</link1>
...
</entries>
</moduletag>
</library>
...
</root>


EDIT: And what Zacchaeus said below. The library link structures are not really designed to be used outside modules, though they currently work to some degree.

Cheers,
JPG

Zacchaeus
September 15th, 2017, 20:57
You need to edit a module - not a campaign. So you'll first create a module, then edit the XML as shown on that link and add the XML of the characters from the campaign db.xml where you created the characters. Then zip the module back up and load as normal.

Nickademus
September 15th, 2017, 22:16
I think my template pack has the code for pregens for 5e:
www.fantasygrounds.com/forums/showthread.php?36157-5e-Asset-Templates

Beldak
September 16th, 2017, 00:32
You need to edit a module - not a campaign. So you'll first create a module, then edit the XML as shown on that link and add the XML of the characters from the campaign db.xml where you created the characters. Then zip the module back up and load as normal.

Gotcha, my error in editing the campaign db.xml file... I needed to create essentially an empty mod to edit manually.

Beldak
September 16th, 2017, 00:32
I think my template pack has the code for pregens for 5e:
www.fantasygrounds.com/forums/showthread.php?36157-5e-Asset-Templates

Downloaded! This looks excellent for reference, thanks for taking the time to put it together and respond :)

Beldak
October 3rd, 2017, 19:05
OK, making steady progress on this project.. However, I wanted to try to link to a specific pregen character sheet from within the referencemanual. At this stage, I'm having to create the entire module manually via XML, so thought I would play around some to see if I could get this to work. So far no dice...

I was going to post a question about how to do this, but I've figured it out! So I'm posting here in case someone searches for a similar issue or someone wants to add this to the wiki:

The correct XML link in the reference manual for pregens is:



<link class="charsheet" recordname="reference.pregencharsheet.xxPregen@SampleModule">Example 1 Character Sheet</link>


This pops up the expected window with this pregen's character sheet, with everything filled out correctly, even before they have decided to add it to the campaign!

Cheers,