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

Difference Between charname_output and npc_name_flag

1664377179

Edited 1664377441
Tara
Pro
So I'm trying to understand the difference between these two. I'm using the Roll 20 5E Sheet, I created a ghost, set up the actions in the sheet, then copied them into macros (which I normally do so I can link them in a template macro that I put in the token action bar). For the ghost, their possession has a recharge, so I wanted to create a macro for that as well. I noticed that charname is generated in my other macros with ` @{Ghost|npc_name_flag}` attribute. For example, as in the ghost's Whithering Touch macro: @{Ghost|wtype}&{template:npcatk} {{attack=1}} {{damage=1}} {{dmg1flag=1}}  @{Ghost|npc_name_flag} {{rname=[Whithering Touch](~-ND2yJ6ct_dVoA7Whi7s|repeating_npcaction_-ND3-uQXbcH44uC8nnBl_npc_dmg)}} {{rnamec=[Whithering Touch](~-ND2yJ6ct_dVoA7Whi7s|repeating_npcaction_-ND3-uQXbcH44uC8nnBl_npc_crit)}} {{type=[^{attack-u}](~-ND2yJ6ct_dVoA7Whi7s|repeating_npcaction_-ND3-uQXbcH44uC8nnBl_npc_dmg)}} {{typec=[^{attack-u}](~-ND2yJ6ct_dVoA7Whi7s|repeating_npcaction_-ND3-uQXbcH44uC8nnBl_npc_crit)}} {{r1=[[@{Ghost|d20}+(5+0)]]}} @{Ghost|rtype}+(5+0)]]}} @{Ghost|charname_output} So I figured I could just create a macro to roll the recharge, and I came up with this: /w gm &{template:simple} @{Ghost|npc_name_flag} {{rname=Possession Recharge}} {{r1=[[1d6]]}} {{normal=1}} But that didn't work and I wound up having to use /w gm &{template:simple} @{Ghost|charname_output} {{rname=Possession Recharge}} {{r1=[[1d6]]}} {{normal=1}} What is the difference? why is the npc_name_flag working in the action-generated macro but not the custom macro I produced manually? Also, is there a way to get the left side (the 'Ghost' part) or @{Ghost|charname_output} or @{Ghost|npc_name_flag} to update automatically when I change the name (like if I'm duplicating the character sheet and/or renaming it - the idea is to be able to import it from the vault then duplicate it and rename it Ghost 1, Ghost 2, etc... for campaigns that have multiple ghosts in them)
1664380704

Edited 1664380760
If you run the two attribute calls on their own, you should see this: @{Ghost|npc_name_flag} {{name=Ghost}} @{Ghost|charname_output} {{charname=Ghost}} The difference is simply where the name will appear in the various roll templates for the D&D 5E by Roll20 sheet . The 'npcatk' sheet doesn't use the 'charname' reference, and the 'simple' sheet doesn't use the 'name' reference. As far as automatically updating the 'character_name' in the macro, that would require an API script.   But there are other options that may work for you: 1. Change the macro to not use the 'character_name', and use 'selected' instead. That way it won't matter what the name of the character is. @{selected|npc_name_flag} 2. Change the 'npc_name' to '@{selected|token_name}'.  (That is the name listed at the top of the 'Character Sheet' tab of the character sheet.). That way you can uniquely name each token, such as by using the TokenNameNumber script, or a token setup macro using TokenMod and/or ChatSetAttr. You may also be interested in using a chat menu approach instead of custom macros on each character.
Jarren said: You may also be interested in using a chat menu approach instead of custom macros on each character. I've been using something like this: /w gm &{template:default} {{name=Ghost}} {{Actions=[Whithering Touch](~Whithering_Touch) | [Etherealness](~Etherealness)}} {{Traits=[](~)}} but you're looks a lot neater, so I'll definitely check it out. Thanks!