PDA

View Full Version : Exporting player characters to a module



Octavious
May 4th, 2016, 06:56
I would like to include a set of pre gen PC's with my campaign module. I searched the forum and wiki with no results .. is there a utility to do this? or a way to add the PC to the Mod file after the fact ? ( I know its a zip file with different extension,, I tried just putting the pre gens in the folder and rename back to mod file but they don't show.. any help would be appreciated..

Thanx in advance

damned
May 4th, 2016, 07:20
PCs are exported as XML and imported one by one.
The PC pregens in the LMoP are the only ones that are "built-in" like that.

Trenloe
May 4th, 2016, 13:03
If you use the /exportchar chat command it will export all of the PCs in the campaign into an XML file. Using /importchar and selecting this XML file will import all of the PCs at once. Or you can do them one by one through the Manage Characters window: https://www.fantasygrounds.com/wiki/index.php/Character_Management

Octavious
May 4th, 2016, 17:01
thank you for the info.. what I actually wanted to do was to include PC into a module like LMoP I thought there would be a way to do that as LmoP has them in the module itself..as once LMoP is opened.. you can choose pregens from it.

Trenloe
May 4th, 2016, 17:04
thank you for the info.. what I actually wanted to do was to include PC into a module like LMoP I thought there would be a way to do that as LmoP has them in the module itself..as once LMoP is opened.. you can choose pregens from it.
The information required to make this possible has not been made publicly available. I don't know if there are plans to do that, or if it will remain in the domain of the FG developers.

Moon Wizard
May 4th, 2016, 20:20
From the CoreRPG code, the pregen char selection can be accessed by pointing a link to "pregencharselect" as the class, and the node containing one or more character records as the data path.

The data format for the character record is assumed to be identical to the PC nodes, unless the ruleset specifies a CampaignDataManager2.addPregenChar function to do custom import data. The 5E ruleset uses this approach to look up data in the official modules, and import it (for modules that are not official).

What game system are you writing for?

Regards,
JPG

Octavious
May 20th, 2016, 19:57
ok I am still a bit confused... I am using 5E .. so if I wanted pregen PC characters like LMoP module has, then the 5e ruleset already has the ability to load in those from the xml module If what I understand correctly what Moon Wizard posted.. If I could open and inspect the LMoP module I could find the xml snippit I need and fabricate my own for my module using the snippit as an example. . But it is hidden and due to copyright I am not allowed to see it. any suggestions would be appreciated..

Zacchaeus
May 20th, 2016, 20:45
What Moon Wizard is saying that in order to get pregenerated characters into your module you are going to have to open up the db.xml of the module and put the characters into that file manually. You'll need to point to the pregenerated characters in the library of the db.xml using the <pregencharselect> tag and then have your characters listed between <pregencharsheet> tags (somewhere not in the library that is).

Trenloe
May 20th, 2016, 20:55
What MW is saying is that you just need a link to the database node in your module that contains the character sheets, and that link needs the "pregencharselect" class.

Have a look at any module that contains a link, or even a link within a story entry (for example) and you'll see that the link usually contains two things: the class to open and the database node (recordname) that class will use for its data.

Here are two examples, the first is taken from a link in a story entry and the second from a library entry:


<linklist>
<link class="pregencharselect" recordname="pregens">Pregens</link>
</linklist>

<listlink type="windowreference">
<class>pregencharselect</class>
<recordname>pregens@Pregen Link Test</recordname>
</listlink>

And here is the database node (pregens in the module DB hierarchy) that contains two (very skeleton) characters:


<pregens>
<id-00001>
<name type="string">Character 1</name>
<token type="token"></token>
</id-00001>
<id-00002>
<name type="string">Character 2</name>
<token type="token"></token>
</id-00002>
</pregens>

Both of these links will open the pregen selection window, in this example:

14118

The attached module shows the above examples all put together in a module. It is for the CoreRPG ruleset, but the principles can be used 100% the same in any CoreRPG based ruleset. Load "Pregen Link Test" in a CoreRPG campaign and you'll have a "Pregens" link in the library and a Story entry called "One" that has a link to the pregens - both work the same.

Octavious
May 20th, 2016, 22:45
Thank you so much for that.. that is exactly what I needed I really appreciate the help on this!!

Trenloe
May 20th, 2016, 23:59
Just for completeness:

There is a GameSystem.getPregenCharSelectDetail(charnode) function called in the CoreRPG pregencharselect windowclass definition, the text returned from this is populated on the second line of the "Pre-Generated Characters" screen for each PC. The 5E ruleset returns class and level, I've done a quick review and I don't think any other ruleset uses this function, so the second line remains blank for all but 5E rulesets. Maybe in future some other rulesets will support more details on the second line using GameSystem.getPregenCharSelectDetail to give a little bit more info about the pregen before importing into the campaign.

