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

Dynamic Macro Names?

Is there any way to have a macro with a changing name? Use Case: I have a macro token action named attack-1 %{selected|repeating_npcaction_$0_npc_action} which uses the first action for the selected npc. (say, thief uses attack "dagger") Is there anyway for the macro to show the name of the first action on the button (dagger)?
Possibly with the API by creating the Token Action with a reference to the name but the regular system can't. The Button labels are static.
You could use API buttons that luckily do not require a pro account to use. It will put a series of buttons in the chat that the player can click on to select the attack. I made this macro for my 5e game using the 5E Community sheet, but it can be adapted to which ever sheet you are using. /w @{selected|character_name} &{template:5eDefault}{{weapon=1}}{{subheader=Attack}}{{title=@{selected|character_name}}} {{subheader2=with}} {{Melee 1=[ @{selected|meleeweaponname1}](~selected|MeleeAttack1)}} {{Melee 2=[ @{selected|meleeweaponname2}](~selected|MeleeAttack2)}} {{Melee 3=[ @{selected|meleeweaponname3}](~selected|MeleeAttack3)}} {{Melee 4=[ @{selected|meleeweaponname4}](~selected|MeleeAttack4)}} {{Melee 5=[ @{selected|meleeweaponname5}](~selected|MeleeAttack5)}} {{Melee 6=[ @{selected|meleeweaponname6}](~selected|MeleeAttack6)}} {{Ranged 1=[ @{selected|rangedweaponname1}](~selected|RangedAttack1)}} {{Ranged 2=[ @{selected|rangedweaponname2}](~selected|RangedAttack2)}} {{Ranged 3=[ @{selected|rangedweaponname3}](~selected|RangedAttack3)}} {{Ranged 4=[ @{selected|rangedweaponname4}](~selected|RangedAttack4)}} {{Ranged 5=[ @{selected|rangedweaponname5}](~selected|RangedAttack5)}} {{Ranged 6=[ @{selected|rangedweaponname6}](~selected|RangedAttack6)}} @{selected|classactionmeleeweapon} I  have it whispering to the player to keep chat spam down. It pulls the name of the weapon and puts in the buttons. I left a blank space in front of the name in case there is no weapon name, that keeps the button from breaking. It come out looking like this: