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

Map-specific macros

June 15 (2 years ago)

I want to put all the monsters' macros (attack, initiative...) on the macro bar, and I want these macros to display only when on the relevant map--the map that those monsters are on. I tried putting all of the macros on a dummy character, for convenience, to have them all in one place. My plan was to have a separate dummy character for each map with the macros for the monsters on that map. I assumed that the dummy character's macros would not display unless I dragged the character on the map.

Unfortunately it didn't work out. My dummy character macros display in the macro bar no matter what map I'm on. That's too much real estate occupied by the macro bar.

Is there a way to make the macro-bar macros map-specific?

Thanks.

June 15 (2 years ago)

AFAIK, the macro bar is tied to the player (or GM) and can't be restricted to a map or character. You could make the macros specific to each monster/NPC and have them appear as token actions for those monsters/NPCs. I use the Token Action Maker MOD to create these, but you could do it manually either my adding the macros to each monster/Npc's character sheet or creating them under the collections tab.


June 15 (2 years ago)

What game are you playing and what character sheet are you using?

June 15 (2 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

Hi Elvis!

It sounds like you are describing the Token Action Bar when you talk about what you are envisioning. Is there something about the way that bar functions that does not meet your needs, or is it just a feature you are unfamiliar with?

To expand upon what Rick and Jarren were saying, if you are interested in exploring Token Actions, there is an API script (Token Action Maker) that will create those automatically for each character, but only for the D&D 5th Edition by Roll20 Sheet and Pathfinder 2 sheets. But these can also be created manually for nearly any sheet.

There are also solutions that create Chat Menus for characters, on the fly. Jarren has created a very robust system that requires no API, or the Universal Chat Menus script will do similar, but with less installation work.

June 15 (2 years ago)

Game: DnD 5e  Sheet: DnD 5e by Roll 20.    The disadvantage of the token bar, as far as I am aware, is that you have to select the token, then select the macro. So, find the token, select it, and click the macro. Whereas, in the macro bar, it's very easy to find the macro and it's just one click.

I've installed a Macro Mule, Jarren's I think.  If I'm using it correctly, it too requires more than one click. I was thinking of using that one for the more complex creatures like spellcasters and using the macro bar for simple actions.

June 15 (2 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

Unfortunately, AFAIK, there is no way to modify what appears on the Macro Bar with the API. You can create macros with the API, but the API has no hooks to change the name of a macro as it appears on the bar. You could come up with a system to dynamically re-write the contents of a macro, but without re-titling, I can 't think of a way to change the display so that the system would actually be usable.

At this point, Token Actions are the fastest way to play character-specific code that is dynamically displayer. Even with a macro mule and chat menus, the system needs to know which character is performing the action.

June 15 (2 years ago)

I thought of something, though it might be a stretch to call it a solution. I can make a map-specific-macro-character for each map, and set all the macros to Token Action, not to macro bar. Then, I drag out the appropriate macro character for the map and select the character. This map's macros appear, and the macros for other maps do not. The problem, of course, is that these macros will vanish if I select another token, for example if I select a monster to move it, and I'll need to re-select the macro character to re-display all the macros. But if I'm selecting a monster to move it then I might as well use the monster's token action macros instead of the macro character's token action macros. This isn't sounding good as I think about it more but I may give it a try anyway.

Thank you keithcurtis, Jarren, and Rick A for your responses.

June 15 (2 years ago)
Gauss
Forum Champion


Elvis P. said:

I thought of something, though it might be a stretch to call it a solution. I can make a map-specific-macro-character for each map, and set all the macros to Token Action, not to macro bar. Then, I drag out the appropriate macro character for the map and select the character. This map's macros appear, and the macros for other maps do not. The problem, of course, is that these macros will vanish if I select another token, for example if I select a monster to move it, and I'll need to re-select the macro character to re-display all the macros. But if I'm selecting a monster to move it then I might as well use the monster's token action macros instead of the macro character's token action macros. This isn't sounding good as I think about it more but I may give it a try anyway.

Thank you keithcurtis, Jarren, and Rick A for your responses.


A solution for you, although it will require some work: 

Duplicate all your characters for the maps they will be on. 
Make sure you reconnect the token to the duplicate character AND Update Default Token. 
Next, put the duplicate in a folder for that map (page). 
Now you have map specific token actions set to each character. 

With that said, what map specific token actions might a character have? Could you provide an example? 

June 15 (2 years ago)

I'm thinking of monsters, not characters. Say there are orcs on one map and giant spiders on another map. I want the orc macros to appear when I'm on the orcs' map, and to not appear when I'm on the giant spiders' map.

June 15 (2 years ago)

Edited June 15 (2 years ago)
Gauss
Forum Champion


Elvis P. said:

I'm thinking of monsters, not characters. Say there are orcs on one map and giant spiders on another map. I want the orc macros to appear when I'm on the orcs' map, and to not appear when I'm on the giant spiders' map.


In Roll20 a "Character" is a specific term referencing NPCs, PCs, Monsters, Ships, Kingdoms, etc. in the Journal tab.
Put another way: a "Character" is created when you hit "+Character", as opposed to a Handout, PDF, or Folder. :)

If you only need orc macros to appear on orcs that is easy, you don't need to do anything special. Just set them up as "Token Actions" in the Character's Attributes and Abilities tab. They will only appear when you select that token.

June 15 (2 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter


Elvis P. said:

But if I'm selecting a monster to move it then I might as well use the monster's token action macros instead of the macro character's token action macros.

I honestly think this is the easiest solution. You have to select tokens to adjust hit points, or move them as well. Selecting them to run actions is little different, and frankly, probably a lot less work than setting up some system of page-dependent macros.

June 16 (2 years ago)

Edited June 16 (2 years ago)

You might be able to do it by writing abilities/macro links (via API) to a dynamic Handout, but as Keith said, using token actions is probably the easiest.   I personally use an API I developed to always keep the character at the top of the turnorder available in my version of a character sheet that supports clickable actions like skill checks, saves, attack actions, and spells.  

June 16 (2 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

It might be possible with one of Timmaugh's metascripts to replace "selected" in a macro with the character at the top of the turn order, but then you'd still have the problem of the macro names. They would not update dynamically, nor would they adjust to the number of attacks or traits available with whatever character happens to be at the top.

June 16 (2 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

The Script Cards script, in combination with On My Turn could probably cause a display like this to automatically appear in chat for whomever was at the top of the turn order:


June 16 (2 years ago)
Card automatically appearing in chat for whomever is at the top of the turn order sounds pretty cool. I will check out ScriptCards. Thanks keithcurtis (again) and Will M. and Gauss!
June 16 (2 years ago)
timmaugh
Forum Champion
API Scripter


keithcurtis said:

It might be possible with one of Timmaugh's metascripts to replace "selected" in a macro with the character at the top of the turn order, but then you'd still have the problem of the macro names. They would not update dynamically, nor would they adjust to the number of attacks or traits available with whatever character happens to be at the top.


Yeah, Fetch gives you a handle for the current token in the Turn Order, or for one at some given offset.

Current turn's token: @(tracker.token_id)
Next turn's token: @(tracker+1.token_id)

You can return any token property, character property, or character attribute (if the token represents a character for the last 2) using that syntax. So you could get bar1 like this:

@(target.bar1)

or you could get the HP attribute like this:

@(target.hp)

There is also a page filter, which is useful if you are the GM and you see all tokens in the turn order across all pages. Players will only see (and will only get results for) the current page. The GM might need to filter it to just the current page, or to the ribbon, or to 'gm' (meaning all pages).

@(target[page].token_id)
@(target[ribbon]+1.token_id)
@(target[gm]-2.token_id)

(I think I may need to tweak the filter and resubmit to the one-click as I'm running into edge cases where it doesn't work as intended.)

In any case, I think the most applicable usage of this would be that you could, for instance, run a single ScriptCard or InsertArg menu of actions, and have that single command line build the menu based on the current token in the turn order. You might go this way if you didn't want to automatically spam the chat panel with a menu of options every time the turn changed (as you would get with an OnMyTurn solution). Instead, this method would mean that you would need to manually run the command to get the menu.

It depends on your style of play as to which you might prefer. The OnMyTurn gives a clear signal that the turn order has incremented and a new token is up, while the second method only presents a menu if you need one for the token whose turn it is.


June 27 (2 years ago)

As another option to ScriptCards, could each monster have a chat menu macro as an ability on their sheet, and have that be called via the OnMyTurn script?

June 27 (2 years ago)
timmaugh
Forum Champion
API Scripter

I believe that is what Keith was describing.

The only difference to a single ScriptCard command running with the Fetch @(tracker) calls would be that it would be a single place to edit all of the commands across all your NPCs... not sure if that is an advantage or a disadvantage, as the length of the macro could get very long. But either should be viable.