Macros/keymaps question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jude
    Adept
    • Nov 2007
    • 124

    Macros/keymaps question

    OK so in Zangband (I assume this is the same for all variants but I figured I'd post in in this forum since it was Z) I was trying to figure out how to use the macros to make spellcasting shortcuts. It seemed simple enough from the help file. But then I went to the "access macros" screen and found there's both "macros" and "keymaps" and I don't know the difference, and there's also the "create a new action" button and I have no clue what that is.

    Anyway I decided to start off simple by creating a simple shortcut for my bread and butter Malediction spell. I picked "g" since it's not used for anything important (extraneous movement command afaik) and it's close to where my left hand usually sits, in reach of my pinky. Anyway, that worked fine, so I set up a couple more for some other basic spells.

    Now, what was weird was, first I tried doing this with macros and nothing seemed to happen. Then I was like "well ok" and did the same with keymaps, and it worked. I had no clue why since I'm illiterate about this stuff but everything seemed fine. Then I tried to buy some potions of Cure Serious Wounds which were in slot "g" in the store, and there the trouble started...it didn't recognize my "g" command, presumably because I'd keymapped that to "cast Malediction." I checked the readme and it said you could press backslash and then a command to access the underlying command, but this didn't help with the store (incidentally, in the various options and macros menus, the g key doesn't work either, I assume for the same reason. E and F, of course, work fine).

    Anyway, I tried "remove a keymap/macro" to no avail, there doesn't seem to be any way to undo this....

    So, a) how do I fix this and b) could anyone give a brief tutorial on how to use these things so a computer-idiot can understand? And what's the difference between keymaps and macros?
  • Pete Mack
    Prophet
    • Apr 2007
    • 6883

    #2
    Originally posted by Jude

    Anyway, I tried "remove a keymap/macro" to no avail, there doesn't seem to be any way to undo this....

    So, a) how do I fix this and b) could anyone give a brief tutorial on how to use these things so a computer-idiot can understand? And what's the difference between keymaps and macros?
    A keymap defines a new command, and it's almost always what you want to use. Macros are more primitive; they are designed for complex entries like function and arrow keys. (These are represented to an ascii string on some platforms.) And they cannot be overridden with backslash. You should never define a macro for a single character input. You don't want to use them, unless you are trying to define a macro for a function key.

    If you botch up your macros, the right thing to do is to clear them (it's one of the options) and then redefine your keymaps.

    Comment

    • Jude
      Adept
      • Nov 2007
      • 124

      #3
      Thanks...so wait, if I just use the keymap, that shouldn't mess with stores and stuff?
      Last edited by Jude; November 17, 2007, 01:07.

      Comment

      • Jude
        Adept
        • Nov 2007
        • 124

        #4
        Hmmm....the problem still seems to be persisting...I even tried making a new character file to start from scratch and seeing if the same thing happened when I keymapped G, and it did...any idea what's up?

        Comment

        • Fuma
          Adept
          • May 2007
          • 114

          #5
          I always thought it's the other way around. Macros = good. Keymaps = don't touch.
          But then again, I only use macros with the function keys.

          If you're playing spellcasters Jude, you should get used to function keys IMO. You can have an enormous amount of macros with them (sixty or more) and there's little risk that you'll accidentally press a function key, as opposed to, say 'g'.

          I usually use F1-F12 for the first book and random stuff like shooting or activating rods.
          Shift-Fx for the second book, ctrl-Fx for the third, alt-Fx for the fourth, and ctrl-shift-Fx for the fifth. (if I get that far)
          www.snowleopard.org - International Snow Leopard Trust

          Comment

          • Lipa
            Rookie
            • Jul 2007
            • 24

            #6
            I agree - macros + function keys are your best bet. Also, don't forget about the "inscribe" feature!

            So for example, let's say you want to create a macro for the second spell in one of the books. First, inscribe the book with @1 (or some other number). Then, choose one of the function keys and create the macro: m1b (m - cast a spell, 1 - book inscribed with @1, b - second spell in the book). That's it!

            Cheers!

            Comment

            • Jude
              Adept
              • Nov 2007
              • 124

              #7
              Wait, you can use the function keys? I thought I'd tried them and it didn't work...Well, I'll give that a shot...

              So what IS the difference between macros and keymaps?

              Anyway thanks for the help!

              Edit: Hey, it works! What do you know.

              Comment

              • Pete Mack
                Prophet
                • Apr 2007
                • 6883

                #8
                Originally posted by Fuma
                I always thought it's the other way around. Macros = good. Keymaps = don't touch.
                But then again, I only use macros with the function keys.
                Ah, that makes sense. Since I play with the roguelike keyset, the number keys are all available for keymaps. So I use them, because they are easier to reach than the function keys.

                Comment

                Working...
                😀
                😂
                🥰
                😘
                🤢
                😎
                😞
                😡
                👍
                👎