PDA

View Full Version : Script on Reddit to Convert Dungeondraft LOS to xml for Fantasy Grounds



similarly
December 27th, 2020, 00:04
The other day, on reddit, I found this thread:
https://www.reddit.com/r/FantasyGrounds/comments/he3fod/i_created_a_script_to_convert_dungeondraft_los/

Here's the github link
https://github.com/rahulisaac/draft2fgu/releases/

Follow the directions in the readme, but here's the short version:
Export from dungeondraft to vtt format (instead of image file).
Put the script/exe in the folder with the files. Run the exe. It will automatically put png images and xml files in the same folder. Put the png files and xml files directly into the images folder for your campaign.

From the campaign, you can either create the image directly from an asset, OR create and image and drag the asset in. LOS is already calculated, including doors, walls and windows. Haven't tried secret doors yet, but that's next on my agenda! Everything works, including being able to open and close doors. Hope this helps other dungeondraft users.

Jiminimonka
December 27th, 2020, 00:07
and the Python Script is here - https://github.com/rahulisaac/draft2fgu

Three of Swords
December 27th, 2020, 05:40
This could end up being very useful to me in a copule of months. TY for the info!

similarly
December 27th, 2020, 09:00
One small problem I noticed is that it treats windows and doors the same. I'm having to delete the door LOS on windows to put in proper window LOS.

similarly
March 4th, 2021, 06:54
QUESTION:
Dungeondraft can export to VTT format. Any chance that FGU could at some point be able to import these vtt files without needing a 3rd party script/exe? It would save a step.

Jiminimonka
March 4th, 2021, 13:23
If FGU could import VTT Format - you would have a Dungeondraft map in 30 seconds, with LOS built in. Its all done in Python. Hopefully one day - or the mapping in FGU makes stuff like Dungeondraft obsolete for us FGU Elite ;)

similarly
March 4th, 2021, 14:30
Well, I've actually started doing some maps with the some of the tile sets like the Black Scrolls series.

Surge
March 8th, 2021, 11:25
One small problem I noticed is that it treats windows and doors the same. I'm having to delete the door LOS on windows to put in proper window LOS.

I wasn't aware that Dungeondraft had a window object type. The only thing I've come across in terms of 'portals' have been doors.

similarly
March 8th, 2021, 12:16
I wasn't aware that Dungeondraft had a window object type. The only thing I've come across in terms of 'portals' have been doors.

Maybe try updating to the latest version. Mine has doors AND windows, but I think mine ORIGINALLY had windows. It later had more with an update, though. However, they're grouped together in the same place.

Griogre
March 8th, 2021, 20:36
The "windows" in many cases in Dungeondraft look like doors unless you zoom in. But if the you hover the mouse over the object it will say window instead of door.

Surge
March 8th, 2021, 20:40
I've found them thanks. Had a play, and unfortunately the DD2VTT export doesn't make any distinction between doors and windows, so we won't be able to get a script to do so.

mla96
May 15th, 2021, 05:24
I made a few edits to the code and managed to get it to recognize doors vs windows, as long as they're set within Dungeondraft. If the portal is set to "Block Light", it will be treated as a door. If set to "Allow Light", it will be treated as a window.

I'm not a coder outside of some intro classes, and know pretty much nothing about Python, xml, or JSON, so it's probably not the best coding. But here's my update and I put in a request to the original author to merge changes.https://github.com/mleonardalbert/draft2fgu

similarly
May 15th, 2021, 05:27
Thank you! That's great work!

Imagix
May 24th, 2021, 17:39
To add on to the fun... I've just put in pull requests to add the basics of lights, and to set the grid size to the exported resolution. Two separate branches for pull request reasons.

https://github.com/Imagix/draft2fgu

similarly
May 24th, 2021, 23:49
Imagix, that sounds great.

mla96, the original creator made an exe that I could just click on. How does your .py file work?

Imagix
May 24th, 2021, 23:53
Hmm.. I'm primarily a linux person. And his Github doesn't seem to have the executable either. Will have to look a little to see how people want to package python scripts for Windows.

I'm hoping that mla96 reviews the pull requests I've done in the next few days. It seems impolite to just fork their project and tell people "just use mine".

Imagix
May 25th, 2021, 00:12
Say, I don't think mla96 is the original author either. Looks like he's forked off of the same build that seems to be originally published by Rahul Issac. (https://github.com/rahulisaac/draft2fgu) Though, his github doesn't seem to show any activity since last July, but commented on an issue in Feb. Let's see if they answer the pull requests.

mla96
June 7th, 2021, 23:51
similarly, I didn't see this until now. I have been learning Python so I didn't think about the exe file. I found a method to create an exe from a py file, so it's uploaded to my page now.

Imagix, yeah, I just forked it from Rahul Issac because I wanted to share the modification I made. I am not really familiar with Github, so I don't know if I'm missing things, but I don't see pull requests from you. I can't speak for Rahul Issac, but I am perfectly fine if you want to tell people to use your files. I likely won't be making many changes, I just wanted to tinker with the windows functionality because I was using windows a lot in maps.

Imagix
June 7th, 2021, 23:54
I'd posted the pull request to Rahul's project. But, then I'd decided that since Rahul doesn't appear to be responding, and with no stated license, that I'd write up my own script. (I was not trying to say that _you_ weren't responding/showing any activity)