Thread: Character Class Module
-
August 11th, 2017, 12:21 #61
Classic & Unity Ultimate License Holder
-
August 12th, 2017, 11:01 #62
Thanks, swbuza - that's fixed it so I can drag-and-drop the class abilities to the correct place on the character sheet! However, they're still all blank when I open them. Is there something else in the formatting of the xml entries that I need to change?
Last edited by Callum; August 12th, 2017 at 11:03.
-
August 12th, 2017, 13:45 #63
I do not know, because I'm not particularly familiar with this module.
What I found most useful was opening a blank campaign, loading no modules, and manually creating a race, a class, and the racial traits and class features of each. Then close FG and open the db.xml with Notepad++ and pay attention to where and how it stores everything.
Classic & Unity Ultimate License Holder
-
August 12th, 2017, 21:16 #64
Thanks for the suggestion, swbuza - I'll do that.
-
October 6th, 2017, 02:03 #65
- Join Date
- Oct 2017
- Posts
- 4
Hi Nick,
When I load the module in the Library, I can see it. But none of the information transfers to the NPCs, Races, Classes etc. tabs
Am I missing a step?
-
October 11th, 2017, 18:53 #66
- Join Date
- May 2017
- Location
- Strasbourg (France)
- Posts
- 43
From the library, what you see is the info inside the <benefit> tag. From the character sheet (class abilities / proficiency / racial traits), you only see what is inside the <text> tag.
From what I can see, unfortunetly, in this module there is no <text> tag. The information will be properly copied during drag-and-drop, but it is just not visible unless it is in the "feat" part of the character sheet :-(
-
October 21st, 2017, 08:14 #67
- Join Date
- Feb 2017
- Posts
- 7
I fixed my copy so that the info would appear, at least for class abilities I didn't test it beyond that. I simply opened the common.xml in wordpad. Used the replace command to replace every instance of "benefit" with "text". Then I went through again, replacing most instances of " text " with " benefit " (note the spaces). There were a few entries where " text " was correct so you have to look at it, but there's not too many. Seems to work.
I tried doing a replace "benefit type" and "/benefit" with "text" equivalents, but that created an error I couldn't figure out. It told me the line, but I didn't see anything wrong.
-
October 21st, 2017, 12:21 #68
- Join Date
- May 2017
- Location
- Strasbourg (France)
- Posts
- 43
It's a bit hard to diagnose stuff without the actual error message :-P
Anyhow, this module was created back when you could only drag-and-drop feats onto your character sheet, so the author wrote all his entries as if they were feats rather than class abilities.
About a couple of updates ago (I think?) they also added the possibility to drag-and-drop in the class/proficiency/racial windows.
However feats, class abilities, proficiencies and racial traits each have their own class, and expect to find information in different tags.
- feats will look for relevant information in tags such as <benefit>, <special>, etc.
- class abilities, proficiencies and racial traits expect to find thir information in a <text> tag.
Simply changing <benefit> to <text> might work for drag-and-dropping, but you will lose the ability to read the contents of the entry from the library because the library still thinks the entry is a feat and will try to locate the information in a <benefit> tag.
So you have two possibilities :
- What I did in my own modules is "cheat" and make my entries act both as feats and class abilities by having both a <benefit> and a <text> tag with the same content. The advantage of this, is that not only can you still read the content from the library, and drag-and-drop from the library onto your sheet, but even from one window of the character sheet to another, and still be able to read the information. So just duplicate <benefit> tags into sibling <text> tags. Since there are thousands of entries in this module, doing this in a notepad will take a while, but programming a little script to do this is fairly easy.
- The second possibility (which is probably the "cleanest") is to transform all the feat entries of the module into class ability entries. This is quite easy to do in a notepad: you only need to replace "referencefeat" with "referenceclassability", "<benefit" with "<text", and "</benefit" with "</text". I've given it a try just now and it seems to work fine. This solution does however have a downside from the previous one: if you drag-and-drop your entries into the "feats" window rather than the "class abilities" window of your character sheet, you won't be able to read the text because there no longer is a <benefit> tag.
-
October 22nd, 2017, 03:34 #69
- Join Date
- Feb 2017
- Posts
- 7
The error message was for a failure to read closing tag. I checked the tag and it seemed fine. I did actually change the reference tag, I forgot to mention. I'm not super savvy at this, so I'm just swingin' a hammer. Also probably should leave the module editing for not 2am. My players mostly build outside of FG so if I fix the racial traits they should be none the wiser. Can you expand on making a script to do the duplicating?
-
October 22nd, 2017, 21:07 #70
- Join Date
- May 2017
- Location
- Strasbourg (France)
- Posts
- 43
Most scripting languages have extensions to manipulate XML easily.
For instance in Python with the BeautifulSoup extension, the following script would duplicate all the "benefit" into "text" tags:
from bs4 import BeautifulSoup
import copy
with open("common.xml", 'r') as inputfile:
soup = BeautifulSoup(inputfile.read(), "lxml")
for benefit in soup.find_all("benefit"):
new_item = copy.copy(benefit)
new_item.name = "text"
parent = benefit.parent
parent.append(new_item)
with open("common2.xml", 'w') as outputfile:
outputfile.write(soup.prettify())
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks