Macros

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • iggy_hunter
    Apprentice
    • Sep 2021
    • 97

    Macros

    I've added keyboard macro support to AngbandOS http://angbandos.skarstech.com. Which brings me to this next topic ...

    Keyboard macros only work when the game is ready for the original position the macro was intended for. Usually, this position is when the character is ready for game input. The macros reek havoc if a menu is display, waiting for Rest subcommand, store command, something, something. I'm not familiar with anyone wanting keyboard macros for in store actions and the like.

    I'm considering enumerating all of the possible commands and creating a "menu" type assignment for macros.

    Examples:
    F1 => "Fire Arrow (best)"
    F2 => "Fire Standard Arrow"
    F8 => "Rest As Needed"
    F9 => "Spell Magic Missile"
    F10 => "Spell Light Room"
    F11 => "Spell Trap and Door Location"
    F12 => "Eat Ration of Food"

    With these types of assignments, the command system only accepts the macro command during game play (not store, or other weird areas like "--more--")

    Obviously, the command has to vet whether the player can actually perform that action (spell needs possession of the book etc) ... but something like this could guarantee either it works ... or nothing bad happens.

    Thoughts?
  • Julian
    Adept
    • Apr 2021
    • 122

    #2
    That’s pretty much what the current keymaps do. They only work when the game is waiting for a command.

    The game used to have both, but somebody decided it wasn’t worth the extra complexity, and, even as somebody who did use the full-blown macros, they were probably right.

    Comment

    • Pete Mack
      Prophet
      • Apr 2007
      • 6883

      #3
      The reasons to use macros are
      1. To do stty based terminal control (obsoleted by l
      ncurses library)
      2. To automate menu-based actions, like changing stance in ToME and toggle fire arrows in Sil. (I have done both.)

      Vanilla Angband has no menus suitable for (2) and can safely rely entirely on keymaps. But this is not universally true.
      With the removal of case 1, I suspect you can safely limit macros to when a command is expected, just like keymaps.

      Comment

      • Estie
        Veteran
        • Apr 2008
        • 2347

        #4
        I like to put 2 actions on the same key, like detect traps + monsters.

        Comment

        • fph
          Veteran
          • Apr 2009
          • 1030

          #5
          Many modern-day games have quick-use slots that are essentially the equivalent of Angband keymaps. Usually they are tied to inventory: first you select an object (e.g., a book), then all actions available with it (e.g., cast a spell).

          Angband strongly prefers verb-object, and the object-verb of interface hasn't been too successful when it has been tried in shops, but that's an option to consider, at least to take inspiration.
          --
          Dive fast, die young, leave a high-CHA corpse.

          Comment

          • iggy_hunter
            Apprentice
            • Sep 2021
            • 97

            #6
            fph ... Can you provide me with more detail on this setup ... I'm not fully understanding you. Maybe some examples too.

            Comment

            • newassignmentsau
              Rookie
              • Aug 2022
              • 3

              #7
              Keyboard Macros and Vetting Actions in AngbandOS

              The addition of keyboard macro support in AngbandOS is a great feature! Having the macros context-sensitive to only trigger during normal gameplay makes a lot of sense. Enumerating possible commands and tying macros to "menu" actions seems like a sensible approach. That way the macro will either execute the intended command safely or do nothing if the context is incorrect.

              Checking that the player has the required ability to execute the command is also good. It prevents unintended actions from happening if the macro was created under different circumstances.

              Overall this sounds like a thoughtful implementation that retains the convenience of macros while avoiding potential pitfalls from them triggering in incorrect states. I'm sure players will appreciate the additional customization and automation options this enables, while you've handled the complexity on the backend. Nice work!

              Let me know if you would like me to modify or expand this draft reply in any way. I'm happy to provide any clarification or additional thoughts on your proposed macro system.
              Management Assignment Help
              Assignment Help

              Comment

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