Varsuuk
May 21st, 2016, 03:58
Very useful and actionable data, thank you all. Moon for bringing up that it could be done then Trenloe and Zacch for th assists ;)

damned
May 21st, 2016, 04:00
This is/was the first post where the details have been revealed....
Yes - thank you Moon Wizard!

Mortar
May 21st, 2016, 04:32
Proven to be very useful already, now I need to make a couple edits to Weird Wars Rome!

rob2e
February 26th, 2017, 09:13
So I'm trying to learn this, and I have the .mod file in my FG modules directory with all my other .mods, and I have no extensions installed - using the 5E ruleset, and the "Pregen Link Test" doesn't show up in the Library. uh ?...


Edit: AH! Change to the 5E ruleset in the definition file.

Getting it...

rob2e
February 26th, 2017, 10:56
Dropped my PCs in to replace the two examples. Reopened mod and when I click on a pregen PC I get the following error:

Script Error: [string "scripts/manager_campaigndata2.lua"]:77: copyNode: Destination node can not be the same as or a child of the source node

Ideas?

Trenloe
February 26th, 2017, 16:59
Ideas?
Post your module so we can try it and check the XML.

rob2e
February 26th, 2017, 17:45
Post your module so we can try it and check the XML.

ThanX!

Trenloe
February 26th, 2017, 18:08
The pregen functionality expects the <featurelist> entries to have a <link> entry within them. Without this, you get the error as the lookupCharData function returns the original featurelist node rather than a different, linked, node. FG then tries to copy this to the same node, hence the error message raised. This is an issue in the 5E code.

A work around is to populate the features entries from a module - so that the link is not self referencing.

rob2e
February 26th, 2017, 18:15
The pregen functionality expects the <featurelist> entries to have a <link> entry within them. Without this, you get the error as the lookupCharData function returns the original featurelist node rather than a different, linked, node. FG then tries to copy this to the same node, hence the error message raised. This is an issue in the 5E code.

A work around is to populate the features entries from a module - so that the link is not self referencing.

I'm not an XML guy, I just try and learn, so I'm not exactly sure what any of that means. Ha! Not funny actually.

My takeaway there though was - it is possible to do this from within the module (exporting) or you mean inserting the code into a .mod after the fact? (Populate the features entry)?

I'm a little confused. Sorry.

Trenloe
February 26th, 2017, 18:24
"A work around is to populate the features entries from a module - so that the link is not self referencing." Create the features and traits by dragging an entry from a player (PHB or SRD) library module.

rob2e
February 26th, 2017, 18:35
"A work around is to populate the features entries from a module - so that the link is not self referencing." Create the features and traits by dragging an entry from a player (PHB or SRD) library module.

What if they are unique?

Also, I'm working with Talyn and he changed the @DD5E SRD Data and replaced with @*

Shouldn't that work? He is asking Moon about it.

Trenloe
February 26th, 2017, 18:43
What if they are unique?
They won't work without a link. If they're unique then they're not going to work (raise the error) in the current release.


Also, I'm working with Talyn and he changed the @DD5E SRD Data and replaced with @*

Shouldn't that work? He is asking Moon about it.
Those are links, so they'll work fine. It isn't a problem with the type of link, it's a problem with not having a link at all.

For example, the following causes the error as there is no <link> record:

<featurelist>
<id-00001>
<level type="number">1</level>
<locked type="number">1</locked>
<name type="string">Bardic Inspiration</name>
<source type="string">Bard</source>
<text type="formattedtext">
<p>You can inspire others through stirring words or music. To do so, you use a bonus action on your turn to choose one creature other than yourself within 60 feet of you who can hear you. That creature gains one Bardic Inspiration die, a d6.</p>
<p>Once within the next 10 minutes, the creature can roll the die and add the number rolled to one ability check, attack roll, or saving throw that it just made. The creature can wait until after it rolls the d20,before deciding to use the Bardic Inspiration die but must must decide before the GM says whether the roll succeeds or fails. Once the Bardic Inspiration die is rolled, it is lost. A creature can have only one Bardic Inspiration die at a time.</p>
<p>You can use this feature a number of times equal to your Charisma modifier (a minimum of once). You regain any expended uses when you finish a long rest.</p>
<p>Your Bardic Inspiration die changes when you reach certain levels in this class. The die becomes a d8 at 5th level, a d10 at 10th level, and a d12 at 15th level.</p>
</text>
</id-00001>
</featurelist>

Whereas, adding a <link> record, will not raise the error and allow the pregen to be imported (this is just any old link entry just to make it work):

