Hi there.
I want to make a single Macro Bar button to handle a handful of Token Mod and ChatSetAttr commands, but the commands using the | character is messing up the dropdown.
Anyone know how to make it work?
Hi there.
I want to make a single Macro Bar button to handle a handful of Token Mod and ChatSetAttr commands, but the commands using the | character is messing up the dropdown.
Anyone know how to make it work?
From the ChatSetAttr README:
If you want to use the '|' or '#' characters inside an attribute value, you may escape them with a backslash: use '|' or '#' instead.
For TokenMod, you can replace the '|' with a '#'.
If you post your code then someone can help make sure it’s parsed correctly.
I think I worked it out.
I kept seeing examples with [[ ]] around the macro, but removing them gets it all to work.
Here's the macro, just as an FYI:
?{Scourge |
PC 0,!setattr --sel --scourge# |
PC +2,!modattr --sel --scourge#2 |
PC +4,!modattr --sel --scourge#4 |
PC Trigger,!modattr --sel --hp#-scourge
!modattr --sel --scourge#-1 |
NPC 0,!token-mod --set bar3_value# |
NPC +2,!token-mod --set bar3_value#+2 |
NPC +4,!token-mod --set bar3_value#+4 |
NPC Trigger,!token-mod --set bar1_value#-@{selected|bar3}
!token-mod --set bar3_value#-1 }
If you have hard time getting a dropdown to work, you could write a Chat Menu that when activated shows in Chat a list of buttons to the commands you want. Example with API/Mod command: https://wiki.roll20.net/Chat_Menus#Bit_of_Everything
While using a Chat Menus results in one extra click, it's often easier to create instead of some dropdowns that will need lots of special characters to work. Menus are smart to whisper to self or GM to avoid cluttering player's chat.
Or you could group all tokenmod commands in one macro dropdown menu like this, and then have the setAttr in a separate dropdown.