Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: PaintFort - generate blueprints for QuickFort using images  (Read 4205 times)

cybergon

  • Bay Watcher
    • View Profile
PaintFort - generate blueprints for QuickFort using images
« on: December 08, 2011, 02:47:00 pm »

Download: http://www.mediafire.com/?p355wi7mfvtrf12
Source code (AutoIt): http://pastebin.com/jYmbe1MD

Description: This utility is meant to be used as a complement for QuickFort, so it's good to be familiar with how that one works beforehand. PaintFort takes an image that you can make in MSPaint or a similar program, or get it online, then turns it into a spreadsheet .CVS file for QuickFort to read and apply to your fortress.

How to use: Here's an example of an image PaintFort can use to create a neat blueprint:



On the image each pixel ends up as a designated tile in Fortress mode, and each unique color lets you designate something different like digging or channeling. I made the image like this so I can decide if those dark blue lines are going to be dug out or left blank for me to dig it later. If you zoom in, the colors you see inside each room are there for when I decide to make the "build" blueprint, so the (b)ed can go where the red pixels are and anything I wanna give to the dwarves goes on the other pixels.

Download the image and open it by clicking on "Select new image". Once it's done, a list of unique colors will appear with a separate field for each. Type in the header you want to use: it could be "dig" for digging or "build" for building, for more headers you can refer to the QuickFort user guide. Assign a value to each of the colors, or leave it blank to ignore that color; if you're digging then "d" would designate that space for digging, if you're building it will place a door and so on according to the Dwarf Fortress' hotkeys you have. For convenience, if you can't find where a particular color on the image is supposed to be, click on it's corresponding colored button on the left of each field and it will blink so you can see where it is. QuickFort will ask you to place the cursor somewhere on your DF map for reference to start laying out your blueprint, this is the starting position. Click the "Get starting position" button to manually select it by pointing at anywhere on the image. Leaving it in blank defaults to QuickFort starting from the top left. Finally, click on "Export CSV" when you're done to save the .csv sheet. Use it with QuickFort and see your blueprints come to life!

I also added a resize button to change the size of the window if it's too small or too big for you, but don't get too crazy with it ok? It resets after you close it though, so no worries.

Saving your work: When you have loaded an image and finish filling up the form, you can save what you've done so far with the "Save Data" button. This produces a .paintfort file that indicates where the image you used is located and all the information in the fields. It's just a text file, so you can modify it in notepad at your will. Load it with the "Load Data" button -or drag&drop it on the PaintFort executable- and everything will be just like you left it. There's no confirmation box when you close or load a file though, so be careful not to lose any progress.

Notes: Don't use images that are too big or have too many colors, remember that each pixel is a tile. For reference, use the image I showed you before, it should be sharp and usually small. Recommended formats are .bmp .png and non-animated GIFs. You can use .jpg and the others if you so desire, but beware though, each color in every pixel, no matter how similar, will be treated as unique, so it's recommended you draw with non-smoothed tools like the pencil in paint, or use some method to set a color threshold (e.g. in photoshop, save the image as GIF and use an adaptive palette). Make sure no compression artifacts appear when saving, specially on .jpg which is almost guaranteed to fail with this.


I appreciate input on ideas or any issues that you're having.

Enjoy!
« Last Edit: December 01, 2014, 05:47:41 am by cybergon »
Logged

cybergon

  • Bay Watcher
    • View Profile
Re: PaintFort - in memorial to ChromaFort
« Reply #1 on: December 11, 2011, 01:25:24 pm »

Uhh is there something wrong? Did I post this in the wrong place? I just wanted to share it.
Logged

rephikul

  • Bay Watcher
  • [CURIOUSBEAST_IDEA]
    • View Profile
Re: PaintFort - in memorial to ChromaFort
« Reply #2 on: December 11, 2011, 01:32:21 pm »

People usually arent comfortable with links from first time posters.
Logged
Intensifying Mod v0.23 for 0.31.25. Paper tigers are white.
Prepacked Dwarf Fortress with Intensifying mod v.0.23, Phoebus graphics set, DFhack, Dwarf Therapist, Runesmith and a specialized custom worldgen param.

cybergon

  • Bay Watcher
    • View Profile
Re: PaintFort - in memorial to ChromaFort
« Reply #3 on: December 11, 2011, 01:56:02 pm »

Ah I figured, that's why I posted the source too, you can examine the code and compile it yourself with autoit.

Also sorry for not introducing myself first, I post in many different forums so it happens. Nice to meet you all!
Logged

neo1096

  • Bay Watcher
  • It watches and waits...
    • View Profile
Re: PaintFort - in memorial to ChromaFort
« Reply #4 on: December 11, 2011, 02:03:02 pm »

Welcome to the forums! As a long time user of both Quickfort and Chromafort, I'll be sure to try out your utility.
Logged
What again? Iron scepter - Lovehealing? Oh, I almost shed a tear... Put it in your ass, I'm talking about importans artistic defences!!! You see, yaks and bridge... Stop polishing that scepter! You're disgusting me!"

cybergon

  • Bay Watcher
    • View Profile
Re: PaintFort - in memorial to ChromaFort
« Reply #5 on: December 11, 2011, 03:43:40 pm »

Thanks. I frequently end up here on account of google, so I guess that's why I felt like I belonged here haha. I'll have a look around and see what else is there to do. I hope my work is of use to you!
Logged

cybergon

  • Bay Watcher
    • View Profile
Re: PaintFort - in memorial to ChromaFort
« Reply #6 on: June 22, 2012, 12:31:30 am »

Updated at last!

Sorry for letting this die off, but I got frustrated with some display bugs and I also didn't have much time with classes.

It took me the whole afternoon to finally work it out and turn this into an actual reliable utility.

I hope you guys like it!
Logged

wrajjt

  • Bay Watcher
    • View Profile
Re: PaintFort - in memorial to ChromaFort
« Reply #7 on: June 27, 2012, 03:02:08 pm »

Hello!

I get an error everytime I try to load up blueprints made in PaintFort in QuickFort. I am probably doing something wrong with the syntax used in PaintFort. This is the error message I get after selecting the test-blueprint I've created. http://i173.photobucket.com/albums/w71/wrajjt/error.jpg

Any idea what I am doing wrong? I know the error message is Quickfort related, but the blueprints that are included with that application works perfectly.
Logged

cybergon

  • Bay Watcher
    • View Profile
Re: PaintFort - in memorial to ChromaFort
« Reply #8 on: August 10, 2012, 08:18:04 pm »

mmmmm I'm not sure, maybe I messed up something in the update, though that part of the code was pretty much untouched. Could you send me the generated blueprint so I can have a look?
Logged

cybergon

  • Bay Watcher
    • View Profile
Re: PaintFort - generate blueprints for QuickFort using images
« Reply #9 on: November 04, 2014, 05:10:20 am »

Modified the OP to make it a little less confusing. Everything seems to work fine with the latest versions of the game so no changes to the code were made this time. See ya in DF2016!
Logged