31
DF Modding / Re: Mouse Fortress v1.2c for DF 34.07 - Custom Menu and Hotkey Framework!
« on: April 24, 2012, 08:36:09 am »
Sorry about the delay in responding, I've been pretty busy lately. (And the forum decided not to notify me about the new posts for some reason) 
The reason why it can't shift-move diagonally is because the game only seems to support shift-moving with the arrow keys.
I'll see if it's faster if I omit the diagonal movement, though.
Yeah, that looks like it was just a typo on my part
, I'll be sure to fix it for the next release.
Ah, that looks like something I'll have to add in. I usually don't zoom, so I forgot you could do that.
The {} just denote a key name, without those it would send each letter, so the syntax for sending keys is a bit different in that way from the hotkey syntax.
The uncompiled scripts are just there in so that people can look through them if they want to see how it works, the actual running script always references the compiled ones. If you have any questions about the script, feel free to ask!
Hehe, yeah, the main reason I made this is because I always thought that DF could be improved by adding actual mouse support.

Just a quick question: The cursor controls are always really zippy, unless it needs to move diagonally. Why doesn't the script shift-move diagonally like it does orthogonally? Or even just jump quickly on an orthogonal to close the distance faster?
The reason why it can't shift-move diagonally is because the game only seems to support shift-moving with the arrow keys.
I'll see if it's faster if I omit the diagonal movement, though.Great utility, just what I always hoped for ever since I started playing DF, thanks a lot.
Minor bug: Workshops did not show up in the menu, so I had to change a line in menus.txt:
Instead of "Workshops|g(Buildings)" I wrote "Workshops|Buildings" and now everything seems to work as intended.
I was unsure if I should retain the original line, but I decided that it probably was a meaningless command, a sort of mental typo on the developerīs part (as I believe it can be translated into "go to in-game Building-menu", and DF has no Building-menu (but MouseFort has)), so I left it out. Hope I didnīt break anything, I have no programming skills whatsoever.
Yeah, that looks like it was just a typo on my part
, I'll be sure to fix it for the next release.Another minor bug/glitch/unintended complication: Somehow () I accidentally triggered the zoom with my mousewheel to a very, very far out zoom, and it seems I canīt access this function again to zoom back in, unless I quit the script.
I tried to add two new lines to the keys.txt file, to trigger the default DF MouseWheel command with a ctrl-command, like:
^Wheelup|k{Wheelup}
^Wheeldown|k{Wheeldown}
but it didnīt work. I also tried to leave the "k" out, as a wheelup probably isnt a key (?), but to no avail.
I guess the script does not understand the term {Wheelup}, or perhaps it needs another function trigger instead of "k", but as I said, I am no programmer, and have no idea what I am talking about. Nevertheless, I have already added some more valuable DFHack functions to my script, like copystock and some watch functions, and I really would like to be able also to define some more functions for my mouse.
What shall I write on the right side of the vertical line, to make the script understand that when I use ctrl-Wheelup/down I want the script to do a default Wheelup/down, ie. a zoom?
edit: I checked the syntax and found out that I had left out some "("s and ")"s. The following string makes the game zoom on Ctrl-Mousewheel(up/down):
^Wheelup|k({Wheelup})
^Wheeldown|k({Wheeldown})
Ah, that looks like something I'll have to add in. I usually don't zoom, so I forgot you could do that.
The {} just denote a key name, without those it would send each letter, so the syntax for sending keys is a bit different in that way from the hotkey syntax.Two more question:
How do I install the non-compiled scripts to try them out?
And after installing them, how do I figure out what they actually do? Do they show up in the menu?
Reading the said files gave me no clues whatsoever, not being a programmer and all that. Reading the tutorials on the AHK site just made me even more confused. Please, help. I apologize for being so stupid![]()
edit: Okay, now I understand, the uncompiled scripts are provided for inspection - sorry again for being stupid.
PS I just found an old post i made on this forum back in 2010:
Quote: "I wish someone with programming skills (and I believe quite a few DF-players are programmers) would create some kind of consistent interface on top of the existing interface, so that you could input orders with the mouse from a menu and place structures on the map with the mouse (or something). I have no programming skills so I don't know if this is at all possible."
Thanks again, Shukaro!!!!
The uncompiled scripts are just there in so that people can look through them if they want to see how it works, the actual running script always references the compiled ones. If you have any questions about the script, feel free to ask!
Hehe, yeah, the main reason I made this is because I always thought that DF could be improved by adding actual mouse support.
) I accidentally triggered the zoom with my mousewheel to a very, very far out zoom, and it seems I canīt access this function again to zoom back in, unless I quit the script.