Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Continuing Quickfort troubles  (Read 2050 times)

Xolroc

  • Bay Watcher
    • View Profile
Continuing Quickfort troubles
« on: June 11, 2013, 07:27:29 pm »

Well, I gave up on getting it to work with buildingplan.  After working my dwarves as much as they'd work, I got all the necessary furnishings.  But now when I run quickfort it simply stops after designating a few of the 256 beds, 256 doors, and 256 cabinets I'm having it build.  It does get considerably further than it did without the requisite items, but it doesn't have any visible problems.  I'm not moving the mouse, it's not wildly moving the screen around like I'd pressed esc; it just stops with no error message as if it had successfully finished.

What's going on here?
Logged

Xolroc

  • Bay Watcher
    • View Profile
Re: Continuing Quickfort troubles
« Reply #1 on: June 11, 2013, 10:55:56 pm »

Well, I tried setting MACRO_MS from 0 to 5, and that made it work (though far too slowly).  I can only conclude it was freezing up from excessively rapid input, causing some input to be ignored.
Logged

GiantUrist

  • Bay Watcher
    • View Profile
Re: Continuing Quickfort troubles
« Reply #2 on: June 12, 2013, 02:50:51 am »

A lot of the input in the Quickfort-generated macros are unnecessary because Quickfort seems to output all the possible bindings per key (e.g. bed, ballista etc).

In spite of being unnecessary, they are still processed by the game when the macro is played back. Filtering them out should help.

I use this sed script for cleaning up the .mak file for a furniture build phase after it's generated:
Code: [Select]
#!/usr/local/bin/gsed -nf
#1 s/\(.*\)/\1Clean/p
1p
2,$ {
/HOTKEY_BUILDING_MACHINE/d
/HOTKEY_BUILDING_CONSTRUCTION/d
/HOTKEY_BUILDING_WORKSHOP/d
/HOTKEY_BUILDING_FURNACE/d
/HOTKEY_BUILDING_SIEGEENGINE/d
/HOTKEY_BUILDING_TRAP/d
/HOTKEY_BUILDING/p
/CURSOR/p
/End/p
/SELECT$/p
/LEAVESCREEN/p
}

In your particular case, you would make a copy of your .mak file, go into this copied file and remove all lines after the first line (the title) that aren't one of:

Code: [Select]
CURSOR_* (CURSOR_UP, CURSOR_DOWN, CURSOR_DOWN_FAST, CURSOR_DOWNLEFT, etc)
End of group
End of macro
HOTKEY_BUILDING_BED
HOTKEY_BUILDING_DOOR
HOTKEY_BUILDING_CABINET
SELECT
SEC_SELECT
LEAVESCREEN

You should also rename the title or move the original .mak file from the macro folder.

At this point, you should be able run this macro with a higher MACRO_MS and it should finish fairly quickly.

Do bear in mind that it's ok to wait a little considering that you are designating 768 pieces of furniture.

Hope that helps,
Logged

Xolroc

  • Bay Watcher
    • View Profile
Re: Continuing Quickfort troubles
« Reply #3 on: June 12, 2013, 10:27:06 am »

Yes, I don't expect it to be instantaneous.  Thanks for the tip, but I don't actually know what a sed script is, or a .mak file (though I'm assuming it's how it stores macros?)
Logged

GiantUrist

  • Bay Watcher
    • View Profile
Re: Continuing Quickfort troubles
« Reply #4 on: June 12, 2013, 10:23:23 pm »

The .mak files are the macro files found under the  data/init/macros of your Dwarf Fortress folder.

Sed is a "Stream editor". It's a command-line program that's found on Linux and OS X machines.

A Windows version can be found here: http://gnuwin32.sourceforge.net/packages/sed.htm.

Install the program using the "Complete package, except sources" download link.

http://www.thoughtasylum.com/blog/2011/9/30/using-sed-on-windows.html has a quick guide on how to use it.

Save the following as clean_qf_furniture_macro.sed.
Code: [Select]
#!/usr/local/bin/gsed -nf
#1 s/\(.*\)/\1Clean/p
1p
2,$ {
/HOTKEY_BUILDING_MACHINE/d
/HOTKEY_BUILDING_CONSTRUCTION/d
/HOTKEY_BUILDING_WORKSHOP/d
/HOTKEY_BUILDING_FURNACE/d
/HOTKEY_BUILDING_SIEGEENGINE/d
/HOTKEY_BUILDING_TRAP/d
/HOTKEY_BUILDING/p
/CURSOR/p
/End/p
/SELECT$/p
/LEAVESCREEN/p
}

Click Start, then Run, enter "cmd" into the space provided and click OK. The Windows command-line terminal will show up.
Enter the following while replacing the sections in curly braces with the relevant information.

Code: [Select]
C:
CD "C:\Program Files\GnuWin32\bin"
sed -nf {path\to\clean_qf_furniture_macro.sed} {path\to\your\macro\file}.mak > {path\to\your\macro\file}_clean.mak
Logged