Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

How do you create a macro for a specific token?

September 14 (10 years ago)
I am very new and trying to learn roll20. So far it seems very cool, but there is a bit of a learning curve. If anyone is willing to go online with me and teach me some of the ways to use macros to make games run fast, please let me know.

My specific question for this post - I want to set up tokens (bad guys) so that when they are selected, there is a button associated with them (or multiple buttons) that you can push to give you an attack roll (or other rolls that may be required). This is for Pathfinder, not that it matters.

Then anytime I use that token in the game, I just have to push the attack button. Can this be done?
September 14 (10 years ago)
Tokens per se cannot have macros, you set up macros on the character sheets and associate the token to the sheet and then the macros can pop up when the token is selected. If the sheet is set up to produce mooks, which don't keep the association, the macros don't stay. But there is always a work around. If you set up macros under your gear tab, you can call the macro by typing #macroname in the chat box. So if you had a macro named "bugbite" which you plan to use for a group of giant bugs, you could set up a macro like:

/em the spider jumps out and attacks [[1D20 +2]]

and then, if you can keep them all straight you can use specific macros without having each spider have its own sheet.
September 14 (10 years ago)
Sweet, thank you, I really like your suggestions. What does /em mean, I am a little confused on all of the / commands.
September 14 (10 years ago)
The Aaron
Roll20 Production Team
API Scripter
Actually, for mooks you can keep the association for character and just leave it off for HP and get the best of both worlds:
https://wiki.roll20.net/Linking_Tokens_to_Journals

September 14 (10 years ago)

Edited September 14 (10 years ago)
Gold
Forum Champion
I think that there is a more basic answer for putting a Macro on a token. It's called Token Actions.

Go to the gear at the top-right and make a macro. The text of your macro might be like this,

/r d20+2

Checkmark where it says "Show as Token Action".

In the permissions set that macro to be "Visible To Players"
to whichever players you want (GM only, or All Players, or a certain individual).

Done. That makes a macro for a token. When you click a token, this macro button appears at top left for anyone who you have set permission to "Visible" that token action macro.
Hey John, welcome to Roll20 and the wonderful world of RPGs!

So yeah, what the others have said is totally correct. Even Aaron, who has helpfully stolen another nickel from me by linking to my wiki entry about Mooks and such.

The nice thing about Roll20 is that it's modifiable... you can use as little or as much of its capability as you want, and nobody can say you can't. So the real question is, how complex do you want to get with this?

The probably simplest way to do this is to make one universal macro, set it as a token action, and use that for everything. Here's one that's versatile enough to do whatever you want it to do, yet simple enough that everyone can understand it:

/me rolls a [[1d20+?{modifier|0}]] for ?{reason|no reason}.

What this does is roll a d20 automatically (since almost everything in Pathfinder uses that as a base.) Then it prompts the user to add the modifier, for example the total attack bonus for that character's weapon. Then it prompts the user to provide the reason, in this case 'attack'. If you ignore the prompts that pop up, it'll default to a bonus of 0 and a reason of 'no reason'.

It'll output something like this:

Phnord Prephect (GM) rolls a [17] for no reason.
or
Phnord Prephect (GM) rolls a [22] for Attacking the goblin!

Nice and simple, but you have to put in the information every time. Not that difficult really, just read it off a piece of paper or whatever as needed. The downside is that it gets kind of boring, but hey, you can't have everything.

You can make this a 'macro' proper under settings, as others have said, and give it the property to either be onscreen all the time (as part of the macro bar) or have it only appear when a token is selected (as a Token Action).

If you want to get a little more complex, you can make a variety of 'macros' on character sheets, using the method Aaron mentioned. These are technically called "Abilities" and can be the same for all characters and creatures, or you can create different ones for each, or a combination of the two.

These, too, can be either on the Macro Bar or Token Actions.

If you want to get even more complex, you can set up Attributes for your characters, that the (iIm just gonna keep calling them 'macros' because that's what they are, really) Macros can reference. For example, you can give each character an attribute called "Weapon Attack Bonus", and make a macro similar to this:

/me rolls a [[1d20+ {Weapon_Attack_Bonus}]] to attack!

Something like that (I'm not sure if I formatted that properly but you get the idea) could similarly work, and can be set up similarly depending on when and how you want to access it.

You can get more and more intricate and detailed with your macros, even. Here's one from my previous campaign, that does all kinds of calculations at once:

@{selected|token_name} attacks @{target|token_name} with a @{selected|M1-name}!

/me Attack: [[1d20+@{selected|M1-Bonus}+@{selected|M1-damage-ability}+@{selected|bab}+@{selected|size}+@{selected|attk-melee-misc}+@{selected|attk-melee-temp}]] vs: [[@{target|AC}]]
Crit: [[@{selected|M1-crit}+@{selected|M1-Bonus}+@{selected|M1-damage-ability}+@{selected|bab}+@{selected|size}+@{selected|attk-melee-misc}+@{selected|attk-melee-temp}]] for @{selected|M1-crit-type}.

/me @{selected|token_name} does [[@{selected|M1-damage}+@{selected|M1-damage-ability}+@{selected|M1-bonus}]] points of @{selected|M1-damage-type} damage to @{target|token_name}!


This pulls all kinds of information from the Attributes section of the character sheet, compiles it together, does the math, and outputs something like:

Shank attacks Asig with a Longsword!
Shank: Attack: [17] vs [15] Crit: [21] for 3x.
Shank does [8] points of blunt damage to Asig!


And then, if you really want to get into things, you can use Character Sheets (available to everybody) that have a lot of this stuff pregenerated for you. Some, but not all, of which can also be set up as Token Actions or in the Macro Bar.

And then, if you really really get into things, you can buy a Mentor-level subscription, make your own character sheets (or modify those made by others), use the API to create various automated scripts, and get really crazy with the cheez-whiz.

This is what an attack from my current game looks like, using a modified version of Sam's Pathfinder II sheet and Honey Badger's API script for Power Cards:



The upper box is what the players see. The lower box is shown only to the GM.

Everything in my game has similar macros set up, some in Token Action form, some in Macro Bar form, some neither, some both.

And this is just one example. There are even higher levels of complexity available, and some people have done some really amazing things with automation, comparing numbers (difficult without boolean logic but possible!) and even keeping track of ammunition and the like!

So, ultimately, there is no single answer to your question. You have to find the solution that works best for you, and go with that.

Hope this wasn't too confusing!

-Phnord

ps: If you have any questions on how to implement these or other solutions, let me know, I may be able to show you directly at some point in an actual game room.
September 15 (10 years ago)
The Aaron
Roll20 Production Team
API Scripter
(How do you know I stole one if your nickels... I'm quite certain you've lost track by now! =D~ )
Oh oh oh! Can I start a nickel collection too?
Macros - Pathfinder Examples