<featurelist>
<id-00001>
<link type="windowreference">
<class>reference_classfeature</class>
<recordname>reference.classdata.wizard.features.spellcasting1@ *</recordname>
</link>
<level type="number">1</level>
<locked type="number">1</locked>
<name type="string">Bardic Inspiration</name>
<source type="string">Bard</source>
<text type="formattedtext">
<p>You can inspire others through stirring words or music. To do so, you use a bonus action on your turn to choose one creature other than yourself within 60 feet of you who can hear you. That creature gains one Bardic Inspiration die, a d6.</p>
<p>Once within the next 10 minutes, the creature can roll the die and add the number rolled to one ability check, attack roll, or saving throw that it just made. The creature can wait until after it rolls the d20,before deciding to use the Bardic Inspiration die but must must decide before the GM says whether the roll succeeds or fails. Once the Bardic Inspiration die is rolled, it is lost. A creature can have only one Bardic Inspiration die at a time.</p>
<p>You can use this feature a number of times equal to your Charisma modifier (a minimum of once). You regain any expended uses when you finish a long rest.</p>
<p>Your Bardic Inspiration die changes when you reach certain levels in this class. The die becomes a d8 at 5th level, a d10 at 10th level, and a d12 at 15th level.</p>
</text>
</id-00001>
</featurelist>
However, the issue here is that this link is now to a completely different ability so when the link in the character sheet is pressed the module data will open, not the data in the <text> entry.

So, for unique features and traits you're not going to be able to make the pregen import work - unless you create a module containing the data.

All of this is only relevant to creating pregens - it is not an issue with creating PCs as usual and using the normal FG import/export process through the Character Selection window.

rob2e
February 26th, 2017, 19:06
So let me solicit your opinion Trenloe...

I am putting together the "Of Drow Origin" module (from Kickstarter). It's done except for these fakakta pregens. The PCs are of course built in the module itself, but cannot be exported, which is why I am trying to get my head around making them in a pregen .mod and then once it works (which it seems it isn't going to), then just copying said XML and plopping it right into the complete .mod file for the whole campaign.

There are 11 pregens and they involve many unique traits and features (even three new class archetypes - which of course work fine and you CAN export them in FG).

What is my best course of action here?

Trenloe
February 26th, 2017, 19:19
What is my best course of action here?
1) Wait for a fix in the 5E code. Which may be forthcoming, or might take a while.
2) Use the chat /exportchar command to export all PCs into a single XML file. Include this XML file with the module with instructions on how to import into FG. This is what we used to do before the pregen functionality discussed in this thread.

Moon Wizard
March 1st, 2017, 00:11
I'm looking at this for v3.3.0. I think that the answer is to perform no lookup, if the link field is missing or empty.

Cheers,
JPG

rob2e
March 1st, 2017, 05:17
I'm looking at this for v3.3.0. I think that the answer is to perform no lookup, if the link field is missing or empty.

Cheers,
JPG

I know no one ever wants to answer this, but I'll take a shot anyway...

Any ETA on 3.3.0 because I really need that functionality to complete the "Of Drow Origin" Kickstarter for the Smiteworks store. It has 11 pregens that are the main focus of the module. I tested pregens a couple months ago and it seemed to work which is why I promissed I could do this, but it seems to have "broken" in the interim.

damned
March 1st, 2017, 05:46
I know no one ever wants to answer this, but I'll take a shot anyway...

Any ETA on 3.3.0 because I really need that functionality to complete the "Of Drow Origin" Kickstarter for the Smiteworks store. It has 11 pregens that are the main focus of the module. I tested pregens a couple months ago and it seemed to work which is why I promissed I could do this, but it seems to have "broken" in the interim.

Dont worry - once you submit it will likely take 3 or 4 weeks for review anyway so relax and wait on the announcement....
Oh and what do you mean by pre-gens are broken? They still work in the modules I have done.

rob2e
March 1st, 2017, 06:07
Dont worry - once you submit it will likely take 3 or 4 weeks for review anyway so relax and wait on the announcement....
Oh and what do you mean by pre-gens are broken? They still work in the modules I have done.

Yes, but should I submit it with the pregens in an extra folder, or wait for the issue to be updated so they can be in the actual mod, THEN submit?

damned
March 1st, 2017, 06:55
Im still missing your point... Ive made modules with pregens that can be added the way they are in LMoP and they still work for me in 3.2.3 and 3.3.0...

rob2e
March 1st, 2017, 06:57
Im still missing your point... Ive made modules with pregens that can be added the way they are in LMoP and they still work for me in 3.2.3 and 3.3.0...

Check them now. I'm given to understand there's a problem with 5E. I'll bet yours DON'T work now?

damned
March 1st, 2017, 07:26
Check them now. I'm given to understand there's a problem with 5E. I'll bet yours DON'T work now?

Im still not sure - which part doesnt work?
If there is a known issue then Id wait...

rob2e
March 1st, 2017, 07:33
Im still not sure - which part doesnt work?
If there is a known issue then Id wait...

Click on the green plus, and get this error:

