Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Loading new macros in the macros directory  (Read 1271 times)

Linknoid

  • Escaped Lunatic
    • View Profile
Loading new macros in the macros directory
« on: September 08, 2013, 03:07:42 pm »

I'm not really sure if this belongs in the Gameplay Questions section or where exactly, sorry if it's the wrong place for this.

How do I get the list of macros (with Control-L) to refresh when I update the contents of the macros directory?

If I save a macro, it goes in data/init/macros/macroname.mak, and I can edit them as text file.  If I try to reload that macro immediately, it uses the old macro in memory, and if I copy and edit one of the macros in that directory, it doesn't show up at all.  If I exit and come back in, it will then see the edits I made to the existing macro, but it still doesn't see any new files that I added.  How do I get it to recognize changes I made?

The only workaround I can come up with is to backup my macros, go through and save a bunch of existing macros with the same names, deleted the newly saved ones, and copy my edited ones back into the macros directory.
Logged

jcochran

  • Bay Watcher
    • View Profile
Re: Loading new macros in the macros directory
« Reply #1 on: September 09, 2013, 05:31:02 pm »

I don't know how to get dwarf fortress to recognize changes made to a macro short of exiting and restarting. As to recognizing new macros you've added to the directory, that's simple....

Any legal macro you drop in that directory is automatically displayed in the list. Don't have to do anything special at all.

What you've been putting in that directory aren't legal macros.
The first line of the macro has to match the name of the macro as implied by the file name. If it doesn't match, it's not legal, and won't be displayed in the macro list.
Logged

Linknoid

  • Escaped Lunatic
    • View Profile
Re: Loading new macros in the macros directory
« Reply #2 on: September 10, 2013, 05:51:57 am »

Thanks, that's very useful.  I added a sentence to the Wiki macro page documenting that fact.  I also discovered that that page contains a comment about getting it to reload:

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 Ctrl+L

Logged