MapTool Macros – Basic dice macros

As promised, it’s time I share some of what I’ve learned in putting together MapTool macros for my D&D Fourth Edition campaign.  My characters are a dragonborn swordmage, a deva druid and an eladrin rogue adventuring through the Keep on the Shadowfell.  They’re second-level characters, so they don’t have too many powers yet, but they have enough powers to require me to write some interesting macros for their attacks.

Before I go farther, I should mention that the MapTool wiki has great macro writing resources.  That’s how I learned most of what I’ve figured out so far.  So, be sure to check that resource out as well.

I’ll start with some simple campaign macros – about as simple as MapTool macros can get.  Every macro in MapTool is tied either to a token (token macros), a campaign (campaign macros) or to your MapTool program itself (global macros).  I personally haven’t created any global macros yet, and most of the really interesting macros I’ve made so far are tied to tokens (mostly the player character tokens), but let’s start with a simple campaign macro – a button that will let anyone in the game roll a d20 with one click.

In order to create a Campaign macro, you have to be able to see the Campaign window (usually a skinny little window near the bottom of your MapTool screen).  If you can’t see it, go to the Window menu in MapTool and click Campaign.  The Campaign window starts off pretty much empty.  To create a new campaign macro, right click in the Campaign window and select Add New Macro.  This will cause a little button with the label (new) to appear in the window.  Go ahead and click that button.

Nothing happened?  Well, that’s because the macro starts off with no code to execute by default.  We’ll fix that.  Right click on the (new) button and select Edit.  The window below should pop up.

New MacroNow you’re writing a macro.  Begin by changing the label in the top box from (new) to something more descriptive – in this case, let’s call it “d20” (you don’t need the quotes).  You can leave the Group and Sort Prefix boxes blank for now (they’re optional).  The meat of the action is in the Command box below.  We want this macro to show the result of a d20 roll in the chat window for whoever presses the button.  If you want this to be dead simple, all you need to do is type [d20] (in square brackets, just like I’ve done) into the Command box and click OK.  This will change the name of the button to d20.  When you click it now, you’ll get something like this in the chat window:

OnlineDM: 7

If you mouse over the number in the chat window, you’ll see ToolTip text that reads:

<< d20 = 7 >>

This tells whoever is interested that the 7 in the text box is the result of a d20 roll.

This is all right, but we can do better.  The command [d20] in square brackets tells MapTool to randomly generate a number between 1 and 20 and output the result to the chat window (with a ToolTip that shows that it’s the result of a d20 roll) as a message from whoever hit the button.  Just looking at the result, though, you can’t really tell that it’s a d20 roll.  Let’s format it nice and prettily.

Right click on the d20 button and select Edit again.  This time, put the following text in the Command box:

d20 roll: <b>[d20]</b>

And then click OK.  Now when you click the button, you’ll get output that looks like this:

OnlineDM: d20 roll: 19

All we’ve done is add a little extra text that shows up in the window (“d20 roll:”) and put the result of the roll in bold face (using the <b> and </b> HTML tags to surround the text that we want to show up in bold).  It’s not absolutely necessary, but it’s a nice thing to have, especially if you’re rolling lots of dice and you want to see at a glance which number came from which die roll.

You can now create a whole set of simple dice macros for your campaign – d20, d12, d10, d8, d6 and d4 – following the same process.  (If you have a weird sense of humor, you could create d47 or whatever you like.)  You can enter something like “Basic Dice” into the Group box for each macro, which will group the buttons together in a little box within the Campaign window that’s labeled “Basic Dice”.  You can also specify the order in which the buttons will appear within that box by using the Sort Prefix box in each macro.  I’ve given the d20 button the Sort Prefix of 1, so it shows up first, and then gone in decreasing dice values from there (d12 is 2, d10 is 3, etc.).  Feel free to go from d4 to d6 and on up to d20 if you prefer.

It’s worth noting that all of these simple dice macros are totally optional.  You could just type “/roll d20” into the chat window, getting output that reads something like:

* OnlineDM rolls: d20 => 9

Personally, I prefer the buttons.  They’re way quicker.  The /roll command also lets you do things like /roll 2d8 + 2d6 + 5, getting output such as:

* OnlineDM rolls: 2d8+2d6+5 => 3 + 5 + 5 = 13

For that sort of thing, though, I’m going with fancy-schmancy attack macros.  Tune in for the next post!

Leave a Reply