Output Format
The FG Character Extractor generates individual XML files for each character found in the Fantasy Grounds database. This page explains the output format, structure, and naming conventions.Filename Convention
Extracted character files follow this naming pattern:Components
The unique character identifier from the Fantasy Grounds database (e.g.,
id-00001, id-00002)The character’s level, extracted from the
<level> tag. Defaults to 0 if not present or empty.Examples
character_id-00001_5.xml- Character with ID “id-00001” at level 5character_id-00002_3.xml- Character with ID “id-00002” at level 3character_id-00003_0.xml- Character with ID “id-00003” with no level specified
The filename is generated in
main.go:178 using fmt.Sprintf("character_%s_%s.xml", c.ID, level)XML Structure
Each extracted file follows this structure:Root Element
The<root> element includes Fantasy Grounds version information:
These attributes match the Fantasy Grounds Unity edition format and ensure compatibility with the game system.
Character Element
All character data is wrapped in a<character> element, which contains the complete character sheet information from the original database.
Filtered Elements
The tool automatically removes certain tags during extraction to filter out sensitive or unnecessary data:Regex Pattern
The tool uses this regular expression to identify tags to skip:main.go:43
Filtered Tags
public
public
The
<public> tag indicates whether a character is visible to players. This is campaign-specific metadata that’s not needed in the extracted character file.holder*
holder*
Tags starting with
holder (like <holder>, <holdername>) contain information about which user controls the character. This is session-specific data that’s filtered out.Enhanced Features
Automatic Skill Total Calculation
One of the key features of the extractor is automatic skill total calculation. The tool reads ability bonuses and proficiency values, then computes skill totals:main.go:220-228
Formula
- ability_bonus: The modifier for the relevant ability (STR, DEX, etc.)
- proficiency: 0 (not proficient), 1 (proficient), or 2 (expertise)
- proficiency_bonus: The character’s proficiency bonus based on level
Example
For a level 5 character (proficiency bonus +3) with DEX modifier +2 and proficiency in Stealth:Character Encoding
The tool properly escapes special XML characters during extraction:main.go:245-248
Escaped Characters
| Character | Escaped As | Reason |
|---|---|---|
& | & | XML entity delimiter |
< | < | XML tag delimiter |
> | > | XML tag delimiter |
Carriage returns (
\r) are normalized to newlines (\n) for cross-platform compatibility.Data Preservation
The tool preserves:- ✅ Original XML structure and hierarchy
- ✅ All character attributes and values
- ✅ Whitespace and formatting within character data
- ✅ All nested elements (abilities, skills, inventory, etc.)
- ✅ Type attributes (e.g.,
type="number",type="string")
Example Output
Here’s a simplified example of an extracted character file:character_id-00001_5.xml
Validation
All output files are valid XML and can be:- ✅ Parsed by standard XML parsers
- ✅ Validated against XML schemas
- ✅ Imported back into Fantasy Grounds
- ✅ Processed by other XML tools
Next Steps
Command Reference
Learn about command-line options
Usage Examples
See practical examples of using the tool