v50 Steam/Premium information for editors
- v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
- Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.
Editing v0.34:Macros and keymaps
Jump to navigation
Jump to search
Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.
You are editing a page for an older version of Dwarf Fortress ("Main" is the current version, not "v0.34"). Please make sure you intend to do this. If you are here by mistake, see the current page instead.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 13: | Line 13: | ||
*{{k|Ctrl}}+{{k|p}} = play | *{{k|Ctrl}}+{{k|p}} = play | ||
− | To create a macro, press {{k|Ctrl}}+{{k|r}} to begin recording your actions. When you have recorded all the actions that you want, stop recording by hitting {{k|Ctrl}}+{{k|r}} again and save ({{k|Ctrl}}+{{k|s}}) the macro. The macro is then added to your macro list. To load a macro from the list just press {{k|Ctrl}}+{{k|l}}. You can then play the macro by pressing {{k|Ctrl}}+{{k|p}} whenever you want. You can also set a macro to repeat by pressing {{k|Ctrl}}+{{k|u}}, typing a two digit number, and then pressing {{k|Ctrl}}+{{k|p}} to begin the playback session. Moving your mouse from the | + | To create a macro, press {{k|Ctrl}}+{{k|r}} to begin recording your actions. When you have recorded all the actions that you want, stop recording by hitting {{k|Ctrl}}+{{k|r}} again and save ({{k|Ctrl}}+{{k|s}}) the macro. The macro is then added to your macro list. To load a macro from the list just press {{k|Ctrl}}+{{k|l}}. You can then play the macro by pressing {{k|Ctrl}}+{{k|p}} whenever you want. You can also set a macro to repeat by pressing {{k|Ctrl}}+{{k|u}}, typing a two digit number, and then pressing {{k|Ctrl}}+{{k|p}} to begin the playback session. Moving your mouse from the window{{verify}}, or otherwise losing focus on DwarfFortress, is <s>an annoying way</s> a good way to interrupt a macro session from continuing (also the only known method{{verify}}). |
− | There is a directory data/init/macros for them. The macros are saved in .mak format. | + | There is a directory data/init/macros for them. The macros are saved in .mak format. Even a recorded file for a simple macro - for example to create a 3 tiles wide ramp - may already consist of up to 50 commands listed. This is because every possible [[Key_bindings|binding of the key pressed]] is included in the macro and put in a block (and {{k|r}} for ramp has many by default). |
<pre> | <pre> | ||
pressing_enter_recorded | pressing_enter_recorded | ||
Line 56: | Line 56: | ||
It is unknown if there is the possibility of creationg loops/iterations, other programming features or comments.<br /> | It is unknown if there is the possibility of creationg loops/iterations, other programming features or comments.<br /> | ||
− | + | Changing, removing and adding macros while the game is running uses a counter-intuitive process. After editing the file, you must delete and reload the macro. Select Options>KeyBindings>Macros. Delete the macro and reload it with {{k|Ctrl}}+{{k|l}}. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
=== Tuning macros === | === Tuning macros === | ||
Line 186: | Line 166: | ||
</pre> | </pre> | ||
− | |||
* The <code>MACRO_MS</code> setting is the number of milliseconds between macro instructions (the default, 15, allows 1000/15 instructions per second, or about 66). Decreasing this makes macros run '''faster''', although decreasing it too far can make the game unresponsive while the macro is running. | * The <code>MACRO_MS</code> setting is the number of milliseconds between macro instructions (the default, 15, allows 1000/15 instructions per second, or about 66). Decreasing this makes macros run '''faster''', although decreasing it too far can make the game unresponsive while the macro is running. | ||
* The <code>KEY_REPEAT_ACCEL_START</code> and <code>KEY_REPEAT_ACCEL_LIMIT</code> settings are unrelated to macros (except while recording). See [[Technical tricks#Keyboard|Technical tricks]] for more information. | * The <code>KEY_REPEAT_ACCEL_START</code> and <code>KEY_REPEAT_ACCEL_LIMIT</code> settings are unrelated to macros (except while recording). See [[Technical tricks#Keyboard|Technical tricks]] for more information. | ||
Line 196: | Line 175: | ||
=== AutoHotKey === | === AutoHotKey === | ||
− | + | # Go to [[Utilities#AutoHotKey]] and download AutoHotKey. Installation is simple and the program uses few system resources. | |
− | + | # Write macro scripts (file type .ahk), which may contain any number of commands. You activate scripts by double-clicking .ahk files and deactivate them by right-clicking the AutoHotKey icon on the task bar. Both of these can be done at any time - even right in the middle of a game. AutoHotKey also allows for automated activation of scripts. | |
− | |||
− | # Go to | ||
− | # | ||
=== Fluxbox + xvkbd === | === Fluxbox + xvkbd === | ||
For linux, it's a quite cool solution. It's possible to create macros with outside tools, like fluxbox (linux window manager) + xvkbd (linux virtual keyboard for kiosks, with some macro capabilities). See the documentation [[Fluxbox_macros|here]]. | For linux, it's a quite cool solution. It's possible to create macros with outside tools, like fluxbox (linux window manager) + xvkbd (linux virtual keyboard for kiosks, with some macro capabilities). See the documentation [[Fluxbox_macros|here]]. | ||
− | Pros | + | *Pros |
− | *Faster | + | **Faster executations |
− | *Easier script writing | + | **Easier script writing |
− | *Portable code | + | **Portable code |
− | Cons | + | *Cons |
− | *Sometime needs timing | + | **Sometime needs timing |
− | *Need xvkbd (Linux at least) | + | **Need xvkbd (Linux at least) |
− | *Need some special key reservation | + | **Need some special key reservation |
− | '''Please see also the [[40d:Macros and Keymaps|40d macros page]], as much of what is there works perfectly fine. If you can verify it works, please move it to this page.''' | + | :'''Please see also the [[40d:Macros and Keymaps|40d macros page]], as much of what is there works perfectly fine. If you can verify it works, please move it to this page.''' |
== Useful Macro Ideas == | == Useful Macro Ideas == | ||
Line 229: | Line 205: | ||
Start a new macro ({{k|Ctrl}}+{{k|r}}) and place the bed (selecting the first bed from the list), then move to the next bedroom in sequence. Repeat this until you reach the end of the row. If you are placing beds into multiple long rows of bedrooms, move the cursor to the first bed in the next row to make things faster. Turn off macro recording ({{k|Ctrl}}+{{k|r}}), but don't exit the build menu. You can then save your macro if you wish, though it's not necessary. Play the macro ({{k|Ctrl}}+{{k|p}}), and you have just laid out another row. Repeat until you have enough bedrooms or you run out of beds. | Start a new macro ({{k|Ctrl}}+{{k|r}}) and place the bed (selecting the first bed from the list), then move to the next bedroom in sequence. Repeat this until you reach the end of the row. If you are placing beds into multiple long rows of bedrooms, move the cursor to the first bed in the next row to make things faster. Turn off macro recording ({{k|Ctrl}}+{{k|r}}), but don't exit the build menu. You can then save your macro if you wish, though it's not necessary. Play the macro ({{k|Ctrl}}+{{k|p}}), and you have just laid out another row. Repeat until you have enough bedrooms or you run out of beds. | ||
+ | |||
+ | ==== Placing Other Furniture ==== | ||
+ | |||
+ | You can make another macro similar to the above for placing cabinets / tables / chairs / doors. Select the proper item from build menu, go to the first bedroom position wherever you want it, and repeat the record/play process above. | ||
==== Placing Coffers ==== | ==== Placing Coffers ==== | ||
Line 284: | Line 264: | ||
=== General Fortress Mode Hotkeys Script === | === General Fortress Mode Hotkeys Script === | ||
An attempt at speeding up various designations. Includes an up/down stair builder, a fast move up/down, and some select-and-advance keys. Please see [[user:DDR#Dwarf_Fortress_General_AHK_Script]]. | An attempt at speeding up various designations. Includes an up/down stair builder, a fast move up/down, and some select-and-advance keys. Please see [[user:DDR#Dwarf_Fortress_General_AHK_Script]]. | ||
+ | |||
+ | |||
+ | |||
+ | {{av}} |