PDA

View Full Version : FGU automatic adventure markdown converter to D&D 5e



Syldar
August 31st, 2025, 03:54
Hi, everyone. I coded an extension for FGU to be able to import really fast D&D 5e adventures from markdown files. The goal was to import everything from story, chapters, bold, italic, tables, NPCs with all their stats, spells, encounters, places and so on.

Everything seems to be loading without error when I open FGU and the campaign, and FGU says my extension is loaded, but despite all my tries, even including AI coding help, I cannot successfully use my extension (with only one active extension). Could somebody help me to identify the problem and telling me how to fix it? I can share the extension freely then, as I believe it can help many GM to create wonderful campaigns.

I share the current state of my extension in this post. If anyone could help me on this, it would be awesome.
Some persons told me also that it could be possible to code an external small software to directly convert markdown files to XML FGU modules (outside of FGU) and that it may be more stable that way. Just let me know your thoughts on this as well.

Any help would be much appreciated.

Very best,
Syldar

Trenloe
August 31st, 2025, 04:49
I've moved this thread to The Workshop forum - this is the best place to ask questions about coding in FG.

Is there an extension that you've based this on? Or is this mostly AI generated? The reason I ask is because a lot of the code isn't valid FG code - I'd describe it as pseudo code that I would hazard a guess was put together through an AI. There are some XML tags that aren't valid ('version' in windowclass for example), some resources that don't exist ('reference' frame) and some controls that don't exist in FG nor in the extension ('richedit' and 'titlebar', for example). Plus a lot of the XML doesn't follow the format detailed in the FG Wiki here: https://fantasygroundsunity.atlassian.net/wiki/spaces/FGCP/pages/996644535/Developer+Guide+-+API+Reference

My recommendation - start again with the bare minimum needed - a basic window with the text control and button to launch parsing. Then work with one record type to get that working. Use another extension as an example - maybe look at this one: https://forge.fantasygrounds.com/shop/items/2340/view It has a simple window with a couple of controls and buttons, that launch a parsing process. For testing, you can open a windowclass directly from the chat window using /openwindow <windowclass name> which allows you to concentrate on getting your base window and code working before you decide where your extension's window will be launched from.

Syldar
August 31st, 2025, 13:17
Thank you very much for your kind reply. Yes, I coded with AI and despite providing it with FGU APIs, it coded it like this. I tried to optimize the code, but it is the same result. I send again the extension with the updated code. Is it still that bad? in case somebody can help me on this, it would be awesome.

I'm industrial designer, so I could easily work on the GUI and user experience design, but for the code, I really need help.
Would somebody be ok to partner with me on this one?