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 .
×

Macro help, calling a name from an attribute to call an attribute from a different character (nesting?)

1664200764

Edited 1664200905
So I have a game where each of my NPC characters is "paired" with another character, I do this by adding a custom attribute "paired_char" to thier character sheet containing the name of character they are paired with and I want a macro to be able to select a character and find the attributes from their paired character. At few days ago I found this which seemed promissing, I ran the code @{selected|@{character_name}|repeating_npcaction_$0_attack_tohit} And it seemed to run perfectly fine in finding the attribute of who I was selecting and it seemed all I had to do was change character_name with paired_char, and repeating_npcaction_$0_attack_tohit with whatever attribute I was looking for and it should work. For example @{selected|@{paired_char}|Strength} Should get me the strength of the character paired with the character I have selected But then after messing around a bit, I came back to it today and the original line of code i was referencing doesn't even work now even though I could swear it worked five days ago. I've tried looking into macro nesting and html entity replacements and none of it seems to work. When I try to original code I get No attribute was found for @{selected|@{character_name} No character was found for 'character_name' I am using the DND5e Charactersheet by roll20 if that matters at all. Any help would be appreciated, thanks.
Sound like you need the Prefix Trick to Variably Call Attributes from the Tips and tricks thread.