Introducing a template-based designation and construction automation tool: LinDesignator!
Current Version:
LinDesignator Version 0.06bNew in this version:
Fixed error with #dig and #place templates
Now outputs macros in the format of the built-in DF macro engine for DF 0.31 or greater. (For the old 40d* macros, use
version 0.05)
Added simple GUI.
Note: This seems like it may be the last version I release. I don't plan on adding any more features currently (but if a bug crops up I will fix it). Also, I release the complete copyrights to LinDesignator to the public domain. You are free to use, modify, and redistribute as you like. (This software is provided as-is, with no claims of merchantability or fitness for purpose, etc.)
The goal of this program is to automate designation of digging, construction, stockpiles and other things for Dwarf Fortress running on Linux and Windows systems. It will eventually be compatible and hopefully comparable to the QuickForts tool for Windows.
Currently it supports a wide variety of operations, and should be able to run most QuickFort .csv templates without alteration.
Instructions:
This is still an early version so it may be difficult to run and bugs may exist.
To run the GUI either doubleclick on LinDesignatorGUI.py or run the command 'python LinDesignatorGUI.py'. Then select the source and destination files. Then press "Convert" to run the conversion. Then a message box will pop up to let you know if it succeeded or not. The GUI also takes command line parameters, so you can do something like 'python LinDesignatorGUI.py mymacro.csv mymacro.mak'.
To run the program, open a terminal and run the following command:
'python LinDesignator.py mymacro.csv > mymacro.mak'
where mymacro.csv is the template file to generate a macro for. This will generate a macro in the file 'mymacro.mak' which can be placed in the data/init/macro folder and then loaded using Ctrl-l. The macro will start at the position specified by the macro file (or 0,0 if not specified). The 2nd and 3rd command line parameters can be used to control the start position. Note that the cell in the first row of the first column is in position (0,0), not the (1,1) used by QuickForts.
Troubleshooting:
1. Your program said something like 'Bad QF command: ...for state=...'.
a. Congratulations, you found an unhandled condition.
If it said 'Bad QF command', then the stateful key translater doesn't know of a DwarfFortress command corresponding to the QuickFort Command for this menu. This could be (i) a bug in the template, (ii), an extra menu option that is not currently handled, or (iii) a bug in the state machine so it is processing the wrong menu. Note that (i) and (ii) are the most likely options. For case (i) fix the template!. For case (ii), you can find the appropriate DF command in interface.txt and add an entry for it in StatefullQFCommandTranslator.py under the menu specified by the error message. The format is 'QFcommand' : ('DFcommand','NextState'). Also post to the forum so that later versions can be fixed.
Differences with QuickFort:
The %wait% macro is not supported. Please use {wait} instead.
The '<' and '>' keys are not supported in templates.
New in this Version:
--0.06b--Fixed error with #build and #place templates
--0.06--
Changed output to DF 0.31+ macros
Added GUI
--0.05--Changed output to DF 40d* format macros
--0.03b--Fixed bug where the last command in a group with no macros was ignored.
--0.03a--
Removed debugging code that redirected output to terminal instead of xte.
--0.03--
Stateful key translation (reduces the amount of ambiguous actions)
Compatibility with QuickFort 1.03 templates
Up and down levels using the #< and #> notation used by quickforts (also next template this level with #!)
Block grouping of designations, constructions and stockpiles