wesbaker / roll20-character-sheets

Character sheet templates created by the community for use in Roll20.
MIT License
4 stars 2 forks source link

Consistent button names for universal macros #68

Closed firako closed 3 years ago

firako commented 3 years ago

Hi Wes, Would it be possible to give buttons (particularly weapon/attack roll buttons) a consistent name so that they may be called for with a single universal macro? Currently a button's name involves a huge, randomly generated string in the following form: %{selected|repeatingweapons-MSXCKmJzDPEtqUftIsL_-aacAttackRoll}

where the randomly generated string is unique to each weapon and each character, preventing us from making a universal macro that rolls the selected token's first weapon, one that rolls the second weapon and so on.

For reference the 5e character sheet names their weapon slots in the following way: %{selected|repeatingnpcaction$0_npc_action} %{selected|repeatingnpcaction$1_npc_action} ...

wesbaker commented 3 years ago

Hmm, I can certainly look into it. It's my understanding that Roll20 generates those IDs to keep things unique, but I never did look into whether I could customize those or not (a quick glance says I cannot customize it, but I could take a closer look at the 5e sheet). Do you know if the 5e sheet is using a repeating section that can handle as many items as you throw at it, or is there a predefined number of items?

firako commented 3 years ago

It turns out you are right, the ID is made for 5e weapons too and the "$0" is the universal way to reference the ID's by their order in the list. It works fine. Apologies!