Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

MPMB to FoundryVTT

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

Homebrew character class cannot be loaded, resulting in an error

A topic by asoulliard created Jan 10, 2024 Views: 69 Replies: 6
Viewing posts 1 to 6
  • Bug description: Exception occurs at Step 6 of Conversion Instructions. Clicking on "Convert to FoundryVTT Actor" does not produce a JSON file, but instead brings up a dialogue box with an exception and stack trace.
    • Stack Tracehttps://pastebin.com/UsetNBrP
    • Additional Information: I'm using a homebrew character class that I made. I have the JS file for it if necessary.
  • Application version: 1.1.6
  • PDF version: 13.1.16
  • XFDF link: https://pastebin.com/EmYP7c13

I looked into this and you're using a homebrew class as you said, which isn't supported at the moment because of the way the converter matches classes. The actual class data can't be read from the PDF unfortunately, so the application uses class data files based on the name of the class. It does this for things like races, spells and items as well.

I do want to look if it's possible to extract the needed data from a JS file. If it has a standardized format, there should be a way. Ideally you could then put your JS class files in a folder so the converter is aware of them.

Can you provide me your JS file so I have a starting point? Thanks!

Yes of course! Here's the pastebin for the JS: https://pastebin.com/4gfbvn7B

FYI, I've made some progress in my attempt to parse the JS file to a format I can use in C#. I found a library that can convert JS to JSON, which means I can parse the JSON, which I have a lot more experience with. Progress is very slow, but I do think it's possible now. 

The next step is to list the minimal parts of a class that are necessary on my side to combine with the PDF data. Once I've created that list, I'll know if it's actually doable. I've collected a few sample JS class files to make sure my system will work with most JS files out there.

Another update! Using custom classes is now possible by placing the JS file in a special folder. The next step is some clean up and adding instructions for this new feature. I never use custom classes so I can't easily test if it works with all custom classes out there. I'm sure I'll get feedback about that soon enough with the next release.

For now, here's the JSON of your character: https://pastebin.com/BfiRPGxd
You can save that to disk and import it via Foundry. 

Cheers!

Oh that's amazing! I honestly didn't expect such a quick feature addition / addressing my issue. Thanks so much for your efforts! I'll test out the JSON import when I have some spare time and update you on success or failure. I'm still using the 2.4.1 release of the 5E system on Foundry and haven't updated to the 3.0.0 release. Out of curiosity, do you know of it would work with 3.0.0+? I suspect enough is different (such as the addition of the Race Items) that it would no longer function, but it's worth checking.

moved this topic to Issues (closed)

This issue is now fixed with the introduction of custom class importing.