Macros2d.txtReturn to: Technical Information
|Creating UO Macros Offline, by Dubious; Edited by Xena Dragon|
|updated by Petra Fyde, April 2010|
|What is a a Macro? | Understanding the File Layout | Documenting Your Settings |Mapping to Keypad Numbers|
|Editor’s Note: This article deals with creating internal UO macros.
An internal macro is defined as any macro that is unique to (and internally supported by) Ultima Online and
is useable without the assistance of any outside program.
What is a Macro?
What is a “macro” you ask? It’s a key combination (key combos) which has been defined in the UO game to “trigger” a command or series of commands. Some of UO’s commands can ONLY be triggered by a macro (such as “bow” and “salute”), so you really need to learn how to create them. Fortunately creating macros is easy, either within the UO game itself or offline.
First, you need to recognize that there are two kinds of macros: UO macros, and Windows macros. UO macros are a part of the game interface, and run within the game. Windows macros run within Windows but outside of the game and game
The default UO macro definitions reside in a file in the UO game directory on YOUR local hard drive (not the UO server) called, oddly enough, “macros2d.txt”.
Every UO character has it’s own macros2d.txt file. Whenever you create a new character in UO, a directory on your disk is created. You can find that directory at C:\Documents and Settings\[WindowsUserName]\My Documents\EA Games\Ultima Online Legacy\User Data\[accountname]\[shardname]\[charactername]. The macros2d.txt
There is another file called “default.mac” which is initially identical to “macros2d.txt”, but the latter is the one which holds your customizations.
Understanding The File Layout
The file layout is very simple: no blank lines; each macro begins with a line identifying the key combo which activates it; the game commands each on a separate line; and the definition ends with a separator line of exactly eight (8) “pound signs” (#). For example the default definition of “Open Backpack” (provided by UO in the initial “macros2d.txt” and “default.mac” files) is:
Several entries would look like this:
(Note the 4th macro, Ctrl-b, consists of two game commands: the bow action, and “Say”.)
Outside of knowing the game commands which can be used in a macro, the trickiest part is understanding the first, key combo, line. That’s dead easy and logical.
The sequence for the key combo line and it’s bit-map is:
So the default “Open Backpack” macro (key combo: B 1 0 0) is triggered by “CTRL-b”.
Multiple “modifier keys” can be used in combination. You could define “Open Backpack” as any of the following:
Valid keys (tested so far), as recognized by UO macros are:
Keys with special meaning when used at the beginning of the text, either during normal game conversation or in a “Say” macro (each is followed by a required space to have the defined effect):
All work with all the modifier keys, with the exception of the keypad numbers.*
Documenting your Settings
This leads to a related issue: how to document your key combos so you can easily find the macro you need at the moment. How you decide to arrange it is up to you (I use one sheet for function keys and numbers, another for letters), but fitting as much as possible on a page can get to be a challenge. All those “Ctrl-Alt-shift-b” entries will chew up half your available space just to identify the key. The solution I’ve found is to use a symbol for each modifier key. A common notation scheme easy to keep straight is:
In my diagrams, I prefer to put the trigger key first since that’s what I look for first on the keyboard. I also depict the modifier keys in the same order as the bit-map to reinforce the pattern, and print the legend of “symbol to key” across the top of each page. So the same possible set of key combos for “Open Backpack” could be represented by:
Using this scheme, I can easily fit three columns of key combos across a page. I also use “Shift” + the “Open” key combo as the “Close” combo. Therefor “b^” for “Open Backpack” has the companion combo of “b^#” defined as “Close Backpack”.
A last bit of advice: When in doubt about whether or not a key combo will work, or how it’s represented in the “macros2d.txt” file, try to create a macro from the game paperdoll “Options” screen and then check the results in your “macros2d.txt” file. Now that you know what you’re looking at, it’s easy to work out.
Mapping to Keypad Numbers
It is possible to map macros to the keypad numbers, however to do so you must turn off ‘Num Lock’. In addition you need to check that the keynames.txt file uses the same description for the keys. To do this, first record a test macro through the paperdoll in game, with Num Lock off. Next open the character’s macro2d.txt file in notepad and find the macro:
NUM 1 1 1 0
+S a y t h i s i s a t e s t
In this example the key used is ctrl – Alt – NUM 1 (note the recorded entry in the macro2d.txt file generated the number as NUM – all caps.)
This file must have exactly the same name for the keys as that generated in the macros2d.txt file. If they are different, edit this file to match the macros2d.txt file. If the case formatting in the keynames.txt file does not match that generated in the macros2d.txt file, when recording a macro through the paperdoll, the macro will not save.
– Petra Fyde
Last modified: June 15, 2013