Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

MPMB to FoundryVTT

Easily move your D&D characters to FoundryVTT · By BlackDragonBE

Something went wrong while trying to convert the XFDF data

A topic by BaronVB created Feb 16, 2025 Views: 119 Replies: 9
Viewing posts 1 to 4
(1 edit)
  • Bug description: XFDF Conversion Error
  • Application version: 1.2.1
  • PDF version:  v13.2.3
  • Foundry D&D 5e system version: 2.2.1
  • XFDF link: https://pastebin.com/kDQjgeA8
  • Patreon username: BaronVB

    Trying to convert a fresh character for testing, getting non-stop errors.


    Something went wrong while trying to convert the XFDF data:
    Index was outside the bounds of the array.    at MPMB_PDF_to_FoundryVTT.CSharp.Converters.MpmbToFoundryConverter.ConvertRacialAndClassFeatures() in U:\Godot\Projects\2022\MPMB_PDF_to_FoundryVTT\CSharp\Converters\MpmbToFoundryConverter.cs:line 466    at MPMB_PDF_to_FoundryVTT.CSharp.Converters.MpmbToFoundryConverter.Convert(MPMBCHaracterData mpmbCharacterData, FoundryCharacterData foundryTemplateData, MainWindow mainWindow) in U:\Godot\Projects\2022\MPMB_PDF_to_FoundryVTT\CSharp\Converters\MpmbToFoundryConverter.cs:line 49    at MainWindow.LoadXFDFFromTextAsync() in U:\Godot\Projects\2022\MPMB_PDF_to_FoundryVTT\CSharp\MainWindow.cs:line 342

Could really use some help if possible

I'm so sorry for the late reply! I thought I already answered here.
I actually already fixed the issue around mid-February, here is a link to the character JSON: https://pastebin.com/UWgZu1qk

I have a new build ready as well, v1.2.2, I'll see if I can upload that today. Again, I'm so sorry for taking so long, I could've sworn I already replied here, my mistake.

(+1)

No worries, thank you! I would love to get access to the new build if possible. 
Got some custom characters with 3rd party content I want to see if I can convert at some point.

Appreciate you!

I've just uploaded v1.2.2 of the converter, enjoy! Let me know if you run into any bugs. Thanks so much for your patience and understanding.

Appreciate the update! I downloaded and tried to use it with my current MPMB character that uses a Obojima Paladin class, "Oath of the River", I added the Obojima JS files from MPMB into the Custom_JS_Classes folder but I get the error "Couldn't load information about Oath of the River" followed by the below error.

XFDF Text: https://pastebin.com/xG2rP0yJ

Custom JS File: https://pastebin.com/Gfhz1QrZ


Something went wrong while trying to convert the XFDF data:

Sequence contains no matching element

   at System.Linq.ThrowHelper.ThrowNoMatchException()

   at System.Linq.Enumerable.First[TSource](IEnumerable`1 source, Func`2 predicate)

   at Five.FiveBackgroundDataLoader.GetBackgroundData(String backgroundName) in U:\Godot\Projects\2022\MPMB_PDF_to_FoundryVTT\CSharp\5eTools\FiveBackgroundDataLoader.cs:line 36

   at MPMB_PDF_to_FoundryVTT.CSharp.Converters.MpmbToFoundryConverter.ConvertCharacterBackground() in U:\Godot\Projects\2022\MPMB_PDF_to_FoundryVTT\CSharp\Converters\MpmbToFoundryConverter.cs:line 577

   at MPMB_PDF_to_FoundryVTT.CSharp.Converters.MpmbToFoundryConverter.Convert(MPMBCHaracterData mpmbCharacterData, FoundryCharacterData foundryTemplateData, MainWindow mainWindow) in U:\Godot\Projects\2022\MPMB_PDF_to_FoundryVTT\CSharp\Converters\MpmbToFoundryConverter.cs:line 48

   at MainWindow.LoadXFDFFromTextAsync() in U:\Godot\Projects\2022\MPMB_PDF_to_FoundryVTT\CSharp\MainWindow.cs:line 342

Attached my current XFDF + the JS file used for the class in MPMB.
Any suggestions? Sorry for being annoying haha. 

Thanks for the report. I'll take a look at this soon. The custom JS functionality is still very experimental, so this will be a good opportunity to improve it.

Update: I took a look at your custom JS issue. There are a few things I noticed:

  • A lot of the spells have P4 as a source, while being PHB spells, those won't be imported without the correct source. Can you tell me what the P4 means? Is it the 2024 PHB?
  • You're using a custom background, which isn't supported yet, only classes for now.
  • The JS has a different format from the examples I used to build the parsing logic. This causes the custom class loader to fail. The class you're trying to load is a Paladin subclass, but it won't load due to the format.

I'm going to try to implement custom background and subclass loading from JS files, this will take me a while as it's complex. The main reason why the converter crashes though is because of the custom background. The converter can handle missing subclasses, they just won't have a description.

Appreciate the update, I will look into the P4. This Obojima script is from the community scripts index, so I don't know much more about it other than that. 
Let me know if there is anything I can do to help test or etc.

I just confirmed, the P4 spells are from the 2024 Player's Handbook. Specifically the script recommended by MPMB's patreon: https://github.com/thepokesimmer/2024-PHB/tree/main