Script Error: [string "scripts/manager_campaigndata2.lua"]:107: copyNode: Destination node can not be the same as or a child of the source node

Trenloe
March 1st, 2017, 14:41
Check them now. I'm given to understand there's a problem with 5E. I'll bet yours DON'T work now?
As explained, this is not for every single 5E pregen. For more info see post #19 and #23 of this thread.

Talyn
March 1st, 2017, 16:06
I'm looking at this for v3.3.0. I think that the answer is to perform no lookup, if the link field is missing or empty.

Cheers,
JPG

What was done differently to build the pregens for LMoP? They load just fine. Having that knowledge would at least help out...

Trenloe
March 1st, 2017, 16:21
What was done differently to build the pregens for LMoP? They load just fine. Having that knowledge would at least help out...
I've explained what the issue in in the posts referenced above - posts #19 and #23.

The LMoP pregens have links assigned so they work fine.

Moon Wizard
March 1st, 2017, 17:03
All of the class features, racial traits and inventory items are links in the LMoP pregens. There is no data in the pregen for those items.

When you make a pregen using a character export, all the data is already included, but the current 5E pregen import procedure is trying to lookup and copy like it does for the LMoP pregens.

Cheers,
JPG

rob2e
March 1st, 2017, 21:17
So in 3.3.0 Test, it all works great. So there's that.

damned
March 2nd, 2017, 02:16
All of the class features, racial traits and inventory items are links in the LMoP pregens. There is no data in the pregen for those items.

When you make a pregen using a character export, all the data is already included, but the current 5E pregen import procedure is trying to lookup and copy like it does for the LMoP pregens.

Cheers,
JPG

Based on this and Trenloes post...

I went thru a new pregen module and i removed all the <shortcut></shortcut> tags from my character excluding those that pointed to Inventory items and I dont get the errors that rob2e is posting...
Would that be the correct way JPG?

Moon Wizard
March 2nd, 2017, 02:20
In v3.2.x, it wouldn't matter whether you specified or not. You would still get the lookup errors.

In v3.3.0, if the shortcut value is empty or missing, then it will skip the module lookup for that feature/trait/item, and assume that item record is complete.

Cheers,
JPG

damned
March 2nd, 2017, 03:22
In v3.2.x, it wouldn't matter whether you specified or not. You would still get the lookup errors.

In v3.3.0, if the shortcut value is empty or missing, then it will skip the module lookup for that feature/trait/item, and assume that item record is complete.

Cheers,
JPG

Im just trying to understand what is required to build a pregens module in 3.3.0 as it still works for Call of Cthulhu and another ruleset I tried but 5e throws errors if I paste a complete character between the <pregens> tags...



<?xml version="1.0" encoding="ISO-8859-1"?>
<root version="3.1">
<pregens>
<id-00092>etcetce</id-00092>
</pregens>

<library>
<libn5epregentest>
<name type="string">5e Pregen Test</name>
<categoryname type="string">Reference</categoryname>
<entries>
<id-00006>
<librarylink type="windowreference">
<class>pregencharselect</class>
<recordname>pregens</recordname>
</librarylink>
<name type="string">Pregenerated Characters</name>
</id-00006>
</entries>
</libn5epregentest>
</library>
</root>

Moon Wizard
March 2nd, 2017, 03:34
Sorry, still thought we were on the previous item.

In 5E LMoP, all the characters are children under top-level "pregencharsheet" tag. And the code for the link is:



<id-00007>
<librarylink type="windowreference">
<class>pregencharselect</class>
<recordname>pregencharsheet@DD Lost Mine of Phandelver</recordname>
</librarylink>
<name type="string">Pregenerated Characters</name>
</id-00007>


Is that what you were looking for?

Cheers,
JPG

damned
March 2nd, 2017, 04:28
Sorry JPG no that wasnt it... :)
I have that and it was working in 3.2.x but it seemed to break in 3.3.0
Script Error: [string "scripts/manager_campaigndata2.lua"]:107: copyNode: Destination node can not be the same as or a child of the source node

However it appears to be working again now...
I did get another 3.3.0 update today...?

Moon Wizard
March 2nd, 2017, 04:41
There was another update today for v3.3.0, where one of the fixes was specific to fix that.

JPG

damned
March 2nd, 2017, 05:02
Thanks JPG - it worked :)

Wookiee420
July 31st, 2017, 05:23
Slight necro post here, but i have a question.
It seems that you cannot preview the character before adding it to the character select screen, am I missing something?
What I mean is that the list of characters in the screenshot below is just a list until they are added to the character select screen..Am I correct?
20000

Trenloe
July 31st, 2017, 13:28
It seems that you cannot preview the character before adding it to the character select screen, am I missing something?
What I mean is that the list of characters in the screenshot below is just a list until they are added to the character select screen..Am I correct?
Correct. There is no way to preview the pregens without importing them.