fantasy-statblocks
fantasy-statblocks copied to clipboard
[WIP] Import from D&D beyond JSON
I've been working on an importer which imports from a D&D Beyond JSON. You can get a JSON for your character using the character service.
I've only added what was needed for my characters, so this is by no means a fully functional importer. Here's just a few things that haven't been implemented to give you an idea of what is not done:
- Spells. Nothing to do with spells has been implemented, because none of my characters are spellcasters. I imagine preparing spells and similar things would be a bit difficult, and would require a somewhat complicated system.
- Class/race/feats specific traits. For instance, expertise modifies the base stats, yet it has not been implemented. Because of this, some imports would be very different from the character sheet shown in D&D Beyond. This does import the traits, it just doesn't make all of the class/race/feat specific traits impact stats.
- Traits do not fully render correctly. D&D Beyond uses some formulas which get parsed when rendered, and hence are not reflected in the JSON. As an example of this, some traits have weird formulas in the middle of them, like "{{classlevel}} " or "{{(classlevel/2)@roundup}}". A method of parsing these and rendering them correctly would need to be developed (unless it was just left as-is for the user to decipher). Additionally, the code is also not very clean, which is because of me learning typescript as I made this.
Since a few very significant changes were made to the base code in this, and it needs quite a bit of work to maintain, I figured you may not want it merged. If you do want to include this in the plugin, I would clean up the code and do my best to implement some of what is missing. I see two paths forward:
- As much as possible is added, but not everything gets to be implemented. More would be implemented as needed. For instance, if someone realized expertise wasn't implemented properly, they would open an issue, and expertise would be added.
- Everything gets implemented, then it gets merged. This would be extremely time consuming, and I likely couldn't do this by myself.
I would look into adding jquery or something similar, so the user could just specify the character ID (shown in the D&D Beyond URL), and it would automatically access the character service. Every time I attempted to add this, it didn't work and I didn't feel it was worth the effort for just myself.
Thanks for all your work on Obsidian plugins, they've made DMing a campaign way easier for me :)
EDIT: also sorry about the commit names, they aren't very descriptive :p EDIT 2: this is made to be used with the character sheet I made.
Sorry I haven't had time to take a look at this, but awesome! I'll try to make time this week to see if the functionality is worth it, but I think it will be useful. Not sure I'll get to it - I'm moving soon
Sorry I haven't had time to take a look at this, but awesome! I'll try to make time this week to see if the functionality is worth it, but I think it will be useful. Not sure I'll get to it - I'm moving soon
No problem!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.