DFWall 0.916aDFWall demos on DFMA:
1. http://mkv25.net/dfma/movie-495-dfwalldemo - the old rectangle rewalling demo (this function works quicker now), watch at the "Rate: 300" setting
2. http://mkv25.net/dfma/movie-520-dfwalldemo2 - the new template construction demo, watch at the
"Rate: 200" setting
1. What is it?
A little script written in AHK (with a little side program in C used for creating a tile map) that automates construction.
2. How does it work?
By scanning certain pixels from the DF window and then using a map to make sense of the data.
3. How do I use it?
First lets assume that you've set everything up correctly - or are playing Dwarf Fortress in a window with all settings at default (under windows XP, with the default look of the windows). If you didn't (or aren't), the setup process is described later.
DFWall has two main functions:
I. Rectangle rewalling/reflooring
II. Pattern construction
I.
=================
Rectangle rewalling instructions (by Fedor)
Usage:
1. Type 'b', then 'C' to go to the wall/floor construction interface. Choose any type of construction and location, then select (but do not choose) a material type. With the material highlighted, hold down either Ctrl key and type a digit from 0-9, using the keys at the top of the keyboard and not the number pad. The program will visibly load your preference.
2. Return to the wall/floor construction interface, choose the appropriate construction type, and get to the selection of a location. Move the cursor (selector) to one corner of the rectangle you wish to fill with constructions. Hold down either Ctrl key, and use the arrows or numbers on the main keypad (not the number pad) to navigate to the opposite corner. Release Ctrl.
3. Hold down the letter used to build the construction type (f (for floors), w (for walls), etc.), type the number you used to select the material type, then release the letter.
The utility will now automatically build the constructions, one by one, until the rectangle is filled.
=================
Notes:
1. You can also use the ".", "," and "/" keys instead of a material number to access the special construction functions. For the full explaination scroll down to the 0.915->0.916 changelog.
2. The first tile constructed will always be determined by the menu you are in when you start the construction. While DFWall only supports mass rectangle construction of walls/floors you can use that fact to quickly build a single tile of pretty much anything using a specific material.
EXAMPLE: Lets say you want to build green glass boxes in your dwarves quarters. Your "build container" menu is probably filled with all kinds of bags making the selection of the box pretty tedious. Here's where DFWall steps in - save the green glass box like you would save any construction material (using ctrl+9 for instance) and now whenever you want to build a green glass box just go into the container placement menu and tell DFWall to build a 1x1 floor tile using the saved box (f+9 in this case). DFWall will then find it and place it for you. Do not try to build more than one tile of non supported constructions at a time because that will probably lead to strange behaviour.
3. Potentially usefull: "`" (show current dX and dY for the rectangle building option) and "CTRL+`" - (reset dX and dY - done automatically after building a rectangle)
(note: ` - the button on the left of "1")
II.
The second function is a bit more complicated, but still pretty simple. By pressing CTRL+q while in the "select where to build a floor" menu you tell DFWall to build according to a template contained in "template.dft" using the currently selected tile as the upper left corner. After that DFWall will carry out the instructions using whatever materials you have saved under the appropriate numbers. For example:
Template file contents:
3
3
_
111
121
11.
_
fff
fwf
fff
This will build one wall tile surrounded by floor tiles potentially made from something different than the wall. For instance, if you save "crystal glass block" under 1 and 2 everything will be built from crystal glass when you press CTRL+q. If you save "gold bars" under 2 and "granite" under 1 the floor will be made from granite while the wall will be made from gold. The lower right floor has "." instead of a number - that means using the first available material on the list.
Template file format:
The first line tells the width of the template (X)
The second line tells the height of the template (Y)
The first "_" has to be in the third line
X*Y map of which numbers will be chosen for the materials when building the (x,y) tile. "." can be used as "the first one available".
The second "_" has to be directly under the last line of the map
X*Y map of the actual constructions and their places
The whole thing is actually rather straightforward if you look at the example provided above and the one included in the zip.
The full list of available symbols for the construction map:
. - nothing
t - table (will not be built outdoors)
c - chair (will not be built outdoors)
s - statue
j - cage
v - restraint
f - floor
w - wall
R - ramp
U - up stairs
D - down stairs
X - up/down stairs
F - fortification
4. Okay, so - how do I set this thing up?
------------------------------------SETUP------------------------------------
To work DFWall needs a pregenerated map file for the tileset used by DF. The map file allows very quick identification of tiles, so you'll need to generate one for yourself, unless you still play in 640x300 windowed mode using the default curses tileset in which case you're in luck! I've included the map file for that. Otherwise here are the step by step instructions:
Step I: Run DFWall_MapMaker.exe.
Step II: Fire up your favorite image viewer and load the tileset file.
Step III: Find the coordinates for the upper leftmost pixel of the tileset being shown and the background colour (it'll probably be 0xFF00FF). Use your mouse pointer and the CTRL+m command to do it.
Step IV: Make appropriate changes to the DFWall_MapMaker.ini file and restart DFWall_MapMaker. You can get the correct values of TileWidth and TileHeight pretty easily using one of those methods:
- If the minimal intended resolution for the tileset is AxB, then TileWidth = A/80 and TileHeight = B/50
- TileWidth = (width of the tileset)/16, TileHeight = (height of the tileset)/16
- If the tileset has a full rectangle tile just count how wide and high it is (in pixels)
Step V: Select your favorite image viewer window with the tileset loaded. Press CTRL+1 ONCE - it WILL work, even if it won't notify you about it. Wait until the mapmaker tells you it's finished. Check the generated .dfm file for accuracy of the image to text processing.
Step VI: If unsatisfactory go back to Step IV. Otherwise select your favorite image viewer window again and press CTRL+2. Wait for the notification.
Congratulations! You've probably just generated a .dfm file for your tileset!
Important note: This map doesn't scale, so you will only be able to use it if you play in the TileWidth*80xTileHeight*50 resolution.
Now just edit the DFWall.ini and you're set. Most of the things inside are pretty self explainatory. Notes:
- XStart and YStart are the coordinates for the upper leftmost pixel of the actual game in the window. How to get them:
1. Open Dwarf Fortress
2. Press alt+prt scr
3. Open MS Paint
4. Paste
5. XStart and YStart are the coordinates of the pixel coloured red in this picture:
- You may want to change PageDownButton (move the material selection screen by a whole page) and ScrollDownButton (scroll down the selection by one item) to what you actually use. Use this page for guidance.
- As long as you use the correct resolution it should be possible to use this utility in full screen, though I didn't try
- The colours are important. If you use a custom tileset there's a good chance that you have to change them. Use the ctrl+m tool of the mapmaker to find them. Here's an explaination of what each colour is:
1. SeparatorColour - the dominant colour of that vertical bar that separates the menus from the game view
2. BackgroundColour - the colour of the background in the construction menu
3. SelectedColour - if the material is selected all it's tiles have at least one pixel of this colour
4. NotSelectedColour - if the material isn't selected all it's tiles have at least one pixel of this colour
0.915 -> 0.916 changes:
1. A significant bug in the "local colours" feature in the mapmaker was fixed.
2. The default ini settings were changed to work on a larger number of computers without making any changes.
3. Added an ini setting to make DFWall stop rewalling if it can't find an appropriate material (MAY BE BUGGY - OFF by default).
4. New features implemented:
- CTRL+. - use this to save what a nine and an empty tile looks like in your tileset. USAGE: select any material with at least 90 units and press this key combination. If you don't have any such material you can select any other material instead, but if you don't do that then the third of the new features below will not work correctly.
- / - use this insead of a material number to tell DFWall to use ANY material for rectangle rewalling.
- . - use this insead of a material number to tell DFWall to use any material with more than 9 units for rectangle rewalling.
- , - use this insead of a material number to tell DFWall to use any material with more than 99 units for rectangle rewalling.
0.916 -> 0.916a changes:
Fixed the "stop rewalling on error" feature not respecting its ini setting.
[ May 19, 2008: Message edited by: LordZabujca ]