PDA

View Full Version : Help NPC to Library item



kodarr
June 25th, 2014, 04:56
I created a module that has all the important NPCs i need for my campaign and I would like to make this a Library item like the Bestiary is.

I did /export to export the module selected NPCs, & Personality (not sure what personality is but wouldn't give me a db.xml without it.)

I then edited the db.xml replacing the word npc with data.

Then it shows up in my library but i get an error when trying to open it.

Can someone point out where I went wrong with this? I tried following a tutorial online but they used story which replaced encounter with data. I noticed npc showed up in about the same places as encounter so that's why I chose npc.

Thank you in advance.

Trenloe
June 25th, 2014, 05:32
I'd recommend opening one of the existing bestiary modules for your target ruleset and checking the format of that module.

Without knowing the error you received it's hard to tell what your issue is. However, I would guess that replacing "npc" with "data" has broken some of the internal references that rely on a specific string that includes npc. For instance, looking at the 3.5e Bestiary module, each entry has a windowreference with a <class> of "npc" - this refers to the class of window that will be opened with the NPC data - if you change <class>npc</class> to <class>data</class> then that will link to an invalid class (or non existing class) within the ruleset and you'll get an error when you click on the link to open an NPC.

Moon Wizard
June 25th, 2014, 06:41
Once you export records from a module, you shouldn't need to change anything in the XML file. They should show up in both the library and as a tab in the NPC campaign list. Personalities are just another name for NPCs.

Regards,
JPG

lokiare
June 25th, 2014, 12:26
Once you export records from a module, you shouldn't need to change anything in the XML file. They should show up in both the library and as a tab in the NPC campaign list. Personalities are just another name for NPCs.

Regards,
JPG

Is there a way to make them not show up in the NPC tab? I'm entering library module data for a new ruleset and would like to avoid having to do it all in xml.

Moon Wizard
June 25th, 2014, 16:41
No, the export automatically places there.

On a related note, Zeus has been experimenting with his Par5E tool to place data in both locations for ruleset data in the 5E ruleset. Not sure of the feedback yet.

Also, you should be able to modify the resulting XML in an exported module fairly easily. Wrap the npc tag (root.npc) in a reference tag (root.reference.npc); then do a global replace for ">npc." with ">reference.npc." I'm doing this off the top of my head , since not at my dev machine; so might need a little fine tuning.

Also, one benefit of using reference.npc is that it is easy to find module NPC data in case you need to update NPC data structures programmatically.

Regards,
JPG

Zeus
June 25th, 2014, 18:12
Yep, its true. PAR5E can write module data so that it appears in both the library and campaign items. At the moment PAR5E supports CoreRPG and 5E rulesets but can be modified to support any other ruleset.

I've been planning to release the source code for PAR5E to the community at a future point but if anyone out there wants the source right now so as to add additional ruleset support. Hit me up with a PM and I'll forward on the Java source.

Z.

kodarr
June 27th, 2014, 16:38
Is there a way to make them not show up in the NPC tab? I'm entering library module data for a new ruleset and would like to avoid having to do it all in xml.

Yes you can make them show up in library and not NPC tab. It takes A LOT of editing though.
1) I did mine for NPCs & new monsters and added them into a new module then exported as normal.
2) Then I opened the bestiary module and compared the db.xml of both files
3) I made the one I exported look similar to the bestiary one. Moving code around changing a tag here or there.

I'm a webmaster so reading and figuring out the code was simple it's all set up like html/css.

To save time in the future I'm going to just add all my monsters by code rather than in the program then reorganizing the data. That was a long drawn out process.

Thanks Trenloe. I never thought to look in the bestiary module before to fix my problems. Now I see they add a new section in there to add it in the side tabs and not the library. Removing that got rid of the NPC tab and reformatting made it show in the library. I still have an error if I click the Personality link it puts in there and not sure where that comes from but it's always at the bottom so I can avoid it easy enough.

lokiare
June 30th, 2014, 16:48
How would I go about doing this manually then? Can you post a sample of the new format? (All the library modules I can find are from older formats). I just need enough to understand how its formatted and what the basic tags mean.

Trenloe
June 30th, 2014, 17:02
How would I go about doing this manually then? Can you post a sample of the new format? (All the library modules I can find are from older formats). I just need enough to understand how its formatted and what the basic tags mean.
The bestiary modules that come with Fantasy Grounds display the NPCs in the library only. Open "PF-SRD-Bestiary.mod" to give you the format to display the NPCs in the library.

kodarr
June 30th, 2014, 21:06
How would I go about doing this manually then? Can you post a sample of the new format? (All the library modules I can find are from older formats). I just need enough to understand how its formatted and what the basic tags mean.

As Trenloe said.

If you open the bestiary that comes with fantasy grounds you can easily see the format. Long as you can decipher code it's fairly easy.

lokiare
July 1st, 2014, 14:31
What's the Mod file called? I've got like 30 mod files.

Trenloe
July 1st, 2014, 14:42
What's the Mod file called? I've got like 30 mod files.
See post #9.