Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2 3 4

Author Topic: Auto-designation macro  (Read 13587 times)

Valdemar

  • Bay Watcher
    • View Profile
Auto-designation macro
« on: December 30, 2007, 01:55:00 pm »

Note - Version 2 of this program has been released. It can instantly designate the patterns. Link

The auto-designation macro is an AutoHotKey macro that can read a design out of a spreadsheet and designate it in Dwarf Fortress. It takes a spreadsheet like this:
       
and creates this:
       
Instructions


  1. Create a spreadsheet. In it, use a blank cell for an unmined space, or a cell with a letter in it corresponding to the in-game designation (D=mine, I=up/down stair, etc). It should be bordered in # signs.
  2. Save as a .csv file. CSV files are like spreadsheets, but in a much easier to parse format. If your spreadsheet program asks you for CSV options, leave them at their default.
  3. Name your file roomdef#.csv, where # is a number 1-9 that you will use to access it from the macro
  4. Run the macro and press Alt-#, where # is the number from last step
  5. Run the game, go into the designation menu, move the cursor to the top-left square of the area you want designated, and press Alt-B
  6. Watch the printer-like operation of the macro

I've also written a program that can parse an image and generate the CSV, but it's definitely not robust enough to distribute. It's what I used to generate the second definition. If you have an image you'd like parsed, post it and I'll try.

Update! The macro can now do constructions as well. Create your construction definition files the same way you do the designation ones, using the construction hotkeys like w=wall, f=floor, etc. Name them "Croomdef#.csv", with the C in front. Before pressing Alt-B, press Alt-C to enter construction mode. You can then use Alt-# to switch files just like with designations. Then, press b-C-w to bring up the cursor and move it to the top-left corner of your desired construction, and press Alt-B. Alt-D will return you to designation mode afterwards.

Update 2! You can now choose which corner of the area you would like to indicate. Use Alt-Q to use the top-left (default), Alt-W to use the top-right, Alt-A to use the bottom-left, and Alt-S to use the bottom-right.

Demo Movie
Here's what the demo movie would have produced if I hadn't cut it off:
       
Download

[ December 30, 2007: Message edited by: Valdemar ]

[ January 03, 2008: Message edited by: Valdemar ]

[ January 28, 2008: Message edited by: Valdemar ]

[ April 01, 2008: Message edited by: Valdemar ]

Moocow

  • Bay Watcher
    • View Profile
Re: Auto-designation macro
« Reply #1 on: December 30, 2007, 02:34:00 pm »

You sir, have won the internet.

Could you do this?


[ December 30, 2007: Message edited by: Moocow ]

Logged
Death solves all problems - no dwarf, no problem.
- Joseph Stalin

0x517A5D

  • Bay Watcher
  • Hex Editor‬‬
    • View Profile
Re: Auto-designation macro
« Reply #2 on: December 30, 2007, 04:03:00 pm »

Very nice indeed.  I have been pondering a memory-editing utility to do this.  AHK should be a more robust solution.  Good on you, mate!
Logged

Valdemar

  • Bay Watcher
    • View Profile
Re: Auto-designation macro
« Reply #3 on: December 30, 2007, 05:26:00 pm »

Here's three more definitions I parsed (click the images):
Use right click, Save Link As, or it will just show you the file




Arnos

  • Bay Watcher
    • View Profile
Re: Auto-designation macro
« Reply #4 on: December 31, 2007, 05:20:00 pm »

This is a great tool! Thanks for making it.
Logged

Karzack

  • Bay Watcher
    • View Profile
Re: Auto-designation macro
« Reply #5 on: January 01, 2008, 02:42:00 am »

Nice...been wanting something like this.  Well, pretty much exactly like this.

Thanks

Logged
Life is short, live it.

Lavastine

  • Bay Watcher
    • View Profile
Re: Auto-designation macro
« Reply #6 on: January 01, 2008, 06:49:00 am »

Now someone needs to make an auto designator for making 3d buildings.
Logged

Armok

  • Bay Watcher
  • God of Blood
    • View Profile
Re: Auto-designation macro
« Reply #7 on: January 01, 2008, 09:08:00 am »

looks awesome.
Logged
So says Armok, God of blood.
Sszsszssoo...
Sszsszssaaayysss...
III...

Ltheb

  • Bay Watcher
    • View Profile
Re: Auto-designation macro
« Reply #8 on: January 02, 2008, 11:43:00 am »

This is awesome.  :)
Would it be possible to get this to also rewall as well? (using w = Wall, f = Floor or something) This designator is nice for mining out mass patterns, but rewalling/reflooring is far more tedious.
Logged

Valdemar

  • Bay Watcher
    • View Profile
Re: Auto-designation macro
« Reply #9 on: January 02, 2008, 04:50:00 pm »

quote:
Originally posted by Ltheb:
<STRONG>This is awesome.   :)
Would it be possible to get this to also rewall as well? (using w = Wall, f = Floor or something) This designator is nice for mining out mass patterns, but rewalling/reflooring is far more tedious.</STRONG>

That's a good idea. I'll try to get it to do constructions too.

Bharani

  • Bay Watcher
    • View Profile
Re: Auto-designation macro
« Reply #10 on: January 03, 2008, 04:02:00 pm »

If this did rewalling, it it would be the ultimate DF designer.
Great work. It's better than doing what I did to make the largest fractal patterns -- opening them in Photoshop and overlaying images of them on images of my fortress. I had to have two windows open, and copy the photoshop window to by tracing it into DF so that the pattern would come out perfectly. You've saved me that trouble. Thank you.
Logged

Valdemar

  • Bay Watcher
    • View Profile
Re: Auto-designation macro
« Reply #11 on: January 03, 2008, 07:18:00 pm »

Constructions have been added! See the OP for updated instructions.

Fenrir

  • Guest
Re: Auto-designation macro
« Reply #12 on: January 03, 2008, 07:42:00 pm »

You rock, Vlad!
I'm doing something wrong, but I don't know what. Whenever I make a design, it seems like it goes down one at the end of a row, but not back to the beginning of a row.
Logged

Valdemar

  • Bay Watcher
    • View Profile
Re: Auto-designation macro
« Reply #13 on: January 03, 2008, 07:47:00 pm »

quote:
Originally posted by Fenrir:
<STRONG>You rock, Vlad!
I'm doing something wrong, but I don't know what. Whenever I make a design, it seems like it goes down one at the end of a row, but not back to the beginning of a row.</STRONG>

That happens if you don't include the '#' at the end of the row.

Fenrir

  • Guest
Re: Auto-designation macro
« Reply #14 on: January 03, 2008, 07:59:00 pm »

quote:
Originally posted by Valdemar:
<STRONG>

That happens if you don't include the '#' at the end of the row.</STRONG>



Hmmm... I did. I'll try again and if it still doesn't work, I'll show you the csv file.
Logged
Pages: [1] 2 3 4